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

[profiling] add ffi for crossbeam::ArrayQueue #538

Merged
merged 41 commits into from
Aug 1, 2024

Conversation

taegyunkim
Copy link
Contributor

@taegyunkim taegyunkim commented Jul 18, 2024

What does this PR do?

Adds ffi for crossbeam::ArrayQueue<*mut c_void>

Motivation

Python profiler allocates a new Sample whenever a it collects an event (stack/memory/lock). Then, the Sample is freed right after. Code for new/delete Sample is here. This results in calling new/delete a lot and creates some memory pressure to the system and shows up on native profiler. Frequent calls to new/delete can be avoided if we use a pool of Samples. And this ArrayQueue will be used to implement the pool.

Another option we considered is using mutex guarded vector in C++ in dd-trace-py. However, it would be little tricky to handle fork() if we use a lock. So we decided to use lock-free list/queue/stack.

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

@github-actions github-actions bot added the profiling Relates to the profiling* modules. label Jul 18, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jul 18, 2024

Benchmarks

Comparison

Benchmark execution time: 2024-08-01 18:55:43

Comparing candidate commit 2b03b84 in PR branch taegyunkim/prof-10011-arrayqueue with baseline commit d7e8fee in branch main.

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

scenario:tags/replace_trace_tags

  • 🟥 execution_time [+72.452ns; +75.139ns] or [+3.120%; +3.235%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.475µs 2.930µs ± 1.842µs 2.759µs ± 0.015µs 2.774µs 2.964µs 3.807µs 24.478µs 787.05% 10.291 108.669 62.71% 0.130µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [2.674µs; 3.185µs] or [-8.712%; +8.712%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 17.071µs 37.263µs ± 32.234µs 37.583µs ± 3.277µs 40.404µs 50.725µs 59.551µs 462.813µs 1131.43% 11.611 150.566 86.29% 2.279µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [32.796µs; 41.730µs] or [-11.989%; +11.989%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 36.816µs 36.897µs ± 0.040µs 36.890µs ± 0.019µs 36.915µs 36.943µs 37.001µs 37.256µs 0.99% 4.285 33.841 0.11% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [36.892µs; 36.903µs] or [-0.015%; +0.015%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 70.157µs 70.331µs ± 0.113µs 70.318µs ± 0.035µs 70.356µs 70.405µs 70.540µs 71.419µs 1.57% 6.887 59.158 0.16% 0.008µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [70.315µs; 70.346µs] or [-0.022%; +0.022%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 320.375ns 330.748ns ± 8.517ns 330.669ns ± 1.305ns 331.665ns 335.944ns 340.520ns 439.476ns 32.91% 10.479 131.291 2.57% 0.602ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [329.568ns; 331.929ns] or [-0.357%; +0.357%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 1.653µs 1.655µs ± 0.001µs 1.655µs ± 0.000µs 1.656µs 1.656µs 1.658µs 1.661µs 0.34% 3.086 21.781 0.04% 0.000µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [1.655µs; 1.655µs] or [-0.006%; +0.006%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 279.923ns 281.951ns ± 0.430ns 281.966ns ± 0.127ns 282.091ns 282.295ns 283.042ns 285.659ns 1.31% 2.982 30.970 0.15% 0.030ns 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 33.620ns 34.386ns ± 0.426ns 34.368ns ± 0.223ns 34.571ns 34.926ns 35.391ns 37.563ns 9.29% 2.345 15.060 1.24% 0.030ns 1 200
normalization/normalize_name/normalize_name/good execution_time 21.354ns 21.844ns ± 0.163ns 21.798ns ± 0.080ns 21.917ns 22.125ns 22.338ns 22.524ns 3.33% 0.966 2.431 0.74% 0.011ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-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 [281.891ns; 282.010ns] or [-0.021%; +0.021%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [34.327ns; 34.445ns] or [-0.172%; +0.172%] None None None
normalization/normalize_name/normalize_name/good execution_time [21.821ns; 21.866ns] or [-0.103%; +0.103%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 578.465ns 591.567ns ± 5.839ns 591.594ns ± 3.787ns 595.369ns 600.404ns 605.684ns 613.664ns 3.73% 0.181 0.552 0.98% 0.413ns 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 439.955ns 453.993ns ± 3.635ns 454.975ns ± 0.321ns 455.239ns 455.510ns 457.411ns 461.825ns 1.51% -3.105 8.764 0.80% 0.257ns 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 192.866ns 201.725ns ± 3.513ns 201.435ns ± 2.696ns 204.140ns 206.024ns 212.711ns 214.982ns 6.73% 0.398 1.309 1.74% 0.248ns 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.997ns 43.382ns ± 7.144ns 40.651ns ± 2.979ns 46.666ns 58.857ns 59.061ns 59.330ns 45.95% 1.327 0.427 16.43% 0.505ns 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 62.557ns 69.873ns ± 5.637ns 67.967ns ± 2.819ns 69.397ns 80.405ns 80.905ns 81.525ns 19.95% 0.941 -0.619 8.05% 0.399ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [590.758ns; 592.376ns] or [-0.137%; +0.137%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [453.489ns; 454.497ns] or [-0.111%; +0.111%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [201.238ns; 202.212ns] or [-0.241%; +0.241%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [42.391ns; 44.372ns] or [-2.282%; +2.282%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [69.092ns; 70.654ns] or [-1.118%; +1.118%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.251ns 3.427ns ± 0.017ns 3.429ns ± 0.001ns 3.429ns 3.431ns 3.435ns 3.438ns 0.29% -9.754 94.386 0.49% 0.001ns 1 200
credit_card/is_card_number/ throughput 290827043.958op/s 291811793.232op/s ± 1515358.960op/s 291671246.534op/s ± 72996.708op/s 291746187.332op/s 291880823.319op/s 292094997.884op/s 307628049.375op/s 5.47% 9.773 94.683 0.52% 107152.060op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 85.215ns 87.353ns ± 0.967ns 87.221ns ± 0.518ns 87.819ns 88.829ns 90.367ns 92.435ns 5.98% 1.266 4.129 1.10% 0.068ns 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 10818468.069op/s 11449229.714op/s ± 125141.338op/s 11465177.487op/s ± 68103.005op/s 11523884.706op/s 11631931.670op/s 11713759.422op/s 11734957.416op/s 2.35% -1.122 3.496 1.09% 8848.829op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 80.626ns 82.503ns ± 0.831ns 82.435ns ± 0.485ns 82.938ns 83.883ns 84.805ns 86.543ns 4.98% 0.935 2.764 1.00% 0.059ns 1 200
credit_card/is_card_number/ 378282246310005 throughput 11554915.519op/s 12121947.054op/s ± 121029.304op/s 12130810.956op/s ± 71740.822op/s 12199073.575op/s 12310133.068op/s 12399689.086op/s 12402939.568op/s 2.24% -0.821 2.362 1.00% 8558.064op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.267ns 3.427ns ± 0.016ns 3.429ns ± 0.001ns 3.430ns 3.432ns 3.445ns 3.471ns 1.24% -8.926 84.661 0.48% 0.001ns 1 200
credit_card/is_card_number/37828224631 throughput 288091970.936op/s 291766102.404op/s ± 1458745.111op/s 291662919.421op/s ± 108175.112op/s 291764949.221op/s 291896253.498op/s 292222210.027op/s 306048261.262op/s 4.93% 9.023 85.652 0.50% 103148.856op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 77.862ns 80.258ns ± 0.857ns 80.192ns ± 0.452ns 80.691ns 81.763ns 82.715ns 83.216ns 3.77% 0.491 1.583 1.07% 0.061ns 1 200
credit_card/is_card_number/378282246310005 throughput 12016980.715op/s 12461270.786op/s ± 132442.361op/s 12470011.697op/s ± 70331.451op/s 12531773.895op/s 12660289.195op/s 12819842.258op/s 12843251.593op/s 2.99% -0.384 1.500 1.06% 9365.089op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 67.320ns 68.201ns ± 0.338ns 68.202ns ± 0.180ns 68.374ns 68.667ns 69.110ns 70.056ns 2.72% 0.774 4.503 0.49% 0.024ns 1 200
credit_card/is_card_number/37828224631000521389798 throughput 14274246.489op/s 14662869.638op/s ± 72412.302op/s 14662337.933op/s ± 38820.248op/s 14702531.006op/s 14790746.078op/s 14840538.393op/s 14854374.113op/s 1.31% -0.688 4.152 0.49% 5120.323op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 21.318ns 22.514ns ± 0.419ns 22.472ns ± 0.262ns 22.754ns 23.250ns 23.644ns 24.001ns 6.80% 0.470 0.742 1.86% 0.030ns 1 200
credit_card/is_card_number/x371413321323331 throughput 41664319.222op/s 44432145.895op/s ± 821180.187op/s 44499115.716op/s ± 521890.126op/s 44988519.443op/s 45656172.375op/s 46002981.535op/s 46909127.045op/s 5.42% -0.332 0.571 1.84% 58066.208op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.263ns 3.429ns ± 0.016ns 3.431ns ± 0.000ns 3.431ns 3.432ns 3.433ns 3.439ns 0.24% -9.779 94.261 0.48% 0.001ns 1 200
credit_card/is_card_number_no_luhn/ throughput 290769487.431op/s 291623998.492op/s ± 1460816.063op/s 291475239.194op/s ± 40830.266op/s 291518687.659op/s 291639518.138op/s 292020535.945op/s 306505068.610op/s 5.16% 9.788 94.391 0.50% 103295.294op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 66.802ns 67.900ns ± 0.544ns 67.870ns ± 0.291ns 68.133ns 68.856ns 69.441ns 71.076ns 4.72% 1.366 5.589 0.80% 0.038ns 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 14069541.129op/s 14728444.993op/s ± 116706.988op/s 14734005.403op/s ± 63344.568op/s 14804220.512op/s 14886060.921op/s 14959961.802op/s 14969608.371op/s 1.60% -1.234 4.860 0.79% 8252.430op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 62.166ns 62.986ns ± 0.377ns 62.953ns ± 0.206ns 63.164ns 63.753ns 63.952ns 64.202ns 1.98% 0.544 0.565 0.60% 0.027ns 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 15575857.639op/s 15877155.621op/s ± 94813.755op/s 15884904.666op/s ± 51808.716op/s 15933851.849op/s 16015128.524op/s 16081149.903op/s 16085949.934op/s 1.27% -0.503 0.521 0.60% 6704.345op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.263ns 3.429ns ± 0.016ns 3.431ns ± 0.000ns 3.431ns 3.433ns 3.437ns 3.441ns 0.28% -9.729 93.610 0.48% 0.001ns 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 290650504.273op/s 291612130.595op/s ± 1459908.228op/s 291476546.778op/s ± 41525.818op/s 291516285.294op/s 291648595.732op/s 291975776.138op/s 306434844.348op/s 5.13% 9.743 93.792 0.50% 103231.101op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 58.802ns 60.753ns ± 0.495ns 60.752ns ± 0.242ns 61.003ns 61.347ns 62.069ns 63.010ns 3.72% 0.147 4.587 0.81% 0.035ns 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 15870478.126op/s 16461229.965op/s ± 134079.404op/s 16460247.225op/s ± 65721.325op/s 16522881.392op/s 16683193.284op/s 16778908.389op/s 17006266.994op/s 3.32% 0.012 4.496 0.81% 9480.846op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 66.402ns 67.341ns ± 0.450ns 67.355ns ± 0.215ns 67.565ns 67.697ns 68.119ns 71.726ns 6.49% 4.327 43.644 0.67% 0.032ns 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 13941899.944op/s 14850412.006op/s ± 96625.083op/s 14846702.120op/s ± 47490.560op/s 14894414.522op/s 14998561.586op/s 15058787.924op/s 15059725.223op/s 1.43% -3.813 37.748 0.65% 6832.425op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 20.975ns 22.116ns ± 0.418ns 22.060ns ± 0.211ns 22.307ns 22.753ns 23.605ns 24.193ns 9.67% 1.418 5.074 1.89% 0.030ns 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 41333901.188op/s 45231671.410op/s ± 835104.219op/s 45330985.901op/s ± 436168.363op/s 45683523.086op/s 46279010.534op/s 46868779.181op/s 47676128.059op/s 5.17% -1.144 4.051 1.84% 59050.786op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.425ns; 3.429ns] or [-0.069%; +0.069%] None None None
credit_card/is_card_number/ throughput [291601779.055op/s; 292021807.410op/s] or [-0.072%; +0.072%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [87.219ns; 87.487ns] or [-0.153%; +0.153%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [11431886.328op/s; 11466573.100op/s] or [-0.151%; +0.151%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [82.388ns; 82.618ns] or [-0.140%; +0.140%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12105173.556op/s; 12138720.551op/s] or [-0.138%; +0.138%] None None None
credit_card/is_card_number/37828224631 execution_time [3.425ns; 3.430ns] or [-0.066%; +0.066%] None None None
credit_card/is_card_number/37828224631 throughput [291563934.361op/s; 291968270.447op/s] or [-0.069%; +0.069%] None None None
credit_card/is_card_number/378282246310005 execution_time [80.139ns; 80.376ns] or [-0.148%; +0.148%] None None None
credit_card/is_card_number/378282246310005 throughput [12442915.548op/s; 12479626.023op/s] or [-0.147%; +0.147%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [68.154ns; 68.248ns] or [-0.069%; +0.069%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [14652833.990op/s; 14672905.287op/s] or [-0.068%; +0.068%] None None None
credit_card/is_card_number/x371413321323331 execution_time [22.456ns; 22.572ns] or [-0.258%; +0.258%] None None None
credit_card/is_card_number/x371413321323331 throughput [44318338.219op/s; 44545953.571op/s] or [-0.256%; +0.256%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.427ns; 3.431ns] or [-0.066%; +0.066%] None None None
credit_card/is_card_number_no_luhn/ throughput [291421543.435op/s; 291826453.549op/s] or [-0.069%; +0.069%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [67.825ns; 67.975ns] or [-0.111%; +0.111%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [14712270.526op/s; 14744619.459op/s] or [-0.110%; +0.110%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [62.934ns; 63.038ns] or [-0.083%; +0.083%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [15864015.346op/s; 15890295.895op/s] or [-0.083%; +0.083%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.427ns; 3.432ns] or [-0.066%; +0.066%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [291409801.355op/s; 291814459.834op/s] or [-0.069%; +0.069%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [60.684ns; 60.821ns] or [-0.113%; +0.113%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [16442647.849op/s; 16479812.080op/s] or [-0.113%; +0.113%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [67.279ns; 67.403ns] or [-0.093%; +0.093%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [14837020.699op/s; 14863803.314op/s] or [-0.090%; +0.090%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [22.058ns; 22.174ns] or [-0.262%; +0.262%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [45115933.997op/s; 45347408.823op/s] or [-0.256%; +0.256%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.386µs 2.396µs ± 0.006µs 2.396µs ± 0.004µs 2.399µs 2.407µs 2.412µs 2.413µs 0.72% 0.679 0.295 0.23% 0.000µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.395µs; 2.397µs] or [-0.032%; +0.032%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 2b03b84 1722537638 taegyunkim/prof-10011-arrayqueue
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 137.973µs 138.302µs ± 0.196µs 138.284µs ± 0.078µs 138.347µs 138.574µs 138.895µs 139.722µs 1.04% 3.428 19.900 0.14% 0.014µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [138.274µs; 138.329µs] or [-0.020%; +0.020%] None None None

Baseline

Omitted due to size.

@datadog-datadog-prod-us1
Copy link

Library Vulnerabilities

✅ No library vulnerabilities found (scanned 5d0d2e3).

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 67.80303% with 85 lines in your changes missing coverage. Please review.

Project coverage is 70.22%. Comparing base (d7e8fee) to head (2b03b84).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #538      +/-   ##
==========================================
- Coverage   70.22%   70.22%   -0.01%     
==========================================
  Files         213      214       +1     
  Lines       28549    28813     +264     
==========================================
+ Hits        20048    20233     +185     
- Misses       8501     8580      +79     
Components Coverage Δ
crashtracker 21.17% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 50.00% <ø> (ø)
data-pipeline-ffi 0.00% <ø> (ø)
ddcommon 83.07% <67.80%> (-1.90%) ⬇️
ddcommon-ffi 70.20% <67.80%> (-0.08%) ⬇️
ddtelemetry 58.95% <ø> (ø)
ipc 84.18% <ø> (ø)
profiling 84.26% <ø> (ø)
profiling-ffi 77.42% <ø> (ø)
serverless 0.00% <ø> (ø)
sidecar 34.55% <ø> (ø)
sidecar-ffi 0.00% <ø> (ø)
spawn-worker 54.98% <ø> (ø)
trace-mini-agent 70.88% <ø> (ø)
trace-normalization 98.24% <ø> (ø)
trace-obfuscation 95.73% <ø> (ø)
trace-protobuf 77.16% <ø> (ø)
trace-utils 90.90% <ø> (ø)

@taegyunkim taegyunkim force-pushed the taegyunkim/prof-10011-arrayqueue branch from 0d94e72 to aaabdaf Compare July 19, 2024 17:33
profiling-ffi/src/lib.rs Outdated Show resolved Hide resolved
@taegyunkim taegyunkim force-pushed the taegyunkim/prof-10011-arrayqueue branch from 3ecab4d to e812aff Compare July 23, 2024 18:44
@github-actions github-actions bot removed the profiling Relates to the profiling* modules. label Jul 23, 2024
@taegyunkim taegyunkim force-pushed the taegyunkim/prof-10011-arrayqueue branch from 89b98c9 to aff0db3 Compare July 24, 2024 16:44
@taegyunkim taegyunkim marked this pull request as ready for review July 24, 2024 17:51
@taegyunkim taegyunkim requested review from a team as code owners July 24, 2024 17:51
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

This looks quite reasonable! I've been holding off on buffering things on the Ruby library (instead try to make everything immediate) in part because of the complexity of getting this kind of queue going in a C codebase, but I guess after this is in I should probably consider using it in a few places :)

My rust-foo isn't great so I recommend waiting for @danielsn's final pass/approval as well, but here sir, take my 👍

ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Show resolved Hide resolved
Copy link
Contributor

@paullegranddc paullegranddc left a comment

Choose a reason for hiding this comment

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

As a general comment, all of the extern "C" functions in this PR take an *ArrayQueue and cast it to an &'a crossbeam::ArrayQueue, but the thing is, the lifetime is never bound, so you could very well get an &'static crossbeam::ArrayQueue and have it escape the fucntion.

I think it'd be better to take an &'a ArrayQueue in the ffi fucntions, which is translated to the same ArrayQueue* in the C header, which would allow to derive the &'a crossbeam::ArrayQueue lifetime safely and ensure it doesn't escape.

ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
@taegyunkim taegyunkim closed this Jul 25, 2024
@taegyunkim taegyunkim reopened this Jul 25, 2024
ddcommon-ffi/src/array_queue.rs Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
examples/ffi/array_queue.cpp Show resolved Hide resolved
@gleocadie
Copy link
Contributor

Can you add description and what motivates this PR please ? (as describe in the template)
It's difficult to understand why we are adding this and if it would benefit us (other libraries)
Thx

@taegyunkim taegyunkim requested review from a team as code owners July 28, 2024 21:27
@github-actions github-actions bot added the profiling Relates to the profiling* modules. label Jul 28, 2024
@taegyunkim taegyunkim force-pushed the taegyunkim/prof-10011-arrayqueue branch from 95fc303 to bb985a6 Compare July 31, 2024 18:32
Copy link
Contributor

@danielsn danielsn left a comment

Choose a reason for hiding this comment

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

Modulo a few ⛏️ LGTM

ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Outdated Show resolved Hide resolved
ddcommon-ffi/src/array_queue.rs Show resolved Hide resolved
taegyunkim and others added 2 commits August 1, 2024 14:19
Co-authored-by: Daniel Schwartz-Narbonne <danielsn@users.noreply.github.com>
@taegyunkim taegyunkim merged commit d2003cc into main Aug 1, 2024
33 checks passed
@taegyunkim taegyunkim deleted the taegyunkim/prof-10011-arrayqueue branch August 1, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants