Repository navigation
Interpreter: no result cache for natives, no trace text built per allocation - #1441
Conversation
…ocation ProgramState.allocate built its trace message on every allocation, which prints the allocating constructor or closure, although trace logging is off. It is built only when tracing is on now. The interpreter memoised the results of natives it considers pure. The natives are cheaper than hashing and comparing their arguments, and the eviction removed one entry per call once a native had 2048 results. The natives whose handle identity matters keep their own handles (the conversions, Player), so the cache is removed. On gods-arena the compile-time functions ran in 2103 ms before, 1791 ms with the first change and 1546 ms with both (median of 3 cold builds); on a warm JVM the cache made no gain either. Output identical.
…function-perf-283503
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6011e7825
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Two costs of the compile-time interpreter which bought nothing:
ProgramState.allocatebuilt its trace message on every allocation, which prints the allocating constructor or closure, although trace logging is off. It is built only when tracing is on now. This was about 22 % of the samples in the compile-time phase of gods-arena.Player), so the cache is removed with its statistics andclearInterpreterCaches.Compile-time functions of gods-arena (Jass, median of 3 alternating cold builds): 2103 ms before, 1791 ms with the first change, 1546 ms with both. Warm JVM (one process, 12 alternating builds): about 1156 ms with the cache, 850 ms without. The Jass output is identical in every run.
No behaviour changes, so no new test; CompiletimeTests, CompiletimeNativesTest, CompiletimeHashtableTests, InterpreterTests, ModelManagerTests, OptimizerTests and StdLibStringTests pass.