Skip to content

Borrow one int array for all alpha model sorted faces - #1171

Open
RuffledPlume wants to merge 9 commits into
117HD:masterfrom
RuffledPlume:StaticAlphaModelTempFaceOptimization
Open

Borrow one int array for all alpha model sorted faces#1171
RuffledPlume wants to merge 9 commits into
117HD:masterfrom
RuffledPlume:StaticAlphaModelTempFaceOptimization

Conversation

@RuffledPlume

@RuffledPlume RuffledPlume commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Instead of borrowing an Int array for each AlphaModel which needs sorting, we calculate the total sorted faces then borrow a Int array for the whole zone.

Each AlphaModel now has a offset into the Zone Array

EboAlphaWriterJob finds continuous ranges before flushing the indicies to the eboBuffer

Before:
image

After (3x improvement):
image

Before:
image

After (1.6x improvement):
image

Instead of borrowing an Int array for each AlphaModel which needs sorting, we calculate the total sorted faces then borrow a Int array for the whole zone.

Each AlphaModel now has a offset into the Zone Array

EboAlphaWriterJob finds continuous ranges before flushing the indicies to the eboBuffer
@RuffledPlume
RuffledPlume force-pushed the StaticAlphaModelTempFaceOptimization branch from f168c99 to e6d70ca Compare August 14, 2026 13:04
@RuffledPlume
RuffledPlume force-pushed the StaticAlphaModelTempFaceOptimization branch from f0c5e90 to 345b23c Compare August 14, 2026 22:57
@RuffledPlume
RuffledPlume marked this pull request as draft August 17, 2026 09:42
@RuffledPlume
RuffledPlume force-pushed the StaticAlphaModelTempFaceOptimization branch from 524da49 to 713ccc2 Compare August 17, 2026 12:09
@RuffledPlume
RuffledPlume marked this pull request as ready for review August 17, 2026 12:09
@RuffledPlume
RuffledPlume force-pushed the StaticAlphaModelTempFaceOptimization branch from 713ccc2 to b6a7304 Compare August 17, 2026 12:34
Added EboAlpha Upload Timer

Tweaks

Fix MultiLocs

Calculate AlphaModel Distance once

QuickSort Accessor Implementation

Added Keyed List QuickSort

Combine Accessors into a single class

JIT was struggling to optimise the internal Quick Sort function resulting in VTable invocations which was hampering the sorting perf

Tweaks
@RuffledPlume
RuffledPlume force-pushed the StaticAlphaModelTempFaceOptimization branch from b6a7304 to 2a69243 Compare August 17, 2026 12:37
If there is only two AlphaModels we can avoid the Key QuickSort by just comparing the distances
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