** !! deprecated !!**
Overview
Goals :
- remove/reduce the eclipse freeze (except from user request, force clean+build)
- allow GC to free more memory when needed to build,... (eg : free some information from previous build (from same or other project))
- use less CPU
- avoid too many compilation, sometimes not uptodate data (AST) is acceptable
- less allocation, reuse object if available
- reduce memory used to build
To rich those goals, there is several axes/startegies, Tuning is allowing to provide/configure/use them and to collect feedback information.
The majority of proposal should impact scala-ide, but during investigation some bug or enhancement can be only allowed by modification of scala-compiler (TODO : define the way to follow in this case : fork full scalac, move patched classed under a scala-ide project, use aspect to monkey patch scalac like for jdt ?).
Some major difference vs command line compilation :
- compiler could be resident
- there is several project to compile
- each project could use several compiler (presentation vs builder)
How to help :
- provide feedback about tuning feature
- capture and share information about freeze, memory leak,... in this page or in tickets (I'll try to share mime here)
Eg when my eclipse start to freeze :
- I start a visualvm (could be download alone or use the one provide in jdk 1.6.0_21)
- I open the monitor of the eclipse process
- I wait few second, take a screenshot (see samples below)
for gc and memory issue I also do a Heap dump (and save it for postmordem analyze with VisualVM or Mat).
Roadmap :
DONE :
- add a Tuning Preferences page (change need to restart eclipse)
- allow user to choose between strongly caching the last Compilation Result of single File or soft caching every Compilation Result
- add StopWatch about call to compilers (open web browser to http://localhost:9999/ to see data or to disable collect)
- provide a update-site for wip_tuning, or something to allow user to test tuning without need to build there own plugin at http://alchim31.net/scala-ide/update-wip_tuning
TODO :
- allow several type of reference ScalaPresentationCompiler and EclipseBuilder : Strong, Soft, Weak
- provide a Log.info and enable it from TuningPreferences
-
StopWatch (if feature keep)
- dynamics change (Property listener) of goupe enable/disable
- provide a button to start/stop web server
- provide a View for the html output provide by internal webserver
- if need, change for implementations (don't forget dependencies,...) :
-
Stopwatch from A. Boisvert (currently used)
- metrics
- ostrich
- javasimon
Scala-compiler's issues :
Stuff to explore :
- share stuff (data, 'service') between builder and presentation compiler of a common project
- share stuff (data, 'service') between compilers of several projects (eg: Names tables : big table of char)
- using a background job with +/- fixed rate to run compilation (start with ScalaPresentationCompilation)
about eclipse periodic task/job, (instead of nsc.interactive.Global TaskThread/Executor) see
- to avoid compiling every time and freeze at wrong time, only run compilation after some idle time or now (end user request)
- may be using aspect to inject interceptor for StopWatch and other metric instead of hardcode aroundMethod call by hand (everywhere) with a trait
- deeply understand scalac code
- learn more GC tuning
original idea from : mailing-list plugin tuning
Screenshots :
CPU eat by GC Activity
[[image:2010-07-15-0015171680x1050scrot.png]]
Memory Usage
[[image:2010-07-15-0012421680x1050scrot.png]]
Number of Compilation run on startup
[[image:2010-09-11-1054131680x1048scrot.png]]