Skip to content

eager: apply out of line - #59

Merged
olydis merged 1 commit into
mainfrom
claude/tc-performance-optimizations-rqtyzl-apply
Oct 2, 2026
Merged

olydis merged 1 commit into
mainfrom
claude/tc-performance-optimizations-rqtyzl-apply

Conversation

@olydis

@olydis olydis commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds one attribute: [[gnu::noinline]] on BasicEagerGraphNilMmap32::apply. When apply is inlined into runner.cpp's parse_dag_into, the step loop reloads the arena and the stack on every step.

Cachegrind instruction counts against main (16dfe07, jets on):

main this
load compiler 148,008,645 139,661,669 −5.6%
compile compiler.lamb 828,008,171 782,234,405 −5.5%
compile 1.3 MB 229,034,978 219,709,938 −4.1%
compile 5 MB 426,639,690 417,318,214 −2.2%

With RUNNER_JETS=0, compiling compiler.lamb goes from 837.1M to 790.4M instructions (−5.6%).

Steps and output are unchanged. test.sh passes under C and C.UTF-8 (runner 21, reduce 4).

🤖 Generated with Claude Code

https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr

Inlined into runner.cpp's parse_dag_into, apply()'s step loop reloads the
arena and the stack on every step. Out of line it takes 2.2-5.6% fewer
instructions: loading the compiler 148.0M -> 139.7M, compiling
compiler.lamb 828.0M -> 782.2M.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-apply branch from 083ffb1 to 21fd5a4 Compare October 2, 2026 12:26
@olydis
olydis merged commit 5679507 into main Oct 2, 2026
2 checks passed
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.

2 participants