Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Migrate from regex to regex-lite#1232

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Aaalibaba42 wants to merge9 commits intomain
base:main
Choose a base branch
Loading
fromjwiriath/regex-to-regex-lite

Conversation

@Aaalibaba42
Copy link
Contributor

What does this PR do?

Migrate from theregex crate toregex-lite.

Motivation

Theregex crate is very fast, but takes up lots of space in the binaries.regex-lite might introduce regression in performance, but we should see it's much more optimized in space.

How to test the change?

There is (I believe so) a benchmark on the size of the artifacts (and the performance). We can evaluate if this change is worth it based on those.

@codecov-commenter
Copy link

codecov-commenter commentedSep 19, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.96%. Comparing base (a7c8765) to head (c23f2e6).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #1232      +/-   ##==========================================+ Coverage   71.65%   71.96%   +0.31%==========================================  Files         354      368      +14       Lines       56063    58118    +2055     ==========================================+ Hits        40172    41826    +1654- Misses      15891    16292     +401
ComponentsCoverage Δ
datadog-crashtracker50.67% <ø> (+1.39%)⬆️
datadog-crashtracker-ffi5.86% <ø> (-0.07%)⬇️
datadog-alloc98.73% <ø> (ø)
data-pipeline87.86% <ø> (-2.45%)⬇️
data-pipeline-ffi88.19% <ø> (ø)
ddcommon84.31% <ø> (+0.01%)⬆️
ddcommon-ffi73.84% <ø> (ø)
ddtelemetry59.98% <ø> (-0.04%)⬇️
ddtelemetry-ffi21.24% <ø> (ø)
dogstatsd-client83.26% <ø> (ø)
datadog-ipc82.39% <ø> (ø)
datadog-profiling76.90% <ø> (ø)
datadog-profiling-ffi62.12% <ø> (ø)
datadog-sidecar36.92% <ø> (-0.17%)⬇️
datdog-sidecar-ffi12.12% <ø> (+0.75%)⬆️
spawn-worker55.18% <ø> (-0.17%)⬇️
tinybytes92.44% <ø> (+0.21%)⬆️
datadog-trace-normalization98.24% <ø> (+<0.01%)⬆️
datadog-trace-obfuscation94.17% <100.00%> (+<0.01%)⬆️
datadog-trace-protobuf59.65% <ø> (-17.45%)⬇️
datadog-trace-utils90.34% <ø> (+0.59%)⬆️
datadog-tracer-flare62.42% <ø> (+7.89%)⬆️
datadog-log75.57% <ø> (-0.75%)⬇️
🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pr-commenter
Copy link

pr-commenterbot commentedSep 19, 2025
edited
Loading

Benchmarks

Comparison

Benchmark execution time: 2025-10-27 23:16:12

Comparing candidate commitc23f2e6 in PR branchjwiriath/regex-to-regex-lite with baseline commitc4cdaa2 in branchmain.

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

scenario:concentrator/add_spans_to_concentrator

  • 🟩execution_time [-2.314ms; -2.309ms] or [-21.615%; -21.572%]

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟥execution_time [+6.996µs; +7.050µs] or [+15.317%; +15.435%]
  • 🟥throughput [-2930468.603op/s; -2905621.768op/s] or [-13.385%; -13.271%]

scenario:credit_card/is_card_number_no_luhn/ 378282246310005

  • 🟥execution_time [+4.586µs; +4.663µs] or [+8.454%; +8.595%]
  • 🟥throughput [-1459274.288op/s; -1436316.665op/s] or [-7.916%; -7.792%]

scenario:credit_card/is_card_number_no_luhn/378282246310005

  • 🟥execution_time [+4.974µs; +5.038µs] or [+9.829%; +9.955%]
  • 🟥throughput [-1790199.319op/s; -1767479.986op/s] or [-9.059%; -8.944%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟥execution_time [+6.970µs; +7.024µs] or [+15.248%; +15.367%]
  • 🟥throughput [-2917134.991op/s; -2892169.101op/s] or [-13.334%; -13.219%]

scenario:ip_address/quantize_peer_ip_address_benchmark

  • 🟥execution_time [+3.175µs; +3.187µs] or [+62.840%; +63.068%]

scenario:normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...

  • 🟥execution_time [+37.767µs; +38.109µs] or [+7.599%; +7.668%]
  • 🟥throughput [-143328.353op/s; -142058.081op/s] or [-7.123%; -7.060%]

scenario:normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters

  • 🟥execution_time [+21.631µs; +21.696µs] or [+12.812%; +12.850%]
  • 🟥throughput [-674548.827op/s; -672554.558op/s] or [-11.389%; -11.355%]

scenario:tags/replace_trace_tags

  • 🟥execution_time [+11.218µs; +11.225µs] or [+468.980%; +469.301%]

Candidate

Candidate benchmark details

Group 1

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
credit_card/is_card_number/execution_time3.897µs3.915µs ± 0.003µs3.915µs ± 0.002µs3.916µs3.919µs3.920µs3.923µs0.22%-1.0286.5050.07%0.000µs1200
credit_card/is_card_number/throughput254885115.148op/s255455365.436op/s ± 189725.267op/s255442091.278op/s ± 104009.253op/s255548995.142op/s255731224.550op/s255793341.566op/s256639840.186op/s0.47%1.0446.6090.07%13415.602op/s1200
credit_card/is_card_number/ 3782-8224-6310-005execution_time76.853µs78.226µs ± 0.750µs78.136µs ± 0.456µs78.595µs79.625µs80.340µs81.215µs3.94%0.8371.2170.96%0.053µs1200
credit_card/is_card_number/ 3782-8224-6310-005throughput12312947.805op/s12784635.136op/s ± 121581.184op/s12798176.262op/s ± 74250.071op/s12865991.130op/s12977583.107op/s12999925.053op/s13011836.603op/s1.67%-0.7661.0260.95%8597.088op/s1200
credit_card/is_card_number/ 378282246310005execution_time70.652µs72.391µs ± 0.713µs72.319µs ± 0.500µs72.867µs73.571µs74.169µs74.590µs3.14%0.434-0.0610.98%0.050µs1200
credit_card/is_card_number/ 378282246310005throughput13406647.440op/s13815114.339op/s ± 135533.879op/s13827641.367op/s ± 95300.206op/s13915666.606op/s14010910.369op/s14069742.388op/s14153954.498op/s2.36%-0.383-0.1220.98%9583.692op/s1200
credit_card/is_card_number/37828224631execution_time3.895µs3.914µs ± 0.003µs3.914µs ± 0.002µs3.916µs3.918µs3.920µs3.923µs0.22%-1.32411.3750.07%0.000µs1200
credit_card/is_card_number/37828224631throughput254938345.331op/s255488200.849op/s ± 172507.044op/s255494877.328op/s ± 100113.616op/s255594378.225op/s255696515.561op/s255774810.627op/s256707113.862op/s0.47%1.34811.5490.07%12198.090op/s1200
credit_card/is_card_number/378282246310005execution_time67.212µs68.934µs ± 0.708µs68.948µs ± 0.463µs69.399µs70.202µs70.750µs70.879µs2.80%0.228-0.0951.03%0.050µs1200
credit_card/is_card_number/378282246310005throughput14108487.115op/s14508120.431op/s ± 148802.795op/s14503629.906op/s ± 97417.465op/s14601147.453op/s14747635.195op/s14834354.823op/s14878394.095op/s2.58%-0.171-0.1321.02%10521.947op/s1200
credit_card/is_card_number/37828224631000521389798execution_time52.497µs52.698µs ± 0.081µs52.694µs ± 0.051µs52.750µs52.839µs52.871µs52.902µs0.39%0.124-0.2930.15%0.006µs1200
credit_card/is_card_number/37828224631000521389798throughput18902987.975op/s18975927.849op/s ± 29051.149op/s18977635.807op/s ± 18414.926op/s18994562.333op/s19026268.243op/s19037913.433op/s19048883.244op/s0.38%-0.116-0.2940.15%2054.226op/s1200
credit_card/is_card_number/x371413321323331execution_time6.428µs6.440µs ± 0.010µs6.439µs ± 0.003µs6.442µs6.455µs6.476µs6.513µs1.15%3.67018.5270.16%0.001µs1200
credit_card/is_card_number/x371413321323331throughput153545462.549op/s155276683.205op/s ± 240551.830op/s155309516.676op/s ± 82245.821op/s155391865.238op/s155512624.577op/s155561400.404op/s155575753.929op/s0.17%-3.63818.2230.15%17009.583op/s1200
credit_card/is_card_number_no_luhn/execution_time3.898µs3.915µs ± 0.003µs3.916µs ± 0.002µs3.917µs3.920µs3.925µs3.934µs0.47%0.3766.3660.09%0.000µs1200
credit_card/is_card_number_no_luhn/throughput254211301.230op/s255396813.443op/s ± 224817.252op/s255394139.136op/s ± 128742.423op/s255544388.083op/s255702050.657op/s255759487.700op/s256547689.454op/s0.45%-0.3546.3570.09%15896.980op/s1200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005execution_time64.931µs65.145µs ± 0.146µs65.107µs ± 0.077µs65.206µs65.431µs65.668µs65.742µs0.98%1.6193.1160.22%0.010µs1200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005throughput15210947.694op/s15350371.573op/s ± 34349.805op/s15359331.562op/s ± 18140.442op/s15374002.562op/s15386630.404op/s15394332.286op/s15400885.551op/s0.27%-1.6033.0430.22%2428.898op/s1200
credit_card/is_card_number_no_luhn/ 378282246310005execution_time58.427µs58.872µs ± 0.244µs58.829µs ± 0.151µs58.993µs59.342µs59.621µs59.732µs1.54%0.9740.9830.41%0.017µs1200
credit_card/is_card_number_no_luhn/ 378282246310005throughput16741344.553op/s16986236.262op/s ± 69996.854op/s16998361.358op/s ± 43536.607op/s17035294.169op/s17077296.884op/s17086918.920op/s17115393.696op/s0.69%-0.9490.9140.41%4949.525op/s1200
credit_card/is_card_number_no_luhn/37828224631execution_time3.897µs3.915µs ± 0.004µs3.915µs ± 0.002µs3.917µs3.921µs3.924µs3.938µs0.58%0.93510.2740.09%0.000µs1200
credit_card/is_card_number_no_luhn/37828224631throughput253945101.306op/s255404353.352op/s ± 232437.353op/s255430499.444op/s ± 105495.267op/s255515086.216op/s255702725.417op/s255772717.684op/s256606279.929op/s0.46%-0.90410.1980.09%16435.803op/s1200
credit_card/is_card_number_no_luhn/378282246310005execution_time55.267µs55.612µs ± 0.168µs55.571µs ± 0.080µs55.680µs55.917µs56.113µs56.568µs1.79%1.7775.5050.30%0.012µs1200
credit_card/is_card_number_no_luhn/378282246310005throughput17677934.549op/s17982040.474op/s ± 53891.786op/s17995021.677op/s ± 26067.503op/s18016058.615op/s18043185.734op/s18055728.034op/s18093849.177op/s0.55%-1.7385.2590.30%3810.725op/s1200
credit_card/is_card_number_no_luhn/37828224631000521389798execution_time52.474µs52.705µs ± 0.088µs52.703µs ± 0.058µs52.758µs52.858µs52.896µs52.992µs0.55%0.1930.1940.17%0.006µs1200
credit_card/is_card_number_no_luhn/37828224631000521389798throughput18870924.762op/s18973579.913op/s ± 31769.244op/s18974102.249op/s ± 20900.545op/s18995794.332op/s19020175.272op/s19051052.236op/s19057043.448op/s0.44%-0.1820.1880.17%2246.425op/s1200
credit_card/is_card_number_no_luhn/x371413321323331execution_time6.427µs6.436µs ± 0.005µs6.436µs ± 0.003µs6.438µs6.445µs6.449µs6.462µs0.40%1.4524.8090.07%0.000µs1200
credit_card/is_card_number_no_luhn/x371413321323331throughput154745288.160op/s155366333.421op/s ± 110057.542op/s155370285.434op/s ± 61717.098op/s155441048.095op/s155506787.288op/s155535744.610op/s155583432.867op/s0.14%-1.4424.7490.07%7782.243op/s1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
credit_card/is_card_number/execution_time[3.914µs; 3.915µs] or [-0.010%; +0.010%]NoneNoneNone
credit_card/is_card_number/throughput[255429071.339op/s; 255481659.534op/s] or [-0.010%; +0.010%]NoneNoneNone
credit_card/is_card_number/ 3782-8224-6310-005execution_time[78.122µs; 78.330µs] or [-0.133%; +0.133%]NoneNoneNone
credit_card/is_card_number/ 3782-8224-6310-005throughput[12767785.153op/s; 12801485.119op/s] or [-0.132%; +0.132%]NoneNoneNone
credit_card/is_card_number/ 378282246310005execution_time[72.293µs; 72.490µs] or [-0.137%; +0.137%]NoneNoneNone
credit_card/is_card_number/ 378282246310005throughput[13796330.647op/s; 13833898.031op/s] or [-0.136%; +0.136%]NoneNoneNone
credit_card/is_card_number/37828224631execution_time[3.914µs; 3.914µs] or [-0.009%; +0.009%]NoneNoneNone
credit_card/is_card_number/37828224631throughput[255464293.031op/s; 255512108.666op/s] or [-0.009%; +0.009%]NoneNoneNone
credit_card/is_card_number/378282246310005execution_time[68.836µs; 69.032µs] or [-0.142%; +0.142%]NoneNoneNone
credit_card/is_card_number/378282246310005throughput[14487497.795op/s; 14528743.068op/s] or [-0.142%; +0.142%]NoneNoneNone
credit_card/is_card_number/37828224631000521389798execution_time[52.687µs; 52.710µs] or [-0.021%; +0.021%]NoneNoneNone
credit_card/is_card_number/37828224631000521389798throughput[18971901.639op/s; 18979954.059op/s] or [-0.021%; +0.021%]NoneNoneNone
credit_card/is_card_number/x371413321323331execution_time[6.439µs; 6.442µs] or [-0.022%; +0.022%]NoneNoneNone
credit_card/is_card_number/x371413321323331throughput[155243345.035op/s; 155310021.375op/s] or [-0.021%; +0.021%]NoneNoneNone
credit_card/is_card_number_no_luhn/execution_time[3.915µs; 3.916µs] or [-0.012%; +0.012%]NoneNoneNone
credit_card/is_card_number_no_luhn/throughput[255365655.934op/s; 255427970.952op/s] or [-0.012%; +0.012%]NoneNoneNone
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005execution_time[65.125µs; 65.166µs] or [-0.031%; +0.031%]NoneNoneNone
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005throughput[15345611.020op/s; 15355132.126op/s] or [-0.031%; +0.031%]NoneNoneNone
credit_card/is_card_number_no_luhn/ 378282246310005execution_time[58.838µs; 58.906µs] or [-0.057%; +0.057%]NoneNoneNone
credit_card/is_card_number_no_luhn/ 378282246310005throughput[16976535.372op/s; 16995937.153op/s] or [-0.057%; +0.057%]NoneNoneNone
credit_card/is_card_number_no_luhn/37828224631execution_time[3.915µs; 3.916µs] or [-0.013%; +0.013%]NoneNoneNone
credit_card/is_card_number_no_luhn/37828224631throughput[255372139.770op/s; 255436566.934op/s] or [-0.013%; +0.013%]NoneNoneNone
credit_card/is_card_number_no_luhn/378282246310005execution_time[55.588µs; 55.635µs] or [-0.042%; +0.042%]NoneNoneNone
credit_card/is_card_number_no_luhn/378282246310005throughput[17974571.591op/s; 17989509.357op/s] or [-0.042%; +0.042%]NoneNoneNone
credit_card/is_card_number_no_luhn/37828224631000521389798execution_time[52.693µs; 52.717µs] or [-0.023%; +0.023%]NoneNoneNone
credit_card/is_card_number_no_luhn/37828224631000521389798throughput[18969177.001op/s; 18977982.825op/s] or [-0.023%; +0.023%]NoneNoneNone
credit_card/is_card_number_no_luhn/x371413321323331execution_time[6.436µs; 6.437µs] or [-0.010%; +0.010%]NoneNoneNone
credit_card/is_card_number_no_luhn/x371413321323331throughput[155351080.504op/s; 155381586.338op/s] or [-0.010%; +0.010%]NoneNoneNone

Group 2

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
concentrator/add_spans_to_concentratorexecution_time8.376ms8.394ms ± 0.011ms8.393ms ± 0.008ms8.400ms8.410ms8.421ms8.454ms0.73%1.3885.2140.13%0.001ms1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
concentrator/add_spans_to_concentratorexecution_time[8.392ms; 8.395ms] or [-0.018%; +0.018%]NoneNoneNone

Group 3

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...execution_time185.515µs186.019µs ± 0.263µs185.986µs ± 0.215µs186.226µs186.447µs186.605µs186.715µs0.39%0.235-0.8050.14%0.019µs1200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...throughput5355766.138op/s5375816.766op/s ± 7593.599op/s5376738.308op/s ± 6201.857op/s5381825.736op/s5386724.139op/s5389095.353op/s5390385.896op/s0.25%-0.230-0.8090.14%536.949op/s1200
normalization/normalize_name/normalize_name/bad-nameexecution_time17.930µs18.060µs ± 0.060µs18.060µs ± 0.034µs18.094µs18.133µs18.163µs18.467µs2.26%2.08412.9840.33%0.004µs1200
normalization/normalize_name/normalize_name/bad-namethroughput54150992.078op/s55370328.478op/s ± 183985.259op/s55372402.678op/s ± 103614.534op/s55468733.743op/s55648357.415op/s55727378.804op/s55773624.700op/s0.72%-1.97912.2320.33%13009.722op/s1200
normalization/normalize_name/normalize_name/goodexecution_time10.371µs10.478µs ± 0.049µs10.473µs ± 0.034µs10.515µs10.561µs10.582µs10.595µs1.17%0.186-0.5850.46%0.003µs1200
normalization/normalize_name/normalize_name/goodthroughput94383327.437op/s95442283.442op/s ± 442761.156op/s95484390.183op/s ± 314079.388op/s95766446.885op/s96110193.051op/s96333652.281op/s96424491.526op/s0.98%-0.167-0.5930.46%31307.942op/s1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...execution_time[185.982µs; 186.055µs] or [-0.020%; +0.020%]NoneNoneNone
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...throughput[5374764.366op/s; 5376869.166op/s] or [-0.020%; +0.020%]NoneNoneNone
normalization/normalize_name/normalize_name/bad-nameexecution_time[18.052µs; 18.069µs] or [-0.046%; +0.046%]NoneNoneNone
normalization/normalize_name/normalize_name/bad-namethroughput[55344829.891op/s; 55395827.066op/s] or [-0.046%; +0.046%]NoneNoneNone
normalization/normalize_name/normalize_name/goodexecution_time[10.471µs; 10.485µs] or [-0.064%; +0.064%]NoneNoneNone
normalization/normalize_name/normalize_name/goodthroughput[95380921.004op/s; 95503645.880op/s] or [-0.064%; +0.064%]NoneNoneNone

Group 4

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
benching serializing traces from their internal representation to msgpackexecution_time15.015ms15.066ms ± 0.030ms15.059ms ± 0.011ms15.073ms15.121ms15.176ms15.264ms1.36%2.89412.1560.20%0.002ms1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
benching serializing traces from their internal representation to msgpackexecution_time[15.062ms; 15.070ms] or [-0.028%; +0.028%]NoneNoneNone

Group 5

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...execution_time533.879µs534.943µs ± 0.928µs534.758µs ± 0.341µs535.102µs536.720µs539.166µs540.104µs1.00%2.74810.3020.17%0.066µs1200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...throughput1851494.864op/s1869362.608op/s ± 3229.055op/s1870006.396op/s ± 1191.207op/s1871161.917op/s1872478.890op/s1873076.830op/s1873084.427op/s0.16%-2.72310.1290.17%228.329op/s1200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰ててexecution_time380.168µs380.812µs ± 0.292µs380.809µs ± 0.215µs381.032µs381.322µs381.525µs381.648µs0.22%0.323-0.2060.08%0.021µs1200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰ててthroughput2620216.084op/s2625966.568op/s ± 2014.234op/s2625985.808op/s ± 1482.287op/s2627422.119op/s2628814.842op/s2629786.014op/s2630416.628op/s0.17%-0.319-0.2100.08%142.428op/s1200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Charactersexecution_time190.121µs190.498µs ± 0.179µs190.488µs ± 0.118µs190.602µs190.813µs190.946µs191.063µs0.30%0.4900.1160.09%0.013µs1200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Charactersthroughput5233870.118op/s5249398.235op/s ± 4923.930op/s5249684.767op/s ± 3240.031op/s5253029.333op/s5256328.427op/s5258464.501op/s5259795.459op/s0.19%-0.4850.1080.09%348.174op/s1200
normalization/normalize_service/normalize_service/[empty string]execution_time36.833µs37.015µs ± 0.118µs36.998µs ± 0.100µs37.120µs37.212µs37.279µs37.287µs0.78%0.307-1.1660.32%0.008µs1200
normalization/normalize_service/normalize_service/[empty string]throughput26819167.817op/s27016443.599op/s ± 86053.559op/s27028268.924op/s ± 73401.879op/s27095940.749op/s27123960.258op/s27141486.086op/s27149853.135op/s0.45%-0.300-1.1760.32%6084.905op/s1200
normalization/normalize_service/normalize_service/test_ASCIIexecution_time45.980µs46.115µs ± 0.119µs46.105µs ± 0.041µs46.141µs46.233µs46.274µs47.550µs3.13%8.923104.9940.26%0.008µs1200
normalization/normalize_service/normalize_service/test_ASCIIthroughput21030558.102op/s21685209.321op/s ± 54599.360op/s21689545.734op/s ± 19483.284op/s21710554.049op/s21730913.368op/s21741206.886op/s21748770.288op/s0.27%-8.713101.5980.25%3860.758op/s1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...execution_time[534.815µs; 535.072µs] or [-0.024%; +0.024%]NoneNoneNone
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...throughput[1868915.092op/s; 1869810.125op/s] or [-0.024%; +0.024%]NoneNoneNone
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰ててexecution_time[380.772µs; 380.853µs] or [-0.011%; +0.011%]NoneNoneNone
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰ててthroughput[2625687.415op/s; 2626245.722op/s] or [-0.011%; +0.011%]NoneNoneNone
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Charactersexecution_time[190.473µs; 190.523µs] or [-0.013%; +0.013%]NoneNoneNone
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Charactersthroughput[5248715.826op/s; 5250080.644op/s] or [-0.013%; +0.013%]NoneNoneNone
normalization/normalize_service/normalize_service/[empty string]execution_time[36.999µs; 37.031µs] or [-0.044%; +0.044%]NoneNoneNone
normalization/normalize_service/normalize_service/[empty string]throughput[27004517.403op/s; 27028369.795op/s] or [-0.044%; +0.044%]NoneNoneNone
normalization/normalize_service/normalize_service/test_ASCIIexecution_time[46.098µs; 46.131µs] or [-0.036%; +0.036%]NoneNoneNone
normalization/normalize_service/normalize_service/test_ASCIIthroughput[21677642.375op/s; 21692776.267op/s] or [-0.035%; +0.035%]NoneNoneNone

Group 6

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
receiver_entry_point/report/2597execution_time6.290ms6.571ms ± 0.097ms6.601ms ± 0.021ms6.622ms6.669ms6.686ms6.730ms1.96%-1.4790.9881.47%0.007ms1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
receiver_entry_point/report/2597execution_time[6.557ms; 6.584ms] or [-0.204%; +0.204%]NoneNoneNone

Group 7

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
two way interfaceexecution_time17.752µs25.827µs ± 10.231µs18.052µs ± 0.181µs35.592µs45.278µs55.631µs67.804µs275.61%1.0610.74739.52%0.723µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
two way interfaceexecution_time[24.409µs; 27.245µs] or [-5.490%; +5.490%]NoneNoneNone

Group 8

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
ip_address/quantize_peer_ip_address_benchmarkexecution_time8.182µs8.234µs ± 0.023µs8.239µs ± 0.014µs8.250µs8.263µs8.269µs8.273µs0.42%-0.685-0.3460.27%0.002µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
ip_address/quantize_peer_ip_address_benchmarkexecution_time[8.231µs; 8.237µs] or [-0.038%; +0.038%]NoneNoneNone

Group 9

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
normalization/normalize_trace/test_traceexecution_time241.376ns251.362ns ± 12.132ns245.473ns ± 2.426ns254.884ns281.403ns284.902ns286.787ns16.83%1.5711.1804.81%0.858ns1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
normalization/normalize_trace/test_traceexecution_time[249.681ns; 253.044ns] or [-0.669%; +0.669%]NoneNoneNone

Group 10

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
tags/replace_trace_tagsexecution_time13.550µs13.614µs ± 0.017µs13.617µs ± 0.011µs13.625µs13.636µs13.642µs13.694µs0.56%-0.0861.9390.13%0.001µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
tags/replace_trace_tagsexecution_time[13.611µs; 13.616µs] or [-0.017%; +0.017%]NoneNoneNone

Group 11

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
benching string interning on wordpress profileexecution_time161.654µs162.167µs ± 0.244µs162.143µs ± 0.124µs162.258µs162.637µs162.865µs163.143µs0.62%1.0231.8890.15%0.017µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
benching string interning on wordpress profileexecution_time[162.133µs; 162.201µs] or [-0.021%; +0.021%]NoneNoneNone

Group 12

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
write only interfaceexecution_time1.212µs3.246µs ± 1.483µs2.995µs ± 0.028µs3.029µs3.651µs14.524µs15.514µs417.95%7.29854.62845.58%0.105µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
write only interfaceexecution_time[3.040µs; 3.451µs] or [-6.333%; +6.333%]NoneNoneNone

Group 13

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
sql/obfuscate_sql_stringexecution_time84.670µs85.086µs ± 0.156µs85.075µs ± 0.072µs85.148µs85.236µs85.482µs86.541µs1.72%4.47638.3990.18%0.011µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
sql/obfuscate_sql_stringexecution_time[85.065µs; 85.108µs] or [-0.025%; +0.025%]NoneNoneNone

Group 14

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
benching deserializing traces from msgpack to their internal representationexecution_time62.330ms63.082ms ± 2.415ms62.783ms ± 0.155ms62.926ms63.205ms82.177ms83.004ms32.21%7.84660.3183.82%0.171ms1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
benching deserializing traces from msgpack to their internal representationexecution_time[62.748ms; 63.417ms] or [-0.531%; +0.531%]NoneNoneNone

Group 15

cpu_modelgit_commit_shagit_commit_dategit_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHzc23f2e61761606161jwiriath/regex-to-regex-lite
scenariometricminmean ± sdmedian ± madp75p95p99maxpeak_to_median_ratioskewnesskurtosiscvsemrunssample_size
redis/obfuscate_redis_stringexecution_time32.972µs33.451µs ± 0.864µs33.056µs ± 0.036µs33.145µs35.264µs35.300µs36.996µs11.92%1.8111.7002.58%0.061µs1200
scenariometric95% CI meanShapiro-Wilk pvalueLjung-Box pvalue (lag=1)Dip test pvalue
redis/obfuscate_redis_stringexecution_time[33.332µs; 33.571µs] or [-0.358%; +0.358%]NoneNoneNone

Baseline

Omitted due to size.

@Aaalibaba42Aaalibaba42force-pushed thejwiriath/regex-to-regex-lite branch from87e6cfa tob9ee66dCompareSeptember 22, 2025 08:21
@Aaalibaba42
Copy link
ContributorAuthor

tools:

  • Regex used to find typedef/defines at the beginning of c files (Like #define MY_VAR 35) -> Not trivial but doable without regex without being too expensive I think

datadog-trace-obfuscation:

  • ip_address.rs: Just segmentation of protocol vs address, maybe we could do without it but harder to optimize better than regex crates
  • replacer.rs: Used to run the clients' regex for obfuscation, we can't do without

ddcommon:

  • azure_app_services.rs: parsing and getting the "resource group" of azure. Given the Regex pattern we should be able to it without regexes relatively quickly
  • entitiy_id/unix/mod.rs: Only used for testing in this file, I don't even think that it would be in the release crate with the configuration
  • entitiy_id/unix/container_id.rs: Used to match cgroup to identify running container id, would be a bit harder to do without

datadog-live-debugger:

  • expr_eval.rs: I don't have the full context of this, but when condition is checked for strings, it can be in the form of a regex match. So we couldn't do without them if the pattern is not known before-hand.
  • redacted_names.rs: Most of the file uses regex_automata crate, only one time the regex crate to escape regular expression meta characters. Don't know whether we could do without

data-pipeline:

  • CAN'T MIGRATE: testing done withhttpmock implements traits from theregex crate that are not the same as theregex-lite crate (I think, I did not 100% investigate but compilation message lead me to believe this)
  • src/telemetry/mod.rs: Just used for testing, Same as above, I don't even believe this would be present in the final release binary

@Aaalibaba42Aaalibaba42 marked this pull request as ready for reviewSeptember 22, 2025 12:11
@Aaalibaba42Aaalibaba42 requested review froma team ascode ownersSeptember 22, 2025 12:11
@Aaalibaba42
Copy link
ContributorAuthor

https://gitlab.ddbuild.io/DataDog/apm-reliability/libddprof-build/-/jobs/1140399351 Job for size benchmark failed, so I'm pasting the results here:

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
ArtifactBaselineCommitChange
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a70.98 MB67.98 MB--4.22% (-2.99 MB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so7.19 MB6.69 MB--6.94% (-511.95 KB) 💪
aarch64-unknown-linux-gnu
ArtifactBaselineCommitChange
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so9.25 MB8.65 MB--6.49% (-615.48 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a83.24 MB79.85 MB--4.07% (-3.39 MB) 💪
libdatadog-x64-windows
ArtifactBaselineCommitChange
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll18.39 MB16.83 MB--8.46% (-1.55 MB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib65.01 KB65.01 KB0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb124.93 MB120.41 MB--3.61% (-4.51 MB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib653.09 MB641.35 MB--1.79% (-11.73 MB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll5.89 MB5.36 MB--8.88% (-536.00 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib65.01 KB65.01 KB0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb17.36 MB16.24 MB--6.43% (-1.11 MB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib32.22 MB30.14 MB--6.44% (-2.07 MB) 💪
libdatadog-x86-windows
ArtifactBaselineCommitChange
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll15.67 MB14.73 MB--6.05% (-971.50 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib66.01 KB66.01 KB0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb127.26 MB124.42 MB--2.22% (-2.83 MB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib643.25 MB634.37 MB--1.38% (-8.87 MB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll4.49 MB4.10 MB--8.80% (-405.50 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib66.01 KB66.01 KB0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb18.50 MB17.62 MB--4.77% (-904.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib30.26 MB28.72 MB--5.08% (-1.53 MB) 💪
x86_64-alpine-linux-musl
ArtifactBaselineCommitChange
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a63.63 MB60.13 MB--5.49% (-3.49 MB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so8.50 MB7.93 MB--6.79% (-591.96 KB) 💪
x86_64-unknown-linux-gnu
ArtifactBaselineCommitChange
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a78.03 MB74.42 MB--4.62% (-3.61 MB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so9.84 MB9.21 MB--6.46% (-652.00 KB) 💪

Copy link
Contributor

@paullegranddcpaullegranddc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

One not about specifying the dependency but otherwise LGTM


[dependencies]
regex ="1"
regex-lite ="^0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

"^0.1" is equivalent to "0.1" so you don't really need to add it
https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements

Also you should probably add it as a workspace dependencies, with a minimum constraint to the highest minor available ("0.1.7" right now)

Copy link
ContributorAuthor

@Aaalibaba42Aaalibaba42Sep 23, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What about instances where it is likely using a whole regex engine (even the lite one) is superfluous as described in this comment:#1232 (comment)

Is it worth exploring ? Would it be a separate PR ?

@Aaalibaba42
Copy link
ContributorAuthor

Aaalibaba42 commentedSep 23, 2025
edited
Loading

There is also the potential pitfall of Unicode support: One of the corners cut by regex-lite to be smol was to sacrifice a little correctness, notably around Unicode support. In the instances where this PR changes regex to regex-lite:

  • are there instances where unicode could be used ?
  • and if so would the corners cut by regex-lite lead to bugs ?

@Aaalibaba42Aaalibaba42force-pushed thejwiriath/regex-to-regex-lite branch 2 times, most recently fromaee876a to8d550b8CompareOctober 27, 2025 18:56
@Aaalibaba42Aaalibaba42force-pushed thejwiriath/regex-to-regex-lite branch from8d550b8 to42aaebbCompareOctober 27, 2025 18:59
@Aaalibaba42
Copy link
ContributorAuthor

Please check outthis subproject (especially the readme) for information about the change

@Aaalibaba42Aaalibaba42force-pushed thejwiriath/regex-to-regex-lite branch from71fad1e to6447feeCompareOctober 27, 2025 23:00
@Aaalibaba42Aaalibaba42force-pushed thejwiriath/regex-to-regex-lite branch from6447fee toc23f2e6CompareOctober 27, 2025 23:02
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@paullegranddcpaullegranddcpaullegranddc left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@Aaalibaba42@codecov-commenter@paullegranddc

[8]ページ先頭

©2009-2025 Movatter.jp