Skip to content

Runtime formatting and logging#2792

Merged
IntegratedQuantum merged 4 commits intoPixelGuys:masterfrom
IntegratedQuantum:runtime_format
Apr 3, 2026
Merged

Runtime formatting and logging#2792
IntegratedQuantum merged 4 commits intoPixelGuys:masterfrom
IntegratedQuantum:runtime_format

Conversation

@IntegratedQuantum
Copy link
Copy Markdown
Member

@IntegratedQuantum IntegratedQuantum commented Mar 30, 2026

This is something I've been wanting to try for a long time, and with some trickery the results are surprisingly good: No major changes in the interface, decent compile time performance gains.

The biggest surprise to me was that I can mostly reusing the formatting infrastructure from the standard library with only the formatting specifier being needed at comptime.

This should be merged after the release in case there are some edge cases where I broke something. Note that with runtime formatting, we'll only get errors at runtime about incorrect formatting specifiers. But I think this is worth the improvement to compile times:

. Before After Binary size
Debug + llvm 16.0 s 13.8 s - 0.3 MB
Debug + x86_64 6.9 s 4.9 s + 3.9 MB (the whole binary is over 600 MB, probably for incremental)
ReleaseSafe 86.6 s 82.6 s - 0.9 MB
ReleaseFast 94.4 s 90.0 s - 1.1 MB

Over 2 seconds saved in debug mode. And this is just the beginning: We can reuse this for bufPrint and allocPrint and other print throughout the code. Overall I'd expect we can probably save another few seconds from the llvm build times and maybe 300 ms from the x86_64 build time.

Remaining work:

  • Wait until 0.2.0
  • support positional arguments

@IntegratedQuantum
Copy link
Copy Markdown
Member Author

Time to get those compile-times down

@IntegratedQuantum IntegratedQuantum merged commit f416a55 into PixelGuys:master Apr 3, 2026
1 check passed
@IntegratedQuantum IntegratedQuantum mentioned this pull request Apr 3, 2026
3 tasks
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.

1 participant