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

perf: reduce memory usage in profiling #2995

Draft
wants to merge 1 commit into
base: levi/thin-str
Choose a base branch
from

Conversation

morrisonlevi
Copy link
Collaborator

@morrisonlevi morrisonlevi commented Dec 15, 2024

Description

Utilizes ThinString in the ZendFrame to shrink memory. This shrinks each frame from 7 words to 3 words.

It also moves some label values from Owned to Borrowed, which will save on allocations in the runtime. I played with moving these to ThinString but it doesn't shrink the size of LabelValue (it's so close, I think 1 unused bit away from shrinking down...)

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@pr-commenter
Copy link

pr-commenter bot commented Dec 15, 2024

Benchmarks [ profiler ]

Benchmark execution time: 2025-01-13 20:26:25

Comparing candidate commit e49f49a in PR branch levi/thin-zend-frame with baseline commit b0171fa in branch levi/thin-str.

Found 0 performance improvements and 6 performance regressions! Performance is the same for 23 metrics, 7 unstable metrics.

scenario:walk_stack/1

  • 🟥 wall_time [+4.009µs; +4.015µs] or [+32.911%; +32.960%]

scenario:walk_stack/50

  • 🟥 wall_time [+3.709µs; +3.720µs] or [+24.354%; +24.431%]

scenario:walk_stack/99

  • 🟥 wall_time [+3.866µs; +3.872µs] or [+25.462%; +25.502%]

scenario:walk_stack_instructions/1

  • 🟥 instructions [+33.8K instructions; +33.8K instructions] or [+33.379%; +33.382%]

scenario:walk_stack_instructions/50

  • 🟥 instructions [+36.8K instructions; +36.8K instructions] or [+35.896%; +35.902%]

scenario:walk_stack_instructions/99

  • 🟥 instructions [+37.0K instructions; +37.0K instructions] or [+36.046%; +36.049%]

@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.80%. Comparing base (b0171fa) to head (e49f49a).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##             levi/thin-str    #2995      +/-   ##
===================================================
+ Coverage            74.78%   74.80%   +0.01%     
  Complexity            2781     2781              
===================================================
  Files                  112      112              
  Lines                11017    11017              
===================================================
+ Hits                  8239     8241       +2     
+ Misses                2778     2776       -2     
Flag Coverage Δ
tracer-php 74.80% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0171fa...e49f49a. Read the comment docs.

@morrisonlevi morrisonlevi force-pushed the levi/thin-zend-frame branch 3 times, most recently from 5d13085 to a68d3e7 Compare December 19, 2024 20:14
@morrisonlevi morrisonlevi force-pushed the levi/thin-str branch 2 times, most recently from a67258b to 4ed5a94 Compare December 19, 2024 21:46
@morrisonlevi morrisonlevi force-pushed the levi/thin-zend-frame branch 3 times, most recently from 656b84e to 0cf60e9 Compare December 23, 2024 23:34
Utilizes ThinStr in the ZendFrame to shrink memory.

perf: pre-calculate buffer size in stalk walking
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.

2 participants