Skip to content

Conversation

bengl
Copy link
Collaborator

@bengl bengl commented Nov 3, 2022

No description provided.

@pr-commenter
Copy link

pr-commenter bot commented Nov 3, 2022

Benchmarks

Found 15 performance improvements and 14 performance regressions! Performance is the same for 937 cases.

scenario:plugin-graphql-with-depth-off-14

  • 🟥 cpu_user_time [+0.408s; +0.879s] or [+4.117%; +8.873%]
  • 🟥 execution_time [+0.377s; +0.748s] or [+3.524%; +6.998%]

scenario:plugin-graphql-with-depth-on-max-14

  • 🟥 cpu_user_time [+0.315s; +0.956s] or [+3.276%; +9.958%]
  • 🟥 execution_time [+0.209s; +1.166s] or [+2.030%; +11.331%]

scenario:plugin-http-client-with-tracer-14

  • 🟥 max_rss_usage [+1.533KB; +1.986KB] or [+2.719%; +3.523%]

scenario:spans-finish-later-14

  • 🟩 instructions [-129987732; -67427021] or [-6.143%; -3.186%]

scenario:plugin-dns-with-tracer-14

  • 🟩 cpu_usage_percentage [-1.777%; -1.388%]
  • 🟩 cpu_user_time [-40.777ms; -25.272ms] or [-9.413%; -5.834%]
  • 🟩 execution_time [-0.048s; -0.025s] or [-2.946%; -1.542%]
  • 🟩 instructions [-60702601; -57467613] or [-6.382%; -6.042%]

scenario:plugin-http-server-querystring-obfuscation-14

  • 🟥 cpu_usage_percentage [+0.801%; +0.923%]
  • 🟩 execution_time [-20.782ms; -17.595ms] or [-2.365%; -2.002%]

scenario:net-with-tracer-14

  • 🟩 max_rss_usage [-1.773KB; -1.667KB] or [-3.831%; -3.602%]

scenario:plugin-graphql-with-depth-off-16

  • 🟥 instructions [+417684928; +732744256] or [+1.932%; +3.389%]

scenario:plugin-graphql-with-depth-on-max-16

  • 🟥 execution_time [+0.197s; +0.476s] or [+1.812%; +4.387%]
  • 🟩 max_rss_usage [-149.549KB; -109.963KB] or [-15.739%; -11.573%]

scenario:plugin-graphql-with-depth-and-collapse-on-16

  • 🟥 instructions [+418318672; +494072812] or [+2.013%; +2.377%]

scenario:plugin-dns-with-tracer-16

  • 🟩 cpu_usage_percentage [-1.364%; -1.089%]
  • 🟩 cpu_user_time [-41.552ms; -25.698ms] or [-10.082%; -6.235%]
  • 🟩 instructions [-45330723; -42981979] or [-5.437%; -5.155%]
  • 🟥 max_rss_usage [+1.521KB; +1.796KB] or [+2.966%; +3.502%]

scenario:net-with-tracer-16

  • 🟥 cpu_user_time [+8.224ms; +12.123ms] or [+3.628%; +5.348%]
  • 🟥 execution_time [+8.183ms; +10.161ms] or [+2.295%; +2.850%]

scenario:scope-manager-base-18

  • 🟥 cpu_user_time [+1.459ms; +11.285ms] or [+1.857%; +14.367%]

scenario:plugin-dns-with-tracer-18

  • 🟩 cpu_usage_percentage [-2.253%; -1.830%]
  • 🟩 cpu_user_time [-55.160ms; -38.703ms] or [-12.846%; -9.013%]
  • 🟩 execution_time [-0.055s; -0.025s] or [-3.345%; -1.525%]
  • 🟩 instructions [-68548155; -58171438] or [-7.568%; -6.423%]

scenario:plugin-graphql-with-depth-and-collapse-on-18

  • 🟥 instructions [+434378264; +610041265] or [+1.911%; +2.684%]

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Attention: Patch coverage is 54.05405% with 17 lines in your changes missing coverage. Please review.

Project coverage is 92.91%. Comparing base (6a38f5a) to head (f835187).
Report is 1234 commits behind head on master.

Files with missing lines Patch % Lines
packages/dd-trace/src/plugins/tracing.js 27.27% 8 Missing ⚠️
packages/datadog-instrumentations/src/dns.js 80.00% 4 Missing ⚠️
packages/dd-trace/src/plugins/plugin.js 25.00% 3 Missing ⚠️
packages/dd-trace/src/plugins/outgoing.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bengl bengl force-pushed the bengl/less-ar-dns branch from 7bcc6db to 3474b03 Compare November 3, 2022 22:25
@bengl bengl marked this pull request as ready for review November 3, 2022 22:52
@bengl bengl requested a review from a team as a code owner November 3, 2022 22:52
this.operation = this.constructor.operation

this.addTraceSub('start', message => {
// TODO hasAsyncEnd is temporary until all plugins are converted to have asyncEnd
Copy link
Member

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.


asyncEnd (...args) {
this.finish(...args)
this.exit(...args)
Copy link
Member

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.

Copy link
Collaborator Author

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.

Qard
Qard previously approved these changes Nov 18, 2022
Qard
Qard previously approved these changes Nov 18, 2022
Qard
Qard previously approved these changes Nov 18, 2022
@tlhunter
Copy link
Member

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)
Copy link
Member

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).

@tlhunter tlhunter requested a review from a team as a code owner August 15, 2023 22:07
@tlhunter tlhunter requested review from jbertran and removed request for a team August 15, 2023 22:07
@Qard Qard requested a review from a team as a code owner June 17, 2024 23:42
@bengl
Copy link
Collaborator Author

bengl commented Sep 12, 2024

This PR needs to be completely redone. Closing.

@bengl bengl closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants