Skip to content

Comment on Beating the L1 cache with value speculation

Comments

This seems like it would cause a lot of those "I just wish the damn machine did what I told it to: situations.

Not necessarily. After putting a lot of brain grease into writing the code, it will probably work just fine.

But it will lead to a bunch of serious "WTF!?" situations when other people look at the code and/or are supposed to make changes at a later point.

And possibly stuff breaking in spectacular ways after introducing "minor cleanup" patches. Or some weird performance regressions, after touching completely unrelated code that might affect the temporal order of the memory allocations in questions, and so on...

Besides improving performance, doing this kind of trickery in production code will probably also improve your job security.

Why? Most of the time these predictions help you.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.