On Mon, Oct 5, 2009 at 10:58 AM, Micah Martin <[email protected]> wrote:
> In a recent competition I held using JRuby
> (http://blog.8thlight.com/articles/2009/10/4/reflection-on-hangman), one of
> the competitors made a very interesting observation about the length of
> JRuby method names...
> "Actually I choose short method names because it was significantly faster in
> jruby. I think the speed increase was something like 10-20% on one letter
> method names."
> I found this a bit shocking.  How could that be true?

I suppose it could be like Tom says, since we use hashmaps for storing
methods there could conceivably be an improvement with short method
names. However that should only affect hashes that have a lot of
collisions in them, since only then would it need to do a comparison
of an incoming key with a found key. It should certainly not affect a
well-distributed hash, and monomorphic call sites should not be
affected at all.

Can you get any more information from this person? If we have a
problem with badly-distributed hashes, we can fix that. We've also
discussed a non-string identifier for method names to avoid the
possibility of things like this...

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to