Skip to content

Conversation

zhouselena
Copy link
Contributor

GODRIVER-3026

Summary

Use switch instead of reflect to increase efficiency for InsertMany.

Background & Motivation

Copy link
Contributor

API Change Report

No changes found!

Copy link
Contributor

mongodb-drivers-pr-bot bot commented Aug 19, 2025

🧪 Performance Results

Commit SHA: f44f99f

The following benchmark tests for version 68a4be6570184300074e4d3a had statistically significant changes (i.e., |z-score| > 1.96):

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkMultiInsertLargeDocument allocs_per_op 190216.5915 94413.0000 Avg: 49.6084
Med: 50.0000
Stdev: 0.5178
1.0000 182245.4417
BenchmarkMultiInsertLargeDocument total_mem_allocs 119331.5475 2077090.0000 Avg: 1739.1469
Med: 1713.0000
Stdev: 95.4929
1.0000 21733.0301
BenchmarkMultiInsertSmallDocument allocated_bytes_per_op 95.4616 5420.0000 Avg: 2772.9231
Med: 2792.0000
Stdev: 62.8574
0.9876 42.1124
BenchmarkMultiInsertLargeDocument allocated_bytes_per_op 90.2425 53228285.0000 Avg: 27979174.5594
Med: 27920433.0000
Stdev: 656919.1737
0.9858 38.4356
BenchmarkMultiInsertLargeDocument ns_per_op 63.1493 52706198.0000 Avg: 32305494.0000
Med: 32069582.0000
Stdev: 1943833.2923
0.9525 10.4951
BenchmarkMultiInsertSmallDocument ns_per_op 45.8606 9613.0000 Avg: 6590.5405
Med: 6581.5000
Stdev: 153.3645
0.9721 19.7077
BenchmarkMultiInsertSmallDocument total_mem_allocs 39.6344 3164893.0000 Avg: 2266556.5397
Med: 2237722.0000
Stdev: 113017.3801
0.9374 7.9487
BenchmarkMultiInsertSmallDocument total_bytes_allocated 37.3741 612671776.0000 Avg: 445987875.1329
Med: 445380176.0000
Stdev: 13676059.4929
0.9570 12.1880
BenchmarkMultiInsertLargeDocument total_bytes_allocated 24.6786 1171022280.0000 Avg: 939232665.0000
Med: 952990156.0000
Stdev: 48082774.7367
0.9001 4.8206
BenchmarkMultiFindMany total_time_seconds 24.3939 1.3224 Avg: 1.0631
Med: 1.0301
Stdev: 0.0977
0.8407 2.6547
BenchmarkBSONDeepDocumentDecoding ops_per_second_min -18.6908 1607.3708 Avg: 1976.8619
Med: 1985.1235
Stdev: 120.7662
0.8188 -3.0596
BenchmarkSingleRunCommand total_bytes_allocated -12.4565 86532288.0000 Avg: 98844890.4270
Med: 99683088.0000
Stdev: 5079422.7369
0.7969 -2.4240
BenchmarkSingleFindOneByID total_mem_allocs -12.4149 1456249.0000 Avg: 1662668.3862
Med: 1671894.0000
Stdev: 67693.5237
0.8146 -3.0493
BenchmarkSingleRunCommand total_mem_allocs -12.0313 938500.0000 Avg: 1066857.1798
Med: 1077155.0000
Stdev: 54320.8845
0.7913 -2.3629
BenchmarkSingleRunCommand ops_per_second_med -11.7857 6726.8948 Avg: 7625.6258
Med: 7663.1289
Stdev: 297.7930
0.8292 -3.0180
BenchmarkSingleFindOneByID total_bytes_allocated -11.6975 90610696.0000 Avg: 102613970.0741
Med: 103118528.0000
Stdev: 4174203.9270
0.8034 -2.8756
BenchmarkBSONFullDocumentEncoding total_bytes_allocated -11.2986 215087968.0000 Avg: 242485478.8315
Med: 242696304.0000
Stdev: 3700011.4168
0.9241 -7.4047
BenchmarkBSONFullDocumentEncoding total_mem_allocs -11.2119 1243435.0000 Avg: 1400451.6854
Med: 1401964.0000
Stdev: 21551.3194
0.9229 -7.2857
BenchmarkBSONFullDocumentEncoding total_time_seconds -10.9709 1.0633 Avg: 1.1943
Med: 1.1938
Stdev: 0.0082
0.9654 -15.9618
BenchmarkLargeDocInsertOne ops_per_second_med -9.6938 5155.8883 Avg: 5709.3435
Med: 5716.8665
Stdev: 153.0671
0.8536 -3.6158
BenchmarkLargeDocInsertOne total_bytes_allocated -9.2551 32812136.0000 Avg: 36158654.0529
Med: 36253384.0000
Stdev: 994613.0921
0.8417 -3.3646
BenchmarkSingleFindOneByID ops_per_second_med -6.7546 3838.5800 Avg: 4116.6412
Med: 4138.0623
Stdev: 116.0625
0.7851 -2.3958
BenchmarkBSONFullDocumentEncoding allocated_bytes_per_op -0.1045 5197.0000 Avg: 5202.4382
Med: 5202.0000
Stdev: 2.0447
0.7948 -2.6597

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@zhouselena zhouselena closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant