Improve Lightlist performance - #2784
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the Java Microbenchmark Harness (JMH) to the project, adding a dedicated benchmark source set and several performance tests for bounding volumes, light lists, and geometry lists. In LightList, several methods including remove, clear, sort, and update were optimized using System.arraycopy and Arrays.fill to improve efficiency. Feedback suggests removing the distToOwner array and its associated logic in LightList, as it is currently dead code and not correctly synchronized during element removal.
5906442 to
bd6da59
Compare
riccardobl
left a comment
There was a problem hiding this comment.
Benchmarks should be moved into their own jme3-benchmark module, so that we don't have to deal with them in the normal codebase.
Other than that and the distToOwner comment by gemini, everything looks good.
4400dac to
e2dfcf2
Compare
|
Should be solid now |
e2dfcf2 to
5fe394e
Compare
5fe394e to
f67972b
Compare
|
@riccardobl could you take another look? |
Stacked on #2778; the first commit is the JMH harness.
Summary
LightListbacking capacityLightList.update()has no filterdistToOwnerstateBenchmarking
The harness includes mutation and retained-capacity sort benchmarks. The original unfiltered
updateFromLocalAndParentnumber is not presented as a production claim:Spatial.updateWorldLightList()uses a global-light filter.updateWithGlobalLightFiltercovers that representative path; compact local measurements were promising at medium/large list sizes but need longer controlled runs before a PR performance claim.Testing
./gradlew :jme3-core:test --tests com.jme3.light.LightListTest --tests com.jme3.light.LightSortTest :jme3-benchmark:jmh -PjmhArgs='-l'