| Welcome to the Flamefusion forums. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: Being able to request Flamefusion software for free, and get it made entirely free, covering your needs! Being able to submit bug-reports or feature requests to our staff! Get free support for any computer related subjects, including programming, in all .NET based languages! Meet other programmers, and team up! |
| [SOLVED] Use "Byte" instead of "Integer"?; What's better to use? | |
|---|---|
| Tweet Topic Started: Jul 6 2009, 01:45 PM (52 Views) | |
| [FF] Rene2 | Jul 6 2009, 01:45 PM Post #1 |
|
Hey, I was wondering, if I'm using a number below 226 (Since a Byte can contain 0 trough 255), would it be better to use a byte data type? I've searched on google, and found out that a byte is 1 byte large, and an integer 4 bytes. The difference would be really minor, but I still would like to know, René. |
![]() |
|
| [FF] Mathy | Jul 6 2009, 10:09 PM Post #2 |
![]()
Administrator
|
Depends on several things. Yes, you are correct. A byte takes less RAM. However, an Integer is also a 32 bit variable, meaning that it will run faster on a 32 bit processor. Here's an example: Short - 16 bit variable. Takes less RAM than an Integer, and runs faster on 16 bit processors (Non-existent these days). Integer - 32 bit variable. Takes less RAM than a Long, and runs faster on 32 bit processors. Long - 64 bit variable. Takes more RAM than both Short and Integer, and runs faster on 64 bit processors. So if you're making operations in a long loop where thousands of executions are performed, you might want to save RAM. However, you may also sacrifice RAM to earn speed. Ribcage uses Integers everywhere, since Incineration takes care of the unused variables. This makes it a little more speedy. Thanks for using the forums. |
![]() |
|
| [FF] Mathy | Jul 7 2009, 09:47 AM Post #3 |
![]()
Administrator
|
This topic has been marked as resolved. |
![]() |
|
| [FF] Rene2 | Jul 7 2009, 04:22 PM Post #4 |
|
Thanks! That helped me. Thanks for marking it as resolved. Was away today, so couldn't check it. |
![]() |
|
| [FF] Mathy | Jul 7 2009, 05:22 PM Post #5 |
![]()
Administrator
|
You're welcome. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Get help · Next Topic » |
| Track Topic · E-mail Topic |
1:03 AM Jul 11
|





1:03 AM Jul 11