-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add some string/char related micro-optimizations #73
Conversation
|
There's also probably some room to split out a version for C-string literals so that it can be inlined and the EDIT: Nevermind, I think this already happens. |
This takes clang.wasm compile time from 1.7s to 1.5s on my machine.
This takes clang.wasm compile time from 1.5s to 1.3s on my machine.
Rebased the |
The tests look weirdly suspiciously broken, so I figured it was UB or something. Ran locally with |
Also, further, I diffed |
Don't write in the case of positive numbers and write a char in the case of negative.
@tekknolagi Thank you for the optimizations, the numbers look great! I'll try to find time to investigate why the tests fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There's a small issue with writing the minus sign, but after fixing it, all test pass (locally) 🎉
Co-authored-by: Bastian Müller <bastian@turbolent.com>
🥳 |
Together, these patches bring down wasm2c compile time of clang.wasm from 1.7s to 1.2s on my machine. Let me know if you would like these and if you would like me to squash.