develooper Front page | perl.perl5.porters | Postings from September 2012

optimising JRuby by avoiding hashes

Thread Next
From:
Nicholas Clark
Date:
September 7, 2012 07:30
Subject:
optimising JRuby by avoiding hashes
Message ID:
20120907143029.GX9583@plum.flirble.org
I was talking to Ash Berlin last night at the london.pm* meeting and he
mentioned an interesting article on one approach taken by the developers
of JRuby to optimise its performance without compromising any part of Ruby's
dynamic nature - avoiding hash lookups in hot paths:

http://blog.headius.com/2012/09/avoiding-hash-lookups-in-ruby.html?m=1

One of the areas they were able to do this was method lookups. Their approach
is described in useful detail. Previously Chip had mentioned privately that
there might be scope for optimising method lookup in Perl 5. Specifically,
work from the assumption that most of the time at most call sites $a->foo
is going to have the same ref($a).

This may not be *that* hard to implement, as a bunch of the evil work is
already done - we have method caching and ISA caching, and the infrastructure
to invalidate those caches.

So does anyone want to see if they can have some fun speeding this up?

Nicholas Clark

* Don't worry. We were talking about Ruby. Not the four letter word that is
  off-topic for london.pm.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About