JMH benchmarks comparing the stable gephi-toolkit (Maven Central) against a snapshot
layout-plugin build.
Both versions provide a class with the same name
(org.gephi.layout.plugin.forceAtlas.ForceAtlas, ...forceAtlas2.ForceAtlas2, etc.), so they
can't be regular dependencies of the same module at once. The layout-plugin-snapshot module
works around this with maven-shade-plugin: it repackages the snapshot build's classes (and its
META-INF/services SPI entries) under the snapshot.* prefix. The benchmarks module then
depends on both gephi-toolkit and this relocated jar side by side.
Both versions under test are properties in the root pom.xml — change them there, nowhere else:
gephi-toolkit.version— the stable gephi-toolkit to pull from Maven Central.layout-plugin.snapshot.version— the snapshotlayout-pluginbuild to compare against. This must already be installed in your local~/.m2repo (built from your gephi checkout) — it's not fetched from anywhere else. It also doubles aslayout-plugin-snapshot's own module version, so Maven prints a harmless'version' contains an expression but should be a constantwarning; that's expected and safe to ignore.
After changing either property, rebuild with mvn install (see below) before running benchmarks.
mvn installRe-run this whenever layout-plugin-snapshot changes — benchmarks resolves it from your local
~/.m2 repo, not from an in-memory reactor.
All benchmarks:
mvn -pl benchmarks exec:javaOne class, or a name filter (JMH treats the argument as a regex):
mvn -pl benchmarks exec:java -Dexec.args="ForceAtlas2StableVsSnapshotBenchmark"Quick smoke test (short warmup/measurement, useful while iterating):
mvn -pl benchmarks exec:java -Dexec.args="ForceAtlas2StableVsSnapshotBenchmark -wi 1 -i 2 -w 500ms -r 500ms"List available benchmarks without running them:
mvn -pl benchmarks exec:java -Dexec.args="-l"Silence the harmless SEVERE ... InaccessibleObjectException NetBeans logs on JDK 9+
(no effect on results):
MAVEN_OPTS="--add-opens java.base/java.net=ALL-UNNAMED" mvn -pl benchmarks exec:javaForceAtlas2StableVsSnapshotBenchmark— cost of oneForceAtlas2.goAlgo()iteration on a fixed 200-node random graph, default settings, stable vs. snapshot.
- Benchmarks run with
@Fork(0)(in-process).mvn exec:javaresolves the classpath through a custom classloader, not the JVM'sjava.class.path, so JMH's normal forked-JVM mode can't launch its subprocess. Fine for local iteration; not representative of a fully isolated, publishable measurement. - There's no uber jar. Given gephi-toolkit's huge dependency tree (NetBeans platform, Batik, POI,
PDFBox, several JDBC drivers, ...), shading it all into one runnable jar added build time and
noise for no benefit — the actual class-collision problem is already solved by
layout-plugin-snapshot.