Library: drop @native from once-per-window/frame giants, fewer slow lookups in text helpers
- Begin/End/NewFrame/UpdateMouseInputs back to interpreted: ~520 KB of native code (Begin alone 369 KB, +30% of the bundle's native code) for ~5 us/frame; native code is a game-wide budget in Roblox - GetCurrentWindow(): read g.CurrentWindow once (the key sits in a hash slot >= 256 of the ~300-field context, which Luau's inline cache can't predict, so every read is a slow lookup) - FindRenderedTextEnd(): strings use string.find/string.len directly (no ImMemchr() call, no `#` on a string) - CalcTextSize(): calls CalcTextSizeXY() directly (one wrapper level less); TextEx(): string.len() for strings Draw data unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c34eb1217d
commit
f0ad7fbf54
2 files changed
+17
-14
No files matched your search
+1
-1
@@ -99,7 +99,7 @@ function ImGui.TextEx(text, text_end, flags)
|
||||
|
||||
-- Calculate length
|
||||
if text_end == nil then
|
||||
text_end = #text + 1
|
||||
text_end = (type(text) == "string" and string.len(text) or #text) + 1 -- [Luau] `#` on a string isn't a native fast path
|
||||
end
|
||||
|
||||
local dc = window.DC
|
||||
|
||||
Reference in new issue
Block a user