Repository navigation
Add JMH benchmark harness - #2778
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates JMH benchmarking into the jme3-core module, establishing the build infrastructure and adding benchmarks for bounding volumes, light lists, and geometry lists. Feedback suggests expanding the benchmark source set's classpath to include main runtime and test output dependencies to prevent potential compilation or runtime errors. Additionally, a more robust modulo-based offset calculation was recommended for the light list sorting benchmark to support arbitrary light counts.
85d9391 to
cc0750d
Compare
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
cc0750d to
2876086
Compare
riccardobl
left a comment
There was a problem hiding this comment.
I think we should move all benchmark to a dedicated jme3-benchmark module, so that it is easier to separate them from the actual engine source code.
dc27f27 to
b0fce5b
Compare
|
Should be good to go now. @riccardobl there's something going on with graal in libjglios in the ci recently. I assume it's unrelated to this pr? |
b0fce5b to
5c81b07
Compare
|
The only problem left here is that the jme3-benchmarks module is going to be included in the release zip and published to maven central. Lines 29 to 36 in 032a493 |
5c81b07 to
fb1e304
Compare
|
Sorry for the delay. Fixed |
|
@copilot resolve the merge conflicts in this pull request |
efd97f5 to
a989775
Compare
|
Rebased and whatnot |
|
Thank you! |
| @State(Scope.Thread) | ||
| @BenchmarkMode(Mode.AverageTime) | ||
| @OutputTimeUnit(TimeUnit.NANOSECONDS) | ||
| @Warmup(iterations = 5, time = 200, timeUnit = TimeUnit.MILLISECONDS) |
There was a problem hiding this comment.
The all case marks every local light as global, but world.update() filters those out and leaves the world list empty. That means this parameter measures only the empty-result path rather than updating a world list with all lights rejected; please make the filter scenario explicit and ensure the intended fraction is what the benchmark measures.
jaime-jmebot
left a comment
There was a problem hiding this comment.
- The benchmark module is cleanly isolated from normal project builds.
- One filtered-update parameter currently measures an empty output list, so the intended filtering comparison needs clarification/correction.
Add a separate
jme3-benchmarkmodule for bounding volumes, LightList updates/removal/sorting, and GeometryList clearing. Sort cases cover mixed lights, sorted/reversed/random inputs, and retained capacity. Update cases cover filters rejecting none, a quarter, or all local lights.The module is only included when a benchmark task is requested, so it stays out of normal builds and published artifacts.
Some baseline results from this machine (i7-11800H, Fedora 44, Temurin 25.0.4):
These baseline samples used JMH 1.37, one thread pinned to CPU 2, a 256 MiB heap, three forks, and 5 warmup / 8 measurement iterations of 300 ms. LightList comparisons are in #2784.
Normal project configuration excludes the module; compilation, benchmark listing, and the benchmark cases pass.