Benchmarking Ruby 2.7.0's Numbered Parameters

Ruby 2.7.0 added numbered block parameters. There was some controversy which resulted in the initial syntax of @n changing to _n . I like the change.

This is what it looks like:

# regular named params HASH . map { | a, b | [ a, b ] } # new numbered params HASH . map { [ _1, _2 ] }

Anyway, I wondered if there was any performance impact in this change so I threw together a quick benchmark. Result: it’s just as fast as named params.