-
Notifications
You must be signed in to change notification settings - Fork 290
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
DNS with less AsyncResources #2494
base: master
Are you sure you want to change the base?
Conversation
BenchmarksFound 15 performance improvements and 14 performance regressions! Performance is the same for 937 cases. scenario:plugin-graphql-with-depth-off-14
scenario:plugin-graphql-with-depth-on-max-14
scenario:plugin-http-client-with-tracer-14
scenario:spans-finish-later-14
scenario:plugin-dns-with-tracer-14
scenario:plugin-http-server-querystring-obfuscation-14
scenario:net-with-tracer-14
scenario:plugin-graphql-with-depth-off-16
scenario:plugin-graphql-with-depth-on-max-16
scenario:plugin-graphql-with-depth-and-collapse-on-16
scenario:plugin-dns-with-tracer-16
scenario:net-with-tracer-16
scenario:scope-manager-base-18
scenario:plugin-dns-with-tracer-18
scenario:plugin-graphql-with-depth-and-collapse-on-18
|
Codecov Report
@@ Coverage Diff @@
## master #2494 +/- ##
==========================================
- Coverage 93.04% 92.91% -0.13%
==========================================
Files 286 286
Lines 9695 9715 +20
==========================================
+ Hits 9021 9027 +6
- Misses 674 688 +14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
7bcc6db
to
3474b03
Compare
@@ -12,6 +12,10 @@ class TracingPlugin extends Plugin { | |||
this.operation = this.constructor.operation | |||
|
|||
this.addTraceSub('start', message => { | |||
// TODO hasAsyncEnd is temporary until all plugins are converted to have asyncEnd |
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.
Can a WeakMap
be used instead? If that's possible then it would be possible to just always store the parent store and the additional property wouldn't be needed.
@@ -46,7 +58,19 @@ class TracingPlugin extends Plugin { | |||
this.activeSpan.finish() | |||
} | |||
|
|||
asyncEnd (...args) { | |||
this.finish(...args) | |||
this.exit(...args) |
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.
This should only happen for OutgoingPlugin
and InternalPlugin
. Even though it doesn't really affect this PR since it only updates an internal plugin, it should still be moved to the right place to avoid issues with other plugins as they are updated to use the new event.
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.
@rochdev There's nothing currently called InternalPlugin
, AFAIK.
b36c72c
to
f835187
Compare
Note that I just force-pushed a rebase on master to run the benchmarks again. @bengl feel free to force push if you get errors when pushing later changes. |
} | ||
context.result = result | ||
asyncEndCh.publish(context) | ||
cb.apply(this, arguments) |
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.
As discussed offline, let's make sure this is wrapped between 2 events so that the subscriber can restore the right context only in the callback, similar to promises and to what is described in nodejs/node#44943 (comment).
No description provided.