Version 4 (modified by gogov, 16 years ago) (diff) |
---|
Analysis
Overview
The goal of this task is to improve the performance of the Sophie2 platform before the release at 2009-05-15.
Task requirements
Since time is not enough for great optimizations which require good design and much refactoring but instead locate small inefficient chunks of code and optimize them.
Such cases might include:
- modification of the launch settings of Author, Reader and Server
- memoization of often performed queries
- complexity optimizations of often executed code such as:
- hashing instead of iterating
- precomputing some results if possible
- etc...
- usage of more efficient data structures at certain classes if possible and not much time needed to refactor
Also some logging logic should be inculded which measures startup time so optimizations are with visible effect.
Task result
- visible performance optimization
- code for startup time measurement
- explanations of the optimizations in the wiki
Implementation idea
- tweak profiler settings for the launch configurations
- refactor main() method of FakeAuthorMain to measure time
- use a profiler to locate non-efficient chunks of code and optimize them
Related
How to demo
- demo performance optimization
Design
After playing with the vm arguments and launch configurations I figured out that using the HPROF profiler of the JVM may be omitted to improve development process.
In the author.FakeAuthorMain.launch conf file there a -agentlib:hprof=cpu=samples,interval=5,depth=30 argument passed to the JVM.
This means that a profiler thread runs each 5 milliseconds, gathers information from the running Sophie process, and then sleeps again.
This is useful when developing something for Sophie with the intent to use this performance log for optimizations.
In most cases this isn't the case so using the profiler is pointless.
Turning it off leads to 20-30% startup time reduction which is significant, so I'll remove this from the author.FakeAuthorMain.launch (and reader.FakeReaderMain.launch respectively).
For convenience, I'll create author.FakeAuthorMain-Debug.launch (and reader.FakeReaderMain-Debug.launch respectively), which have this option turned on. In the future more similar differences might occur.
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.)