Quadrupling code performance with a "useless" if

(purplesyringa.moe)

46 points | by birdculture 1 hour ago

3 comments

  • anematode 1 hour ago
    Brilliant! Hadn't seen this technique before.
  • anirudhak47 1 hour ago
    latency optimization is a skill. I liked how you went till CSE pass. I myself wrote several passes to go to lowest latency possible
  • akoboldfrying 51 minutes ago
    This is really surprising! I've never considered the possibility that using an equality test to skip a write that would be a no-op could break a dependency and thus lead to higher perf overall if the "equal" outcome occurs often enough. This might be applicable in many situations where you "edit" some data in-place, but most of the time there are few or no changes.