This document lists some points that can be improved to increase performances, generally CPU time.
| Step | CPU Time | Reasons | Solutions |
|---|---|---|---|
| Registration of quality profiles | ~37% | Bad management of SQL requests |
|
| Registration of rules | ~9% | Bad management of SQL requests | Replace Hibernate by MyBatis and use batch insert mode |
| Initialization of Hibernate | ~8% | For information MyBatis initialization is ~3%. | Drop Hibernate |
| Registration of metrics | ~3% | Bad management of SQL requests | Replace Hibernate by MyBatis and use batch insert mode |
| Initialization of JRuby on Rails | ~23% | Heavily framework initialization, including ActiveRecord loading of tables metadata |
|
| Reasons | Solutions | |
|---|---|---|
| Unit tests : Hibernate initialization | To be killed | |
| Unit tests : Database startup | Derby seems to be slow to be started | Replace Derby by H2. David estimation : performances x 2. |
| Unit tests : sequential execution of tests | Some modules execute tests in parallel, but's currently not possible on the modules that start an in-memory database | TBD |
| Compilation : GWT |
|
| Reasons | Solutions | |
|---|---|---|
| PMD is slow | Parallel execution of file analysis, if PMD is thread-safe |
Note that integration tests are close-source and use a SonarSource internal framework to interact with Sonar components.
| Reasons | Solutions | |
|---|---|---|
| Download, unzip, build war and deploy to cargo | Requires many filesystem I/O but not network I/O because of local cache of zip files | To be defined. Publishing a standalone and runnable WAR is a good candidate. |
| Server startup | See above | |
| Server shutdown | Timeout to guarantee that queue of notifications is empty | |
| Initialization of Selenium RC | Is the Selenium proxy long to be started ? To be verified | Test suites could use the same Selenium RC proxy http://jira.sonarsource.com/browse/ORCH-91 |
| Too many server startups | Each Java file uses at least one server | Group unit tests by reusing shared servers. BUT this is a problem only if server startup is long. |
| Project inspections are long |
| |
| Each junit test is long | Due to test requirements (server, code inspection, selenium rc) | Use parallel tests |
| Many tests to execute | Because we love tests | Execute only the tests that relate to changed code |
| Solutions | |
|---|---|
| Many HTTP requests to get images | Use CSS sprites |