Skip to content

[upstream] Optimizations (erincatto/box2d#1050) - #93

Merged
ikpil merged 1 commit into
mainfrom
pr/optimizations-1050
Aug 8, 2026
Merged

[upstream] Optimizations (erincatto/box2d#1050)#93
ikpil merged 1 commit into
mainfrom
pr/optimizations-1050

Conversation

@ikpil

@ikpil ikpil commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Improved performance, up to 20% gain in stacking scenarios. Behavior change: contact solver bias stage no longer applies friction (almost free perf gain)
Behavior change: b2World_Step still performs all operations, including collision when timeStep == 0.
b2WorldDef now has b2Capacity that lets you pre-size some arrays to reduce allocations.
Optimized hit events. These are basically free now. Cleaned up and optimized solver scheduling.
Converted to new dynamic array type.
Added threading logic to prevent theoretical solver deadlock if the user task system stalls worker 0.
Added Compounds benchmark.

Improved performance, up to 20% gain in stacking scenarios.
Behavior change: contact solver bias stage no longer applies friction
(almost free perf gain)
Behavior change: b2World_Step still performs all operations, including
collision when timeStep == 0.
b2WorldDef now has b2Capacity that lets you pre-size some arrays to
reduce allocations.
Optimized hit events. These are basically free now.
Cleaned up and optimized solver scheduling.
Converted to new dynamic array type.
Added threading logic to prevent theoretical solver deadlock if the user
task system stalls worker 0.
Added Compounds benchmark.
@ikpil
ikpil merged commit a99d731 into main Aug 8, 2026
10 checks passed
@ikpil
ikpil deleted the pr/optimizations-1050 branch August 8, 2026 15:47
@VaclavElias

Copy link
Copy Markdown
Contributor

Thanks! This update is big. When you have a spare minute, unleash a new NuGet package for us mortals 🤣🙈.

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.

2 participants