Skip to content

Optimize LightList copies#2

Draft
8Keep wants to merge 1 commit into
jmh-benchmark-harnessfrom
lightlist-hotpath-copies
Draft

Optimize LightList copies#2
8Keep wants to merge 1 commit into
jmh-benchmark-harnessfrom
lightlist-hotpath-copies

Conversation

@8Keep
Copy link
Copy Markdown
Owner

@8Keep 8Keep commented May 17, 2026

Needs my jmh harness PR in jMonkeyEngine#2778

Summary

  • avoid copying and clearing unused retained LightList backing capacity
  • use bulk copy/fill paths for unfiltered world light-list updates
  • keep the retained sort buffer sized to active lights instead of backing-array capacity
  • add focused LightList regression tests for removal ordering, update ordering/filtering, and sorting after retained capacity

Benchmark Results

JMH results from the jme3-core benchmark harness, lower is better:

Before -> After

  • removeFromFront, 256 lights: 0.317 us/op -> 0.036 us/op
  • removeFromMiddle, 256 lights: 0.172 us/op -> 0.031 us/op
  • updateFromLocalAndParent, 256 lights: 0.738 us/op -> 0.195 us/op
  • sortTransformChanged, 256 lights, retained x1024: 94.191 us/op -> 25.909 us/op

Testing

  • ./gradlew :jme3-core:test --tests com.jme3.light.LightListTest :jme3-core:benchmarkClasses

@8Keep 8Keep force-pushed the jmh-benchmark-harness branch from cc0750d to 2876086 Compare May 19, 2026 22:53
@8Keep 8Keep force-pushed the lightlist-hotpath-copies branch from 5906442 to bd6da59 Compare May 19, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant