On Sat, 08 Jul 2006, Charles O Nutter defenestrated me:
> 
>    I'm starting to run some profiles to find real hotspot problems. So
>    here's the first summary of findings.
>    Profiling: today's code, gem install --force rake (gem cached
>    locally), up to some time during ri generation (killed after an hour)
>    This profiling run just examined CPU times for various method calls.
>    Based on "own time" the amount of time spent in each method, there are
>    a few standouts.
>    - ThreadLocal.get is number one again, accounting for 4% of global
>    execution time. If we modified JRuby such that the current thread's
>    ThreadContext was passed along the call chain we might be able to
>    eliminate much of this overhead. ThreadService.getCurrentContext() and
>    Ruby.getCurrentContext() are ranked #4 and #6 and take another 2%
>    each, adding up to roughly 8% of total execution time spent retrieving
>    the current ThreadContext. EvaluationState.getThreadContext adds
>    another 1%.

  We also talked about pushing method calls into ThreadContext itself
for execution.  That is probably a larger change, but it will kill the need 
to call getcurrentContext() alot (I think).

>    - UnsynchronizedStack.peek and ArrayList.size are #2 and #3, certainly
>    owing to our heavy use of UnsynchronizedStack in the core interpreter.
>    Not too surprising, but the more we can eliminate the need for them
>    both the better. They accounted for 6% of execution time.
>    ArrayList.size was invoked 116 million times during my test run.

  We also identified two possible Stacks marked for death:
RubyClass (for CRef spaghetti) and Scope merging with Frame?

>    - RubyModule.findImplementer = 6%,

  If we address overall problem with method cache then I think we
can get rid of this. 

>    - ThreadContext.preReflectedMethodInternalCall and callees took up
>    12%, which is a bit surprising since it doesn't do all that much. A
>    large part of that is pushing a new frame onto the frame stack.

>    - RubyThread.criticalizeOrDieIfKilled alone was 6%, contributing to
>    pollThreadEvents above

  I wish we understood the right granularity to check the thread
stuff.  I am sure we are doing it more than we need, but I cannot
see a good injection point.

-Tom

-- 
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to