-
Notifications
You must be signed in to change notification settings - Fork 93
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
perf(ts): simple monomorphic message parse #1217
base: main
Are you sure you want to change the base?
Conversation
5c61309
to
cc558f4
Compare
What makes this monomorphic? What prevents "parse record" from doing similar checks to achieve the same results? The name of the new function does not line up with the return variable names. Does the function return message records or chunk records? If chunk records then I think it should be named accordingly (if we can't make |
That its inputs & outputs are a single shape across calls.
|
2094e2f
to
8ac68f3
Compare
And in our case the input is the same (a Reader) but it is the difference in output (aka return value) that causes deoptimization? |
Yes return values matter, outputs of one function are inputs to the other. You broadly want as much of your hot path call tree to be as "monomorphic" / specialized as possible. |
Not fully monomorphic in the parse path, but we still see a ~10% throughput boost for this simple scoped change
Before
After