-
Notifications
You must be signed in to change notification settings - Fork 633
perf: Suppress telemetry using ContextFlags(usize) instead of bool #2861
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2861 +/- ##
=====================================
Coverage 80.6% 80.6%
=====================================
Files 126 126
Lines 22195 22201 +6
=====================================
+ Hits 17898 17904 +6
Misses 4297 4297 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d79a782 to
dc038f9
Compare
|
👷 build bot output from this run:
|
dc038f9 to
06eb4a1
Compare
|
These numbers are not relevant since the code has changed completely. |
e3aca49 to
ad3ad40
Compare
|
This is still a draft until #2870 has been merged and all benchmarks are run properly. |
baad2fe to
01874de
Compare
|
New performance numbers 2025-05-06 from this run:
|
01874de to
3416528
Compare
|
@bantonsson can you run the bench in your machine and see if you are also observing the same? I am seeing regression in my laptop. There are improvements to attach ones anyway, so we should still proceed with this PR, but I am curious how much we can trust the bench results from the CI machines! telemetry_suppression/enter_telemetry_suppressed_scope |
|
@cijothomas These are the numbers from my And these are the numbers from my |
fe37e71 to
2f628ee
Compare
2f628ee to
ca8789c
Compare
|
The benchmark numbers comment have been updated with the latest run. |
ca8789c to
38ff659
Compare
|
It would be great if there could be some extra manual testing of this @cijothomas @lalitb so we can come to a conclusion. |
telemetry_suppression/enter_telemetry_suppressed_scope
time: [10.502 ns 10.524 ns 10.546 ns]
change: [+12.347% +12.742% +13.119%] (p = 0.00 < 0.05)
Performance has regressed.
telemetry_suppression/normal_attach
time: [11.106 ns 11.133 ns 11.166 ns]
change: [+8.4063% +8.8465% +9.3006%] (p = 0.00 < 0.05)
Performance has regressed.
telemetry_suppression/is_current_telemetry_suppressed_false
time: [743.58 ps 744.81 ps 746.44 ps]
change: [-0.6749% -0.3983% -0.1260%] (p = 0.00 < 0.05)
Change within noise threshold.
Found 21 outliers among 100 measurements (21.00%)
8 (8.00%) low severe
3 (3.00%) low mild
3 (3.00%) high mild
7 (7.00%) high severe
telemetry_suppression/is_current_telemetry_suppressed_true
time: [743.35 ps 744.08 ps 745.10 ps]
change: [-0.4459% -0.1688% +0.0707%] (p = 0.22 > 0.05)
No change in performance detected.
Found 20 outliers among 100 measurements (20.00%)
3 (3.00%) low severe
6 (6.00%) low mild
5 (5.00%) high mild
6 (6.00%) high severeI'm seeing consistent ~10% regression for enter, no-change for checks. |
|
That is interesting @cijothomas. What hardware are you running on? |
This was in m4 pro. I can try in a windows box and update back. |
|
PR branch: $ cargo bench --bench context_suppression
Finished `bench` profile [optimized + debuginfo] target(s) in 0.13s
Running benches/context_suppression.rs (/tmp/tbd_a/opentelemetry-rust/target/release/deps/context_suppression-3de0ed5c3fd35dc6)
Gnuplot not found, using plotters backend
telemetry_suppression/enter_telemetry_suppressed_scope
time: [26.002 ns 26.039 ns 26.080 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) high mild
3 (3.00%) high severe
telemetry_suppression/normal_attach
time: [26.186 ns 26.201 ns 26.218 ns]
Found 11 outliers among 100 measurements (11.00%)
1 (1.00%) low severe
2 (2.00%) low mild
3 (3.00%) high mild
5 (5.00%) high severe
telemetry_suppression/is_current_telemetry_suppressed_false
time: [1.2984 ns 1.3000 ns 1.3016 ns]
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) low mild
2 (2.00%) high mild
3 (3.00%) high severe
telemetry_suppression/is_current_telemetry_suppressed_true
time: [1.2981 ns 1.3005 ns 1.3030 ns]
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) low mild
5 (5.00%) high mild
2 (2.00%) high severeMachine Conf: $ lscpu | grep -i core
Model name: AMD EPYC 7763 64-Core Processor
Thread(s) per core: 2
Core(s) per socket: 8
$ cat /proc/meminfo | grep -E '^MemTotal'
MemTotal: 65794236 kB
$ uname -a
Linux CPC-labha-5U0JP 6.6.36.3-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Sat Jun 29 07:01:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux |
774c7ab to
0f9717a
Compare
|
I can't seem to get consistently good benchmark numbers across the different architectures, so I'll close this work for now. |
|
Just reopening for another small test. |
The code seems to be highly sensitive to alignment, so use a bitfield instead of a boolean.
0f9717a to
55cbad0
Compare
Changes
This PR aligns the
Contextstruct and changes aboolinto a flag field. It tries to mitigate the performance impact of #2821 on context attach/detach operations.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes