DataDog / dd-trace-php

Datadog PHP Clients
https://docs.datadoghq.com/tracing/setup/php
Other
481 stars 149 forks source link

build: shrink size of Rust artifacts #2696

Closed morrisonlevi closed 3 weeks ago

morrisonlevi commented 3 weeks ago

PROF-9904

Description

This is an attempt to shrink artifacts, but unlike #2601, this does not do panic=abort. For panic=abort to be really effective, you also need to rebuild std from source. That means rebuilding images and also installing Rust from rustup (because the packages we are using do not include std sources). We had issues with CI last time we tried it. We played whack-a-mole for a while, but since the issues just kept going and we wanted to release 1.0.0beta1, we decide to revert back.

But this PR without panic=abort will still shrink the size a fair bit, so it's worth splitting out. I wouldn't go so far as saying that it will fix the size issue reported in PR #2599, but it helps.

Reviewer checklist

codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.32%. Comparing base (e636250) to head (76dd2bf). Report is 2 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/graphs/tree.svg?width=650&height=150&src=pr&token=eXio8H7vwF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ```diff @@ Coverage Diff @@ ## master #2696 +/- ## ============================================ + Coverage 77.77% 79.32% +1.55% Complexity 2223 2223 ============================================ Files 226 200 -26 Lines 26386 22369 -4017 Branches 988 0 -988 ============================================ - Hits 20522 17745 -2777 + Misses 5338 4624 -714 + Partials 526 0 -526 ``` | [Flag](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [appsec-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `?` | | | [tracer-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `78.62% <ø> (ø)` | | | [tracer-php](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `80.33% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more. [see 26 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Last update [e636250...76dd2bf](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2696?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog).
morrisonlevi commented 3 weeks ago

Difference between the commit on master and this branch:

# This branch
-rw-r--r-- 1 levi.morrison staff 425M Jun  6 21:30 dd-library-php-1.0.0+76dd2bf00d17575ba6c41682e29f419dd7795668-aarch64-linux-gnu.tar.gz
-rw-r--r-- 1 levi.morrison staff 428M Jun  6 21:30 dd-library-php-1.0.0+76dd2bf00d17575ba6c41682e29f419dd7795668-x86_64-linux-gnu.tar.gz

# master
-rw-r--r-- 1 levi.morrison staff 496M Jun  6 20:14 dd-library-php-1.0.0+e63625078edc52eb92e4c6104f0daaab3ec8fa63-aarch64-linux-gnu.tar.gz
-rw-r--r-- 1 levi.morrison staff 500M Jun  6 20:11 dd-library-php-1.0.0+e63625078edc52eb92e4c6104f0daaab3ec8fa63-x86_64-linux-gnu.tar.gz

Roughly 15% savings.

pr-commenter[bot] commented 3 weeks ago

Benchmarks

Benchmark execution time: 2024-06-07 03:46:29

Comparing candidate commit 76dd2bf00d17575ba6c41682e29f419dd7795668 in PR branch levi/shrink-panic-unwind with baseline commit e63625078edc52eb92e4c6104f0daaab3ec8fa63 in branch master.

Found 2 performance improvements and 1 performance regressions! Performance is the same for 26 metrics, 7 unstable metrics.

scenario:php-profiler-timeline-memory-with-profiler-and-timeline

scenario:walk_stack/1