Rails core, Ruby committer, Senior Staff Engineer on @ShopifyEng's Ruby and Rails infrastructure team.
Mastodon: @byroot@ruby.social
Sep 4, 2024 • 21 tweets • 5 min read
Because @fxn doesn't stop at simple explanations, I went to dig into why this benchmark give the opposite results of what one would expect 🧵
@fxn As Xavier rightfully pointed out in another thread, the second block is essentially hashing the hashcode a second time, so doing more work, you'd expect it to be slower. And yet, it's twice as fast.