Last modified 16 years ago
Last modified on 05/29/09 16:52:33
Analysis
Overview
The goal of this task is to propose and implement concrete performance optimizations for Sophie2.
This should be achieved by either using a profiler or manually identifying potential optimization spots in the code.
A subgoal of this task is to tweak our Profiler, and do a final try on existing profilers which can work with Sophie2 and produce useful results so they can be used for spotting potential optimization spots.
Task requirements
- Propose concrete optimization points in Sophie2 code and optimize them if possible
- by either doing quick hacks
- or proposing serious design changes (like the Aspects) and try to implement them if there's enough time.
- Find a way to measure real method execution count (non-statistical).
- Spend some more time with NetBeans Profiler and try to make it work with Sophie.
- See if using any other existing profiler makes sense.
- Actually, these profilers can turn out to have more features which could prove useful.
- If none of the above works, try to incorporate bytecode instrumentation in our Profiler. This could waste a lot of time so do it only if really needed.
- Consider implementing hit() behavior in the Profiler.
- This means inserting a hit() statement in every method for which you want to get the real hit count.
- This way you get the real hit count for a method,
- and also you can get the last two elements in the stack trace and thus count how much times a given method A() has invoked another method B() in its body like:
methodA() { for(int i = 0; i < 1000000000; ++i) { methodB(); } }
These could possibly be optimized in various ways like using findOne(), findAll() if used for lists, using some HashMaps etc.
- This means inserting a hit() statement in every method for which you want to get the real hit count.
Task result
- Working way to measure real hit count
- Optimization proposals
- Hopefully, implemented optimizations
- Most probably, new functionality in our Profiler.
Implementation idea
- Look at (usage of) these methods in the code and try to optimize them (they proved to consume much time while profiling with hprof):
- org.sophie2.core.modularity.SophieExtensionPoint.extensions -- there such be faster searching in this list maybe
- org.sophie2.core.prolib.util.Registry.endReadTrack -- filtering out could be optimized maybe
- org.sophie2.base.commons.util.ImmGradientPaint.*
- org.sophie2.main.app.menus.MainAppMenusModule.defineExtensions
- org.sophie2.core.prolib.util.Registry.registerRead
- Look at usage of sun.java2d and try to optimize the drawing of Scenes.
- Implement hit() inside our Profiler and count results in some map.
- Look at JVMTI if you're going to do bytecode instrumentation.
- Find a NetBeans guru and ask him questions on how to run the NetBeans Profiler with Sophie2.
Related
How to demo
- show upgraded reports from the upgraded Profiler
- show optimization proposals and/or concrete optimization results
Design
- memoize locate change manager
Implementation
(Describe and link the implementation results here (from the wiki or the repository).)
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)