What is Nostr?
/ Colby Serpađź’ˇ
npub1t89…a5h9
2024-11-19 19:51:53

Colby Serpa💡 on Nostr: The burden of padding at the heart of all computation… Power of Two & Padding ...

The burden of padding at the heart of all computation…

Power of Two & Padding Explained:

“Computers work best with powers of two (e.g., 64 bytes) because memory is often addressed in chunks aligned to these sizes. This alignment speeds up access since hardware is optimized for it.

If data doesn’t naturally fill a 64-byte block (e.g., a 50-byte structure), padding is added—extra bytes (14 in this case)—to make it 64 bytes. This ensures alignment and avoids splitting data across blocks, which slows things down.

In memory-intensive tasks (e.g., databases, graphics), keeping everything aligned and padded to powers of two is critical for performance and efficient cache usage!”
Author Public Key
npub1t89vhkp66hz54kga4n635jwqdc977uc2crnuyddx7maznwfrpupqwra5h9