pollThreadEvents could be cut down a little: it is currently being called both by EvaluationState.executeNext() and NewlineNodeVisitor.execute() -- meaning it is being called twice when there is a newline.
Evan Charles O Nutter wrote: > 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%. > - 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. > - EvaluationState.executeNext and EvaluationState.begin take roughly > 4% together. A compiler would go a long way toward eliminating these > two and a fair portion of the UnsynchronizedStack and ArrayList overhead. > - RubyModule.findImplementer = 6%, > - ThreadContext.pollThreadEvents and methods it calls took up 9% of > total time > - 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 > > This was using YourKit 5.5. > > -- > Charles Oliver Nutter @ headius.blogspot.com <http://headius.blogspot.com> > JRuby Developer @ www.jruby.org <http://www.jruby.org> > Application Architect @ www.ventera.com <http://www.ventera.com> > ------------------------------------------------------------------------ > > 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 > 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