#What are bits bytes etc?

1 messages · Page 1 of 1 (latest)

tropic pier
#

Like for example what would a 32-bit integer be compared to a 64-bit integer and why are they important?

cinder sentinel
# tropic pier Like for example what would a 32-bit integer be compared to a 64-bit integer and...

Computers operate on electrical singals. These signals only have two reliable states: low voltage and high voltage. These states are commonly referred to as "on/off", "yes/no", 0 and 1. This is a binary (base 2) number system. Numbers in binary are interpreted from right - > left. Each 0 and 1 in the sequence is known as a bit. Each bit has the value of 2^(n-1), where n represents the nth bit

#

A byte is defined as a sequence of 8 bits

tropic pier
#

is low voltage on

cinder sentinel
cinder sentinel
#

For a 32-bit system, only a 4-byte string of bits can be processed at a time. 8 bytes for a 64-bit system

#

Computers are all about binary, and bits and bytes tell us about the limits and size of our data. In critical systems, these limits and sizes must be carefully understood, as leniency towards redundancy is tighter

#

It's all about performance. Even in Roblox games, if we can choose to use less memory to represent data we know doesn't need it, we can earn some serious gains 💪

cinder sentinel
#

There are a lot more neuances to what I've said, though. This is a grassroots explanation that will suffice for the time being

#

This cap, by the way, is called a "word size"

zealous haven
#

yeah what you’re saying is technically right but in Roblox we don’t actually control 32-bit vs 64-bit like you would in C or C++. In Luau all numbers are basically 64-bit doubles, so you can’t decide “oh I’ll use an int32 here to save memory”. That layer is abstracted away from us.
the real performance gains in Roblox aren’t about bit size anyway. they come from reducing allocations, not creating tables or closures every frame, keeping GC pressure low, avoiding unnecessary work in Heartbeat/RenderStepped, and not over-replicating stuff to clients. architecture matters way more than integer width here.
in a more AAA/engine-level context, sure, data size and bit packing matter a lot because of cache locality and memory bandwidth. but in Luau you optimize at a higher level: reuse structures, batch logic, avoid table churn, keep things server-authoritative, serialize only when needed.
so yeah 32 vs 64-bit is important in low-level systems, but in Roblox the real gains come from clean architecture and controlling runtime overhead, not from choosing smaller integer types because we simply don’t get that control.

cinder sentinel