Top-level method def invalidates everything by hand, much slower than MRI
-------------------------------------------------------------------------
Key: JRUBY-3394
URL: http://jira.codehaus.org/browse/JRUBY-3394
Project: JRuby
Issue Type: Bug
Components: Performance
Reporter: Charles Oliver Nutter
Fix For: JRuby 1.2
Attachments: global_method_invalidation.patch
This is an unusual case discovered while resolving JRUBY-1854. The problem here
is that while normal method definition is plenty fast, invalidation of the
subclasses is O(n log n) for n descendants. In most hierarchies, this is of
minimal impact; there will only be a couple subclasses, and methods are only
defined early in application execution. For benchmarks like our
bench/language/bench_def_method.rb, however, it can show relatively poor
performance:
{noformat}
user system total
real
100k def a; 1 + 1; end 0.233000 0.000000 0.233000 (
0.233445)
100k toplevel def a; 1 + 1; end 6.175000 0.000000 6.175000 (
6.175315)
{noformat}
I'm filing this as a separate bug to save my global cache invalidation patch
(in case it's needed) and because it's a very specific case that I don't
believe will affect most code. And considering that this degrades toplevel
method def performance from somewhere around 2usec to around 60usec, I think
it's not of particular concern. In order for it to add up to a second's worth
of time, you'd need to define 16k toplevel methods.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email