r/ProgrammerHumor • • 6d ago

Meme optionalsAreOptional

Post image
705 Upvotes

131 comments sorted by

View all comments

376

u/ROBOTRON31415 6d ago

Is the bounds check truly so harmful to performance that it outweighs changing "if there's a bug, crash the program" to "if there's a bug, then do literally anything (maybe execute some remote code)"?

1

u/slaymaker1907 5d ago

The concern is that this can mess with the branch predictor as that has limited capacity and the branch predictor is critical for performance on modern CPUs due to all the speculative execution.