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

chore(benchmarks): memory allocation per function during page-load [s… #508

Merged
merged 4 commits into from
Dec 9, 2019

Conversation

vigneshshanmugam
Copy link
Member

@vigneshshanmugam vigneshshanmugam commented Dec 2, 2019

  • part of Add benchmarks #26
  • This PR uses the chrome allocation profiler to measure the memory allocation of top functions from the agent that might help identify memory leaks
  • Generates a new build with keeping the function names of the apm agent to help with identify the functions with more memory allocation.

Adds some keys to the benchmark documents that matches with the function names that uses the most memory

   "memory.createResourceTimingSpan.bytes": 65664,
    "memory.generateRandomId.bytes": 33280,
    "memory.createResourceTimingSpans.bytes": 32864,
    "memory.getCurrentScript.bytes": 32816,
    "memory.patchFetch.bytes": 32816,
    "memory.baseExtend.bytes": 32784,
    "memory.isCORSSupported.bytes": 38376,

@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

Merging #508 into master will increase coverage by 0.47%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   93.87%   94.34%   +0.47%     
==========================================
  Files          42       43       +1     
  Lines        1991     2245     +254     
  Branches      395      489      +94     
==========================================
+ Hits         1869     2118     +249     
- Misses        119      124       +5     
  Partials        3        3
Impacted Files Coverage Δ
packages/rum/src/apm-base.js 94.01% <0%> (-2.57%) ⬇️
packages/rum-core/src/common/patching/xhr-patch.js 90.78% <0%> (-0.35%) ⬇️
packages/rum-core/src/opentracing/tracer.js 91.83% <0%> (-0.17%) ⬇️
...s/rum-core/src/performance-monitoring/breakdown.js 95.65% <0%> (-0.13%) ⬇️
packages/rum-core/src/common/apm-server.js 81.29% <0%> (-0.12%) ⬇️
...ckages/rum-core/src/performance-monitoring/span.js 100% <0%> (ø) ⬆️
packages/rum-core/src/common/url.js 100% <0%> (ø) ⬆️
packages/rum-core/src/common/truncate.js 100% <0%> (ø) ⬆️
...e/src/performance-monitoring/capture-navigation.js 100% <0%> (ø) ⬆️
packages/rum-core/src/common/context.js 100% <0%> (ø)
... and 5 more

Copy link
Contributor

@hmdhk hmdhk left a comment

Choose a reason for hiding this comment

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

Thanks @vigneshshanmugam.
A general note, I think we should separate our build scripts for the final dist and the debugging and testing. Currently, it's hard to tell which function is used for what.

packages/rum/test/benchmarks/analyzer.js Show resolved Hide resolved
packages/rum/test/benchmarks/analyzer.js Outdated Show resolved Hide resolved
packages/rum/test/benchmarks/analyzer.js Show resolved Hide resolved
packages/rum/test/benchmarks/analyzer.js Outdated Show resolved Hide resolved
packages/rum/test/benchmarks/analyzer.js Show resolved Hide resolved
packages/rum/test/benchmarks/profiler.js Show resolved Hide resolved
packages/rum/test/benchmarks/server.js Outdated Show resolved Hide resolved
@hmdhk hmdhk merged commit 4732c73 into elastic:master Dec 9, 2019
@vigneshshanmugam vigneshshanmugam deleted the memory-benchmark branch December 9, 2019 14:00
David-Development pushed a commit to David-Development/apm-agent-rum-js that referenced this pull request Oct 20, 2021
elastic#508)

* chore(benchmarks): memory allocation per function during page-load [skip ci]

* add diff bundle name for apm build [skip ci]

* fix server start [skip ci]

* address review comments [skip ci]
devcorpio pushed a commit to bmorelli25/apm-agent-rum-js that referenced this pull request Jan 25, 2022
elastic#508)

* chore(benchmarks): memory allocation per function during page-load [skip ci]

* add diff bundle name for apm build [skip ci]

* fix server start [skip ci]

* address review comments [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants