ruby-core

Mailing list archive

[ruby-core:63495] Re: [ruby-trunk - Bug #10003] Hash#fetch performance issue

From: Eric Wong <normalperson@...>
Date: 2014-07-02 07:04:21 UTC
List: ruby-core #63495
Jeremy is correct, Hash#[] (and Array#[]) have optimized dispatch.
I hardly see Hash#fetch used anywhere, and optimizing dispatch for
uncommon cases hurts performance of common cases.

P.S. even if Hash#fetch were optimized, it would still be slower
because it has optional args to parse.

In This Thread

Prev Next