Repository navigation
Conversation
3 tasks done
enzi221
force-pushed
the
perf/selective-lua-running
branch
from
September 30, 2026 12:39
78463ed to
df5da8a
Compare
enzi221
force-pushed
the
perf/selective-lua-running
branch
from
October 8, 2026 13:08
df5da8a to
832d5ed
Compare
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.
PR Checklist
Summary
Caches Lua triggers, evaluate the trigger only when it has a matching callback.
Related Issues
None.
Changes
This enhances initial chat rendering time by roughly 15%. The exact percentage will vary by numbers of chat messages and Lua triggers.
In a Lua-heavy environment with 30 messages, it takes ~1.7s. See #1625.
With this PR, it takes ~1.45s, which is a 15% enhancement. When combined with #1625, the final result is ~1.05s, or 39% faster.
Implementation details:
Lua evaluation is itself a very heavy operation. Current implementation runs per message, evaluates all triggers , and then determines whether each trigger has the callback.
This PR caches the first evaluation result. For subsequent messages, the evaluation skips when no there is no callback.
Impact
None.