Skip to content

Unconditionally scan the callee before inline cost computation - #23767

Merged
thewilsonator merged 1 commit into
dlang:masterfrom
limepoutine:scan-before-inline
Sep 1, 2026
Merged

Unconditionally scan the callee before inline cost computation#23767
thewilsonator merged 1 commit into
dlang:masterfrom
limepoutine:scan-before-inline

Conversation

@limepoutine

@limepoutine limepoutine commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This allows the test case in #23766 to be fully inlined when compiled with -inline, but does not fix the root cause that function literals in initializers nested within template mixins do not have a separate symbol table entry (so scans miss them).

Generally this should allow a handful more of functions to be inlined. Let's check out the performance impact.

BTW, this is very hard to test due to how mixins work.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

DMD perf check

Metric Base PR Δ
hello binary size (stripped) 0.72 MB 0.72 MB -0.54%
All measurements
Metric Base PR Δ
compile hello.d (instr) 214.9 M 214.9 M +0.001%
compile hello.d -O -release (instr) 233.2 M 233.2 M +0.001%
compile Phobos (instr) 5,121.6 M 5,121.6 M +0.001%
compile Phobos codegen (instr) 1,471.9 M 1,471.9 M 0.000%
compile vibe.d (instr) 15,127.8 M 15,127.9 M 0.000%
dmd binary size (stripped) 6.86 MB 6.86 MB 0.00%
hello binary size (stripped) 0.72 MB 0.72 MB -0.54%
peak RSS (compile hello.d) 43.39 MB 43.42 MB +0.05%
peak RSS (compile Phobos) 618.3 MB 620.5 MB +0.36%
peak RSS (compile vibe.d) 1918 MB 1917 MB -0.07%
compile dmd itself (wall) 12.2 s 12.4 s +1.54%
compile hello.d (wall) 68.6 ms 67.4 ms -1.73%
compile Phobos (wall) 1,590 ms 1,539 ms -3.21%

0b231e9 vs merge-base 4264da7 · about these metrics

@thewilsonator
thewilsonator merged commit b0591f2 into dlang:master Sep 1, 2026
41 of 42 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