Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization passes #55

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Optimization passes #55

merged 7 commits into from
Jul 1, 2024

Conversation

rdunnington
Copy link
Owner

  • New zig build asm command to generate assembly for perf analysis
  • Gate the debug trace and trap features behind a compile-time option. Most users probably don't care about this and it has a non-trivial impact on perf.
  • Fix instruction immediates regressing to 32 bytes. When they were changed to be extern structs, the ordering started to matter. Now there's a comptime check to make sure they're always 16 bytes.
  • Embed param/return count in function instance to avoid an extra pointer hop.
  • Minor optimization to use @memset to initialize locals since the default values are always 0 anyway.

* turns out this can be significant overhead in preamble()
* converting immediates to extern inflated the size due to C struct ordering rules, so fixing this
* avoids an extra pointer hop at runtime
* using memset instead of manually initializing defaults saves some time here
@rdunnington rdunnington enabled auto-merge (squash) July 1, 2024 22:41
@rdunnington rdunnington merged commit 5931f4f into main Jul 1, 2024
3 checks passed
@rdunnington rdunnington deleted the optimize branch July 1, 2024 22:49
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