Skip to content

feat: Add benchmarking and significantly refactor based on results#66

Open
seanjnkns wants to merge 2 commits intomainfrom
sjenkins/features/benchmarks
Open

feat: Add benchmarking and significantly refactor based on results#66
seanjnkns wants to merge 2 commits intomainfrom
sjenkins/features/benchmarks

Conversation

@seanjnkns
Copy link
Copy Markdown
Contributor

@seanjnkns seanjnkns commented Apr 24, 2026

Add benchmarking tests and README documentation. Numerous significant improvements to code based on iterative runs of the benchmark, refactoring code and adding additional benchmarks, or tests.

Impact:

Benchmark Comparison Results

Benchmark Test Original ns/op New ns/op Δ ns/op Original B/op New B/op Δ B/op Original allocs/op New allocs/op Δ allocs/op
BenchmarkMustGetCurrentMappingState small-8 11,434,218 9,528,867 -16.7% 3,138,058 1,867,982 -40.5% 52,195 37,119 -28.8%
BenchmarkMustGetCurrentMappingState medium-8 30,417,606 26,208,713 -13.8% 12,461,741 7,479,941 -39.9% 208,433 148,203 -28.9%
BenchmarkMustGetCurrentMappingState large-8 120,747,148 90,087,658 -25.4% 50,486,614 30,683,584 -39.2% 833,357 592,516 -28.9%
BenchmarkMustGetCurrentMappingStateLegacyJSON small-8 9,690,610 1,867,926 37,117
BenchmarkMustGetCurrentMappingStateLegacyJSON medium-8 26,129,703 7,479,904 148,201
BenchmarkMustGetCurrentMappingStateLegacyJSON large-8 90,300,395 30,683,529 592,514
BenchmarkCalcPgMappingsToUndoBackfill small-8 16,413,102 13,948,699 -15.0% 3,972,010 2,073,725 -47.8% 65,910 39,882 -39.5%
BenchmarkCalcPgMappingsToUndoBackfill medium-8 47,989,834 34,761,084 -27.5% 15,257,223 8,302,134 -45.6% 263,117 159,162 -39.5%
BenchmarkCalcPgMappingsToUndoBackfill large-8 172,888,991 113,219,697 -34.5% 61,118,536 34,078,135 -44.2% 1,051,888 636,248 -39.5%
BenchmarkCalcPgMappingsToDrainOsd small-8 71,042,975 43,137,217 -39.3% 16,658,772 13,914,102 -16.5% 417,613 39,001 -90.7%
BenchmarkCalcPgMappingsToDrainOsd medium-8 79,123,788 56,851,963 -28.1% 26,106,239 19,740,991 -24.4% 575,945 152,210 -73.6%
BenchmarkCalcPgMappingsToDrainOsd large-8 191,583,932 153,921,553 -19.7% 65,207,584 43,825,932 -32.8% 1,209,341 605,007 -49.9%
BenchmarkCalcPgMappingsToUndoUpmaps small-8 200,001,405 10,639,069 -94.7% 117,088,990 1,990,615 -98.3% 111,408 38,559 -65.4%
BenchmarkCalcPgMappingsToUndoUpmaps medium-8 2,350,508,930 26,820,746 -98.9% 1,813,717,012 7,958,489 -99.6% 560,061 153,851 -72.5%
BenchmarkCalcPgMappingsToUndoUpmaps large-8 24,504,742,986 95,959,828 -99.6% 28,742,183,301 32,625,441 -99.9% 3,945,517 615,004 -84.4%
BenchmarkCalcPgMappingsToBalanceOsds small-8 13,269,599 9,268,311 -30.1% 3,170,515 1,902,283 -40.0% 52,414 37,338 -28.7%
BenchmarkCalcPgMappingsToBalanceOsds medium-8 31,954,823 26,079,697 -18.4% 12,502,672 7,514,257 -39.9% 208,653 148,422 -28.8%
BenchmarkCalcPgMappingsToBalanceOsds large-8 116,185,334 91,074,987 -21.6% 50,521,320 30,717,746 -39.2% 833,576 592,735 -28.9%
BenchmarkImportMappingsLoop small-8 203,225,079 10,602,477 -94.8% 117,297,093 1,992,297 -98.3% 112,989 38,639 -65.8%
BenchmarkImportMappingsLoop medium-8 2,314,901,014 27,110,779 -98.8% 1,813,358,903 7,967,329 -99.6% 566,646 154,231 -72.8%
BenchmarkImportMappingsLoop large-8 24,220,767,435 98,135,411 -99.6% 28,741,009,808 32,663,195 -99.9% 3,972,295 616,584 -84.5%
BenchmarkExportMappings small-8 203,832,152 10,275,006 -95.0% 117,198,357 1,991,624 -98.3% 111,314 38,572 -65.3%
BenchmarkExportMappings medium-8 2,279,265,827 27,300,936 -98.8% 1,813,272,375 7,959,478 -99.6% 559,895 153,864 -72.5%
BenchmarkExportMappings large-8 24,611,868,229 95,992,547 -99.6% 28,742,835,394 32,626,524 -99.9% 3,945,497 615,017 -84.4%
BenchmarkRemapSingle small-8 13,245,572 10,297,120 -22.2% 3,151,222 1,868,113 -40.7% 52,208 37,122 -28.9%
BenchmarkRemapSingle medium-8 31,505,698 26,007,101 -17.5% 12,474,771 7,480,049 -40.0% 208,446 148,206 -28.9%
BenchmarkRemapSingle large-8 115,908,597 90,438,220 -21.9% 50,508,131 30,683,649 -39.2% 833,371 592,519 -28.9%
BenchmarkGenerateCrushChangeMappings small-8 2,580,895 2,927,772 +13.4% 2,073,704 2,073,647 -0.0% 16,438 16,436 -0.0%
BenchmarkGenerateCrushChangeMappings medium-8 10,202,671 10,862,061 +6.5% 8,302,299 8,302,252 -0.0% 65,688 65,686 -0.0%
BenchmarkGenerateCrushChangeMappings large-8 47,727,619 47,607,074 -0.3% 33,206,249 33,206,194 -0.0% 262,682 262,680 -0.0%

@seanjnkns seanjnkns changed the title Sjenkins/features/benchmarks feat: Add benchmarking Apr 24, 2026
@seanjnkns seanjnkns changed the base branch from sjenkins/feature/update-go-mods-with-fix to main April 24, 2026 20:23
@seanjnkns seanjnkns changed the base branch from main to sjenkins/feature/update-go-mods-with-fix April 24, 2026 20:24
@seanjnkns seanjnkns closed this Apr 24, 2026
@seanjnkns seanjnkns reopened this Apr 24, 2026
@seanjnkns seanjnkns changed the title feat: Add benchmarking feat: Add benchmarking and significantly refactor based on results Apr 27, 2026
@seanjnkns seanjnkns changed the base branch from sjenkins/feature/update-go-mods-with-fix to main April 28, 2026 02:14
@seanjnkns seanjnkns marked this pull request as ready for review April 28, 2026 02:15
@seanjnkns seanjnkns force-pushed the sjenkins/features/benchmarks branch 2 times, most recently from 8393d6a to ce457ab Compare April 28, 2026 02:20
@seanjnkns seanjnkns marked this pull request as draft April 28, 2026 21:02
@seanjnkns seanjnkns marked this pull request as ready for review April 28, 2026 21:11
@seanjnkns seanjnkns linked an issue Apr 28, 2026 that may be closed by this pull request
@seanjnkns seanjnkns force-pushed the sjenkins/features/benchmarks branch from ce457ab to ca8d2d9 Compare May 4, 2026 16:35
@seanjnkns seanjnkns force-pushed the sjenkins/features/benchmarks branch from d5719dd to 53f24ae Compare May 5, 2026 15:06
Comment thread backfillstate.go Outdated
Comment thread benchmark_test.go Outdated
Comment thread ceph.go
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.

pgremapper performance limit?

2 participants