-
Notifications
You must be signed in to change notification settings - Fork 303
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
optimizing mimetype serialization #1054
Conversation
64252d3
to
b8d5218
Compare
b8d5218
to
572f2fd
Compare
572f2fd
to
51f1c9c
Compare
Does new benchmarking tooling we added gives us a way to fail CI if a given benchmark regresses more than a given percentage? (like if something shot up 400%) |
eventually this will be possible. Right now it is just an instrument to measure a single change impact. I plan to start collecting these on TC for a longer term trend |
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.
nice, lgtm with James suggestions.
…2023-08-23-opt-mimetype
char arr[StackSize]; | ||
|
||
// on the heap chunks | ||
kj::Vector<kj::Array<char>> chunks; |
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.
Non-blocking... and just thinking out loud.... In Node.js we have a utility type called MaybeStackBuffer<T>
that encapsulates this Maybe-Stack-Maybe-Heap pattern. It's a lot like KJ_STACK_ARRAY
but in a form that is easy to define and use as class members like this. It might be worthwhile to adopt a version of that for our use.
…yi/2023-08-23-opt-mimetype
kj::strTree results in plenty of heap allocation. Using capacity-bound string buffer to do only one allocation per serialize
before:
after: