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

Perf ignore uuid and timestamp generation for NoopContext #361

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

tsonglew
Copy link
Contributor

Improve the performance of NoopSpan

  • Add a benchmark for the improvement
  • The benchmark result.

Before

----------------------------------------------------------------------------------------- benchmark: 3 tests -----------------------------------------------------------------------------------------
Name (time in ms)              Min                   Max                  Mean             StdDev                Median                 IQR            Outliers      OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_noopspan_1000         16.3042 (1.0)         23.7947 (1.0)         17.9170 (1.0)       1.9692 (1.0)         17.2309 (1.0)        1.0547 (1.0)           7;7  55.8130 (1.0)          39           1
test_noopspan_40000       869.6260 (53.34)      924.5368 (38.85)      901.9029 (50.34)    24.5816 (12.48)      916.3565 (53.18)     40.6119 (38.50)         1;0   1.1088 (0.02)          5           1
test_noopspan_200k      4,691.7849 (287.77)   4,847.9470 (203.74)   4,778.1474 (266.68)   67.2721 (34.16)    4,791.8445 (278.10)   118.2709 (112.13)        2;0   0.2093 (0.00)          5           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After

------------------------------------------------------------------------------------------ benchmark: 3 tests ------------------------------------------------------------------------------------------
Name (time in ms)              Min                   Max                  Mean              StdDev                Median                 IQR            Outliers       OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_noopspan_1000          4.1980 (1.0)         10.8732 (1.0)          5.3377 (1.0)        1.7625 (1.0)          4.5595 (1.0)        0.2741 (1.0)         15;15  187.3464 (1.0)          83           1
test_noopspan_40000       407.3876 (97.04)      415.4321 (38.21)      411.5557 (77.10)      2.9544 (1.68)       411.7374 (90.30)      3.6798 (13.43)         2;0    2.4298 (0.01)          5           1
test_noopspan_200k      2,087.1523 (497.18)   2,446.8792 (225.04)   2,259.6033 (423.33)   139.2377 (79.00)    2,274.1380 (498.77)   206.5788 (753.73)        2;0    0.4426 (0.00)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • Links/URLs to the theory proof or discussion articles/blogs.

It seems that uuid and timestamp are useless for a noop span, since it won't be reported for analysis. So remove them to save cpu and time.

@wu-sheng wu-sheng added this to the 1.2.0 milestone Nov 12, 2024
@wu-sheng wu-sheng added the enhancement New feature or request label Nov 12, 2024
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

Thanks

@kezhenxu94 kezhenxu94 merged commit 7dd9a30 into apache:master Nov 12, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants