Tim Mastny
banner
timmastny.bsky.social
Tim Mastny
@timmastny.bsky.social
Software engineer bringing digital finance to Africa. Writes about low-level programming, data science, and algorithms at https://timmastny.com
Latest demo: collaborative text editing synchronized with a conflict-free data structure.

The data structure ensures that insertions, edits, and deletions are properly merged during synchronization. Even if the changes were made offline. 1/
January 27, 2025 at 7:19 PM
When analyzing branch prediction algorithms, the "better" hashing approach (gshare) is theoretically worse than the simple one (concatenation).

What's going on?
January 15, 2025 at 8:19 PM
Branch instructions like if statements create another challenge: workers don't know what to work on next. Instead of waiting, they guess what to do next - even if they might have to throw away their work. This is called branch prediction. 4/5
January 8, 2025 at 10:49 PM
But what happens when a worker needs a part that's still being worked on? The whole line has to pause - this is called a data hazard. 3/5
January 8, 2025 at 10:49 PM
With pipelining, each worker begins the next task as soon as they finish. Just like an assembly line, throughput increases dramatically. 2/5
January 8, 2025 at 10:49 PM
Let's explain CPU pipelining using an assembly line metaphor. In a basic CPU, only one worker is active. The others must wait until the entire instruction completes before starting the next one. 1/5
January 8, 2025 at 10:49 PM