Cache piece bounds on LocalModelPiece to skip pointer chase in UpdateBoundingVolume#13
Closed
bruno-dasilva wants to merge 2 commits into
Closed
Cache piece bounds on LocalModelPiece to skip pointer chase in UpdateBoundingVolume#13bruno-dasilva wants to merge 2 commits into
bruno-dasilva wants to merge 2 commits into
Conversation
…-all-reason#2949) * fix: memory barrier bitfield now pulls from correct parameter Looks like the original code was: ``` int LuaOpenGL::MemoryBarrier(lua_State* L) { GLbitfield barriers = (GLbitfield)luaL_optint(L, 1, 0); //skip checking the correctness of values :) if (barriers > 0u) glMemoryBarrier(barriers); return 0; } ``` and when it was merged here, the `default` parameter was changed to a 4 instead of the `idx` parameter. A Codex review of related code found this bug :) * Apply suggestion from @bruno-dasilva --------- Co-authored-by: Bruno Da Silva <Bruno-DaSilva@users.noreply.github.com>
…BoundingVolume LocalModel::UpdateBoundingVolume's hot loop dereferenced lmPiece.original to read mins, maxs, and HasGeometryData() on every piece, costing a cache line per piece in a separately-allocated S3DModelPiece. Mirror those values onto LocalModelPiece at construction (and in the SetModel reload path) and read them from there. Hoist the empty-piece check before the modelSpaceTra read so empty pivot pieces no longer pay the transform load. Algorithm and computed bounds are unchanged. New fields are CR_IGNORED and refilled alongside `original` on reload, so save format is unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bar-benchmark — PR #13candidate sim trimmed mean (ms) with 95% CI on the relative delta
|
Owner
Author
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.






No description provided.