Benchmarking

    Benchmark runs across different scopes of Java bytecode:

    • runtime — Java runtime with no additional dependencies
    • runtime + guava — Java runtime with one JAR file for guava
    • runtime + project classpath — Java runtime with all visible dependencies of the JacoDB project
    • runtime + Idea community — Java runtime with all visible dependencies of an IntelliJ IDEA Community project

    JacoDB benchmarks also include a scheme with the Usages feature installed.

    Environment

    OSWindows 10 Pro
    Processor11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80 GHz
    RAM16 GB
    StorageSSD

    JacoDB benchmarking results

    Run command:

    ./gradlew jcdbBenchmark
    BenchmarkRepeatsAvg time per operation
    runtime51064 ms
    runtime + guava51090 ms
    runtime + project dependencies51551 ms
    runtime + IDEA community dependecies59054 ms
    runtime + Usages51790 ms
    runtime + guava + Usages52590 ms
    runtime + project dependencies + Usages52915 ms
    runtime + IDEA community + Usages59798 ms

    Soot benchmarking results

    Run command:

    ./gradlew sootBenchmark
    BenchmarkRepeatsAvg time per operation
    runtime520985 ms
    runtime + guava523323 ms
    runtime + project dependencies524027 ms
    runtime + IDEA community dependecies530286 ms

    SootUp benchmarking results

    Runs with createInDemandView

    Run command:

    ./gradlew sootupBenchmark
    BenchmarkRepeatsAvg time per operation
    runtime50.23 ms
    runtime + guava51 ms
    runtime + project dependencies560 ms
    runtime + IDEA community dependecies5167 ms

    Runs with createFullView

    Consumed almost all of 16 GB RAM memory (failed with the OOM error on 12 GB).

    BenchmarkRepeatsAvg time per operation
    runtime50.23 ms
    runtime + guava589 ms
    runtime + project dependencies54247 ms
    runtime + IDEA community dependecies5114 723 ms (fails on 12Gb)

    Comparison

    Soot

    The Soot framework just reads all the JAR files and stores bytecode in memory. Unlike Soot, JacoDB reads the available .class files from the JAR files and builds folders in parallel. As a result, it is faster when dealing with multiple JAR files (due to parallel execution). Note, that JacoDB performs a lot of tasks in background while almost all the API is ready for use (Hierarchy and Usages require the background activity to be finished).

    SootUp

    The SootUp framework ignores runtime libraries. That is why the startup time for the “runtime only” condition is almost equal to zero.

    JacoDB

    JacoDB performs tasks in background while almost all the API is ready for use. Here are the results for performing the background activities without the Usages feature:

    ./gradlew awaitBackgroundBenchmark
    BenchmarkRepeatsAvg time per operation
    runtime: wait for background jobs53182 ms
    runtime + project dependencies: wait for background jobs514737 ms
    runtime + IDEA community dependencies: wait for background jobs2137528 ms

    For the IntelliJ IDEA Community code base, the size of the resulting SQLite database file is ~3.5 GB.