-
Notifications
You must be signed in to change notification settings - Fork 15
feat(span): remove clone bound on spantext #1266
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
# Motivation Cloning is very cheap as long as we have a ByteString or a str slice, but if we want to use python strings we need to hold the GIL to clone them. This is not possible in general... But there are no operations requiring us to actual clone the data. # Changes * use an indexmap for the shared dictionary. This datastructure is exactly what we want (O(1) access and insertion order iteration) and keep only one of each value * Use indices into the span slice while computing top level rather than copying the service string
|
# Motivation When we serialize we store the uppper 64 bits of the trace id in a meta tag. But at runtime, we don't want to split it as the trace id still needs to be readable.
e990211 to
2445a48
Compare
BenchmarksComparisonBenchmark execution time: 2025-10-29 19:49:24 Comparing candidate commit 5873b54 in PR branch Found 6 performance improvements and 9 performance regressions! Performance is the same for 40 metrics, 2 unstable metrics. scenario:benching serializing traces from their internal representation to msgpack
scenario:credit_card/is_card_number/37828224631000521389798
scenario:credit_card/is_card_number/x371413321323331
scenario:credit_card/is_card_number_no_luhn/ 378282246310005
scenario:credit_card/is_card_number_no_luhn/378282246310005
scenario:credit_card/is_card_number_no_luhn/37828224631000521389798
scenario:credit_card/is_card_number_no_luhn/x371413321323331
scenario:normalization/normalize_trace/test_trace
scenario:sql/obfuscate_sql_string
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
BaselineOmitted due to size. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
==========================================
+ Coverage 71.91% 71.94% +0.02%
==========================================
Files 368 368
Lines 58146 58111 -35
==========================================
- Hits 41814 41806 -8
+ Misses 16332 16305 -27
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Motivation
Cloning is very cheap as long as we have a ByteString or a str slice, but if we want to use python strings we need to hold the GIL to clone them.
This is not possible in general... But there are no operations requiring us to actual clone the data.
Changes