is it possible for code executed on a modern CPU to become faster even though it does something that looks like extra work?

@grainloom yep. cache misses make up a not-insignificant part of runtime nowadays, so memory mapping makes a huge difference. even just changing the order of functions in a file can change how they're loaded in memory and make like 20-30% performance differences on individual machines.

i have a half hour video saved somewhere about research into using a memory randomizer to figure out genuine performance improvements, i can try and dig out the youtube link if you'd like

@starfall @grainloom In addition to cache misses I wouldn't be surprized if one could improve branch prediction through seemingly useless additional instructions. The effects from that should be miniscule in practice though, while memory access is often a bottleneck.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.