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

build: shrink profiling artifacts with panic=abort #2601

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

morrisonlevi
Copy link
Collaborator

Description

Recently the build artifacts got quite large due to the tracer including debug symbols for things. The profiler has also been creeping up in size, and so I thought I'd try to shrink the build artifacts. These all seem to individually give small decreases in size:

  • codegen-units=1
  • lto="fat"
  • debug="line-tables-only"
  • panic=abort
  • Build std from source and do panic=abort: -Z build-std="panic_abort,core,alloc,std". However, this requires nightly, to avoid this, we use the RUSTC_BOOTSTRAP=1 hack.

Note that if you are buliding locally to try to reproduce savings, we also compress with objcopy --compress-debug-sections afterwards.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2024

Codecov Report

Merging #2601 (057d005) into master (95a0831) will decrease coverage by 1.60%.
Report is 3 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2601      +/-   ##
============================================
- Coverage     79.37%   77.77%   -1.60%     
  Complexity     2198     2198              
============================================
  Files           199      225      +26     
  Lines         21955    25955    +4000     
  Branches          0      986     +986     
============================================
+ Hits          17426    20186    +2760     
- Misses         4529     5243     +714     
- Partials          0      526     +526     
Flag Coverage Δ
appsec-extension 69.00% <ø> (?)
tracer-extension 78.52% <ø> (ø)
tracer-php 80.57% <ø> (ø)

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

see 26 files 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 95a0831...057d005. Read the comment docs.

@realFlowControl
Copy link
Member

I gave it a spin and the release binary on aarch64-apple-darwin shrunk from 6.8 MB to 3.6 MB 🎉

ci: use rustup-init instead of tarball
This is done because the tarball does not include rust-src.

ci: parameterized ZTS/NTS for build_profiler task
@pr-commenter
Copy link

pr-commenter bot commented Apr 16, 2024

Benchmarks

Benchmark execution time: 2024-04-16 01:22:05

Comparing candidate commit 829cbd4 in PR branch levi/shrink-build with baseline commit ba797f9 in branch master.

Found 3 performance improvements and 5 performance regressions! Performance is the same for 170 metrics, 0 unstable metrics.

scenario:ContextPropagationBench/benchInject64Bit-opcache

  • 🟥 execution_time [+146.486ns; +471.514ns] or [+2.107%; +6.781%]

scenario:LogsInjectionBench/benchLogsInfoInjection-opcache

  • 🟥 mem_peak [+65.256KB; +214.015KB] or [+3.503%; +11.488%]

scenario:PDOBench/benchPDOBaseline

  • 🟩 execution_time [-16.383µs; -10.231µs] or [-8.816%; -5.505%]

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+12.029µs; +16.207µs] or [+6.942%; +9.352%]

scenario:PDOBench/benchPDOOverhead

  • 🟩 execution_time [-16.624µs; -13.718µs] or [-8.874%; -7.322%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟩 execution_time [-15.908µs; -15.142µs] or [-8.454%; -8.047%]

scenario:SamplingRuleMatchingBench/benchRegexMatching2-opcache

  • 🟥 execution_time [+151.276ns; +405.924ns] or [+2.525%; +6.776%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3

  • 🟥 execution_time [+269.565ns; +556.435ns] or [+4.549%; +9.390%]

@morrisonlevi morrisonlevi changed the title build: shrink profiling artifacts build: shrink profiling artifacts with panic=abort Jun 7, 2024
@morrisonlevi morrisonlevi changed the title build: shrink profiling artifacts with panic=abort build: shrink profiling artifacts with panic=abort Jun 7, 2024
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