Skip to content
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

Add gem startup benchmarking #1062

Merged
merged 1 commit into from
Jun 12, 2020
Merged

Add gem startup benchmarking #1062

merged 1 commit into from
Jun 12, 2020

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Jun 2, 2020

Similar to #1043, this PR adds memory and timing benchmarking to the gem loading process: require 'ddtrace'.

Here's the sample output:

ddtrace gem memory footprint: 6199.06 KiB
ddtrace gem load time: 0.155863s

We run the gem loading process a few times in a new process (to be able to require again like it is the first time) and collect the average to create these results.

Plus, we also have the detailed memory report when running locally:

Total allocated: 6477394 bytes (47492 objects)
Total retained:  895123 bytes (7032 objects)

allocated memory by gem
-----------------------------------
   6455955  ./lib
     21439  other

allocated memory by file
-----------------------------------
    685735  ./lib/ddtrace.rb
    276785  ./lib/ddtrace/tracer.rb
    200023  ./lib/ddtrace/configuration/options.rb
    174986  ./lib/ddtrace/span.rb
    154700  ./lib/ddtrace/transport/http/adapters/unix_socket.rb
    139054  ./lib/ddtrace/configuration/option_definition.rb
    125707  ./lib/ddtrace/runtime/socket.rb
    125132  ./lib/ddtrace/transport/http.rb
     91641  ./lib/ddtrace/writer.rb

@marcotc marcotc added the dev/testing Involves testing processes (e.g. RSpec) label Jun 2, 2020
@marcotc marcotc requested a review from a team June 2, 2020 19:52
@marcotc marcotc self-assigned this Jun 2, 2020
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

@marcotc marcotc merged commit f5d8bb9 into master Jun 12, 2020
@marcotc marcotc added this to Done in Stability via automation Jun 12, 2020
@marcotc marcotc deleted the feat/benchmark-gem-loading branch June 12, 2020 18:49
@marcotc marcotc added this to the 0.37.0 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
No open projects
Stability
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants