-
Notifications
You must be signed in to change notification settings - Fork 49
Conversation
// similar to what we can do with TraceEvents... that would | ||
// allow us to pass the QuicCID directly to Debug and have it | ||
// converted to hex only if the category is enabled so we can | ||
// skip committing resources here. |
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.
Fully agree 👍
It’s a bit tricky because that means we can’t use fprintf()
directly anymore, but that’s probably pretty okay actually given that having a C++-y replacement would also help solve issues like nodejs/node#28761.
Updated! |
cf28446
to
74f6fb5
Compare
@addaleax ... added a new commit that avoids copying in QuicCID when not necessary to do so. Can you please take a look when you get a moment? |
@jasnell Did you benchmark this? (I can also do that if you like.) My best intuition would be that the new code actually adds non-trivial overhead without much gain. Copying an |
|
Much of the time, QuicCID is wrapping a `const ngtcp2_cid*`, when that is the case, avoid copying it's value and use the pointer directly. Otherwise, allocate an internal buffer.
74f6fb5
to
f9ea38a
Compare
Ok, take another look and let me know if that's better :-) |
PR-URL: #286 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #286 Reviewed-By: Anna Henningsen <[email protected]>
Much of the time, QuicCID is wrapping a `const ngtcp2_cid*`, when that is the case, avoid copying it's value and use the pointer directly. Otherwise, allocate an internal buffer. PR-URL: #286 Reviewed-By: Anna Henningsen <[email protected]>
Landed! |
PR-URL: nodejs#286 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: nodejs#286 Reviewed-By: Anna Henningsen <[email protected]>
Much of the time, QuicCID is wrapping a `const ngtcp2_cid*`, when that is the case, avoid copying it's value and use the pointer directly. Otherwise, allocate an internal buffer. PR-URL: nodejs#286 Reviewed-By: Anna Henningsen <[email protected]>
There are two commits here: