Repository navigation
Tyre smoke without particle emitters: 1–3 hitches per race instead of 14–46 - #19
Merged
Merged
Conversation
On iOS 27 every active RealityKit particle emitter cut the race to 12-15 fps for as long as it emitted, whatever its particle count or size (5 particles/s cost as much as 110). Drifting cars - and the smoke warm-up under the loading screen - caused 14-46 hitches per race. DriftSmoke keeps the same look (birth box, cone, lift, growth, spin, linear fade) as camera-facing quads in one LowLevelMesh rewritten every frame; fading picks one of 16 copies of the puff texture by age, because UnlitMaterial has no vertex colour. Simulator iPad M5 iOS 27, all five regions, A/B against main: hitches 14-46 -> 1-3 per race, longest frame 101-150 -> 33-50 ms, loading 0.7 s faster, memory 15 MB lower. Also: -noSmoke / -noSkids / -smokeLook for A/B, track position in hitch logs, tools/perf-run.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On iOS 27 (iPad M5 simulator), every active
ParticleEmitterComponentdrops the race to 12–15 fps for as long as it emits. The cost does not depend on the particle count or size: 5 particles/s cost as much as 110. Each drift therefore meant ~2 s of stutter. The smoke "warm-up" under the loading screen also caused stutter for ~1.2 s after the scene was revealed.Found by: CPU work per frame was 0.4 ms, so the cost was not in game code. The hitches lined up with the player's drift to within a second. In A/B with
-holdDrift,-noSmokeremoved them (2 vs 40–100),-noSkidschanged nothing, and a frozen frame at the same spot was smooth. On iOS 18 the emitter costs nothing.Change
DriftSmoke: puffs are camera-facing quads in oneLowLevelMeshrewritten every frame, with the same parameters as the old emitter (birth box, cone, lift, growth, spin, linear fade). Fading picks one of 16 copies of the texture by age, becauseUnlitMaterialhas no vertex colour.writesDepth = false.-noSmoke,-noSkids,-smokeLook(Debug/Family) for A/B, and track position in the hitch log.tools/perf-run.sh: loading time, frame times, hitches, CPU and memory for each region.Measurement (iPad M5 iOS 27 simulator, all 5 regions, A/B alternating against main)
The smoke looks the same in screenshots mid-drift (old vs new).
Tests
swift test65/65Not measured on a physical iPad.
🤖 Generated with Claude Code