From f1fd2a40b967828bc3240e52ad1a8f0620f29bcd Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 1 Nov 2026 22:38:10 +0800 Subject: [PATCH 1/2] perf(queue): reduce retry and burst allocations - Skip retry log argument allocation when informational logging is disabled - Add optional initial and minimum Ring capacity while preserving defaults - Cover compatibility and capacity boundaries with regression tests - Record reproducible benchmarks and memory tradeoffs --- burst_performance_test.go | 91 ++++++ docs/performance-followup.md | 245 +++++++++++++++ .../2026-11-01/baseline-followup.txt | 120 ++++++++ docs/performance/2026-11-01/baseline.txt | 92 ++++++ .../2026-11-01/combined-followup.txt | 120 ++++++++ docs/performance/2026-11-01/combined.txt | 92 ++++++ docs/performance/2026-11-01/fixtures.json | 282 ++++++++++++++++++ .../2026-11-01/followup-summary.json | 58 ++++ docs/performance/2026-11-01/logging.txt | 92 ++++++ docs/performance/2026-11-01/manifest.json | 156 ++++++++++ docs/performance/2026-11-01/pr-base.txt | 100 +++++++ docs/performance/2026-11-01/pr-compare.py | 41 +++ docs/performance/2026-11-01/pr-head.txt | 100 +++++++ docs/performance/2026-11-01/pr-manifest.json | 84 ++++++ docs/performance/2026-11-01/pr-summary.json | 34 +++ docs/performance/2026-11-01/ring.txt | 92 ++++++ docs/performance/2026-11-01/run.py | 73 +++++ docs/performance/2026-11-01/summarize.py | 34 +++ docs/performance/2026-11-01/summary.json | 66 ++++ logger.go | 18 ++ options.go | 28 +- performance_options_test.go | 133 +++++++++ queue.go | 4 +- ring.go | 25 +- 24 files changed, 2163 insertions(+), 17 deletions(-) create mode 100644 burst_performance_test.go create mode 100644 docs/performance-followup.md create mode 100644 docs/performance/2026-11-01/baseline-followup.txt create mode 100644 docs/performance/2026-11-01/baseline.txt create mode 100644 docs/performance/2026-11-01/combined-followup.txt create mode 100644 docs/performance/2026-11-01/combined.txt create mode 100644 docs/performance/2026-11-01/fixtures.json create mode 100644 docs/performance/2026-11-01/followup-summary.json create mode 100644 docs/performance/2026-11-01/logging.txt create mode 100644 docs/performance/2026-11-01/manifest.json create mode 100644 docs/performance/2026-11-01/pr-base.txt create mode 100644 docs/performance/2026-11-01/pr-compare.py create mode 100644 docs/performance/2026-11-01/pr-head.txt create mode 100644 docs/performance/2026-11-01/pr-manifest.json create mode 100644 docs/performance/2026-11-01/pr-summary.json create mode 100644 docs/performance/2026-11-01/ring.txt create mode 100644 docs/performance/2026-11-01/run.py create mode 100644 docs/performance/2026-11-01/summarize.py create mode 100644 docs/performance/2026-11-01/summary.json create mode 100644 performance_options_test.go diff --git a/burst_performance_test.go b/burst_performance_test.go new file mode 100644 index 0000000..c4e824e --- /dev/null +++ b/burst_performance_test.go @@ -0,0 +1,91 @@ +package queue + +import ( + "context" + "fmt" + "sync" + "testing" + "unsafe" + + "github.com/golang-queue/queue/core" + "github.com/golang-queue/queue/job" +) + +// The comparison harness supplies the same retained-capacity option to each +// variant; on the baseline it is intentionally a no-op (the old policy). +func performanceRingOptions(retained bool) []Option { + if retained { + return []Option{WithQueueMinCapacity(1024)} + } + return nil +} + +// One operation is a full 1024-task burst and drain. Retained bytes count only +// backing-array slots after drain, not RSS or task payloads. +func BenchmarkRingBurstDrain(b *testing.B) { + for _, retained := range []bool{false, true} { + b.Run(fmt.Sprintf("retained=%t", retained), func(b *testing.B) { + w := NewRing(performanceRingOptions(retained)...) + m := job.NewTask(func(context.Context) error { return nil }) + b.ReportAllocs() + b.ResetTimer() + for range b.N { + for range 1024 { + if err := w.Queue(&m); err != nil { + b.Fatal(err) + } + } + for range 1024 { + if _, err := w.Request(); err != nil { + b.Fatal(err) + } + } + } + b.StopTimer() + b.ReportMetric( + float64(len(w.taskQueue))*float64(unsafe.Sizeof(core.TaskMessage(nil))), + "retained-B", + ) + }) + } +} + +// One operation is one publicly submitted, completed task. Fixed batches bound +// the backlog; producer goroutine creation and final Release are included. +func BenchmarkQueueBurstProducers(b *testing.B) { + for _, producers := range []int{1, 4} { + for _, retained := range []bool{false, true} { + b.Run(fmt.Sprintf("producers=%d/retained=%t", producers, retained), func(b *testing.B) { + opts := append(performanceRingOptions(retained), WithLogger(NewEmptyLogger())) + q := NewPool(4, opts...) + var completed sync.WaitGroup + task := func(context.Context) error { completed.Done(); return nil } + b.ReportAllocs() + b.ResetTimer() + for submitted := 0; submitted < b.N; { + n := min(1024, b.N-submitted) + completed.Add(n) + var senders sync.WaitGroup + for p := range producers { + senders.Go(func() { + for i := p; i < n; i += producers { + if err := q.QueueTask(task); err != nil { + b.Error(err) + completed.Done() + } + } + }) + } + senders.Wait() + completed.Wait() + submitted += n + } + q.Release() + b.StopTimer() + if got := q.SuccessTasks(); got != uint64(b.N) { + b.Fatalf("got %d completed, want %d", got, b.N) + } + }) + } + } +} diff --git a/docs/performance-followup.md b/docs/performance-followup.md new file mode 100644 index 0000000..282a7b7 --- /dev/null +++ b/docs/performance-followup.md @@ -0,0 +1,245 @@ +# 第二輪 Queue 效能改善報告 + +**Version note: the earlier sections preserve the working-tree experiment. See the final PR supplement for clean master versus the actual PR.** + +日期:2026-11-01。環境:Apple M4 Pro、darwin/arm64、go version go1.26.10 darwin/arm64、`-cpu=12`。 + +## 結果與適用範圍 + +完成兩項修改:停用重試資訊日誌時略過參數配置,以及可選的 Ring 初始/最低保留容量。 +預設縮容策略、任務容量限制、FIFO、timeout、retry 次數與 shutdown 排程維持原行為。 + +- 空 logger、重試 10 次:配置 **21 → 11 次**,**1,144 → 824 B/op**;時間中位數減少 **8.3%**。 +- 每批 1,024 筆的 Ring 填滿/清空,啟用保留 1,024 格:穩態配置 **18 → 0 次/批**,時間減少 **29.2%**,換算吞吐量增加 **41.3%**。 +- 多 producer 的端到端情境:啟用保留容量後每筆配置位元組約減少 **7.4–7.6%**;本次沒有證明端到端吞吐提升。 +- 成本:Ring 清空後的 backing-array 槽位從 **32 B 增至 16,384 B**。這不是 RSS;已出列的 task 引用仍清空。 + +數字取四輪樣本中位數;時間百分比不是統計顯著性宣告,不適用於任意業務工作負載。 + +## 版本定義 + +基準為 `adf9a1cf9bd0424c9c1286754083bd6038c985df` 加上開始實作時已有的工作目錄修改,保存於 +[fixtures.json / baseline](performance/2026-11-01/fixtures.json)。 +這些既有修改只作為量測 fixture 保存,**不包含在本 PR 的產品程式修改中**。 +本 PR 不包含 retry timer 重用與 Jitter 修正,因此此報告的絕對值是當時工作目錄比較, +不是乾淨 master 與 PR head 的直接比較;兩項優化的差異以固定 fixture 隔離。 + +這些既有修改涵蓋 `queue.go`、`handle_result_test.go`、`job/job.go`、`job/job_test.go`,四個版本皆包含。 +因此不能把此報告當成該 commit 的乾淨版本與最終工作目錄直接比較。 + +| 版本 | 修改 | +| --- | --- | +| baseline | 實作前工作目錄 | +| logging | 僅增加可選 InfoEnabled 與重試呼叫端檢查 | +| ring | 僅增加 WithQueueMinCapacity 與 Ring 保留容量 | +| combined | 兩項合併 | + +所有版本使用相同 benchmark。baseline/logging 沒有新 Ring API,僅在測試中提供 no-op +`WithQueueMinCapacity` adapter,讓 `retained=true` 標籤跑相同工作負載下的舊縮容策略。 +這個 adapter 不修改舊版 Ring 行為;原版 `retained=true` 實際仍只保留 2 格。 + +## 1. 重試日誌 + +[logger.go](../logger.go) 新增可選介面 `InfoLogger`(含 `InfoEnabled() bool`);既有 `Logger` +介面不變,未提供方法的 logger 繼續輸出重試日誌。`NewEmptyLogger()` 回報 false。 +[queue.go](../queue.go) 在每次重試記錄之前檢查,避免建立 `...any` 參數;允許執行期間切換設定, +不把結果快取在建構時。自訂 logger 必須讓方法可安全併發呼叫。 +這個檢查目前用於重試資訊日誌,不抑制錯誤/panic 日誌。 + +每次操作為一個完整 handler 執行;retry delay 為 1ns,以凸顯框架成本,並非真實網路重試延遲。 + +| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| 重試 0 次 | 763.85 | 752.55 | -1.5% | +1.5% | 576 → 576 | 8 → 8 | +| 重試 1 次 | 1,088.00 | 1,054.00 | -3.1% | +3.2% | 856 → 824 | 12 → 11 | +| 重試 3 次 | 2,044.00 | 1,937.00 | -5.2% | +5.5% | 920 → 824 | 14 → 11 | +| 重試 10 次 | 4,355.00 | 3,995.50 | -8.3% | +9.0% | 1144 → 824 | 21 → 11 | + +## 2. Ring 保留容量 + +[options.go](../options.go) 新增 `WithQueueMinCapacity(n)`,只對內建 Ring 有效: + +- 設定初始配置與縮容下限;小於 2 時用 2,預設仍為 2。 +- 有正數 `WithQueueSize` 上限時取較小值,但至少保留 2 格;待處理任務上限仍獨立遵守。 +- 支援非 2 的次方,選項先後順序不影響容量上限。 +- 超過最低容量時仍可擴容;使用量降至 25% 時減半,但不低於設定下限。 + +```go +q := queue.NewPool(4, + queue.WithLogger(queue.NewEmptyLogger()), + queue.WithQueueMinCapacity(1024), +) +defer q.Release() +``` + +此例預先配置 16 KiB 的 Ring 槽位空間(本機每個 interface 槽位 16 B);無 backlog 時仍保留。 +未設定 `WithQueueSize` 時,這不會把佇列限制為 1,024 筆。 + +以下每次操作為 **1,024 次入列+1,024 次出列**;不是單筆任務執行時間。 +預配置位於 ResetTimer 之前,表中的 0 B/op 不包含建構時配置。 + +| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| 預設容量策略 | 14,202.50 | 14,164.00 | -0.3% | +0.3% | 55968 → 55968 | 18 → 18 | +| 保留 1,024 格 | 14,235.50 | 10,072.50 | -29.2% | +41.3% | 55968 → 0 | 18 → 0 | + +## 3. 端到端:含公開提交、handler 完成與 Release + +每批最多 1,024 筆,使用空任務與空 logger。多 producer 情境固定 4 workers, +計入 producer goroutine 建立成本。入列失敗會使 benchmark 失敗,結尾確認成功數量。 +每筆平均成本包含排程與同步;不是排隊時間、單筆 latency 或 p99。 + +| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| 1 producer,預設容量 | 1,389.00 | 1,408.00 | +1.4% | -1.3% | 727 → 727 | 9 → 9 | +| 1 producer,保留 1,024 格 | 1,388.50 | 1,394.50 | +0.4% | -0.4% | 726 → 672 | 9 → 9 | +| 4 producer,預設容量 | 1,466.50 | 1,575.50 | +7.4% | -6.9% | 727 → 727 | 9 → 9 | +| 4 producer,保留 1,024 格 | 1,470.00 | 1,489.00 | +1.3% | -1.3% | 727 → 672 | 9 → 9 | + +以下為既有端到端 benchmark,全部維持預設容量: + +| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| 1 workers | 1,176.50 | 1,170.00 | -0.6% | +0.6% | 726 → 726 | 9 → 9 | +| 4 workers | 1,364.50 | 1,441.50 | +5.6% | -5.3% | 726 → 726 | 9 → 9 | +| 12 workers | 1,872.50 | 1,929.00 | +3.0% | -2.9% | 726 → 726 | 9 → 9 | +| 4 workers+afterFn | 1,411.00 | 1,403.50 | -0.5% | +0.5% | 766 → 766 | 11 → 11 | + +保留容量減少的是 Ring backing-array 的配置位元組;Message、context、handler goroutine 等仍存在。 +攤提後的 `allocs/op` 為整數,因此端到端仍顯示 9,不能解讀成完全沒有減少 Ring 配置。 +首輪系列中有些端到端情境變慢,以下保留所有結果及樣本範圍,不將其略去或宣稱沒有退步。 + +## 預設路徑的延長複測 + +初始四輪出現 4-worker 及 4-producer 預設情境變慢,因此另以每個情境 **1 秒、6 個樣本**, +baseline/combined 交替先後執行;兩個測試分開啟動。結果不與先前 300ms 樣本混算。 + +| 情境 | baseline 中位數(範圍)ns/task | combined 中位數(範圍)ns/task | 時間變化 | +| --- | ---: | ---: | ---: | +| 4 workers,單 producer,預設容量 | 1,327.5(1,265–1,427) | 1,374(1,285–1,402) | +3.5% | +| 4 workers,4 producers,預設容量 | 1,420.5(1,358–1,471) | 1,421(1,326–1,544) | +0.04% | + +4-producer 情境未重現先前 +7.4% 的差距;4-worker 仍有 +3.5% 的中位數差異。 +兩者樣本範圍皆重疊,沒有足夠證據判定穩定退步,也不能保證效能等效。 +因此本次主張限於重試日誌與 burst 配置改善,不宣稱預設路徑加速; +若部署主要是極短任務且關注幾個百分點的吞吐差異,應在目標環境進一步確認此項風險。 + +原始結果:[baseline 複測](performance/2026-11-01/baseline-followup.txt)、 +[combined 複測](performance/2026-11-01/combined-followup.txt)、 +[複測摘要](performance/2026-11-01/followup-summary.json)。重現: + +```sh +rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-performance-followup-rerun --followup +``` + +## 個別修改的貢獻 + +| 情境(ns/op 中位數) | baseline | logging | ring | combined | +| --- | ---: | ---: | ---: | ---: | +| 重試10次 | 4,355.00 | 4,020.00 | 4,326.50 | 3,995.50 | +| Ring burst,保留1024格 | 14,235.50 | 14,264.00 | 10,067.00 | 10,072.50 | +| 4 producers,保留1024格 | 1,470.00 | 1,440.00 | 1,511.50 | 1,489.00 | + +## 樣本範圍與限制 + +| 情境 | baseline ns/op 範圍 | combined ns/op 範圍 | +| --- | ---: | ---: | +| `RingBurstDrain/retained=false` | 13948–14337 | 14019–14193 | +| `RingBurstDrain/retained=true` | 14098–14584 | 10064–10081 | +| `QueueBurstProducers/producers=1/retained=false` | 1345–1614 | 1374–1544 | +| `QueueBurstProducers/producers=1/retained=true` | 1269–1555 | 1315–1584 | +| `QueueBurstProducers/producers=4/retained=false` | 1432–1619 | 1459–1683 | +| `QueueBurstProducers/producers=4/retained=true` | 1461–1721 | 1316–1682 | +| `HandleRetry/retries=0` | 754.6–805.4 | 726.7–786.7 | +| `HandleRetry/retries=1` | 1068–1139 | 1023–1093 | +| `HandleRetry/retries=3` | 2034–2121 | 1867–1956 | +| `HandleRetry/retries=10` | 4303–4414 | 3913–4019 | +| `QueueEndToEnd/workers=1` | 1128–1209 | 1118–1202 | +| `QueueEndToEnd/workers=4` | 1230–1400 | 1371–1508 | +| `QueueEndToEnd/workers=12` | 1867–1894 | 1803–1957 | +| `QueueAfterFnEndToEnd` | 1343–1481 | 1327–1546 | + +僅四個樣本,不提供顯著性或跨機器保證;重疊範圍也不能證明兩者等效。 +本次未量測 RSS、p95/p99、真實 I/O 任務、外部 broker 或長期 soak。 +保留容量是否值得,應依實際 burst 規模與同時存在的 Queue 數量選擇;1,024 只是本次測量值。 + +## 驗證與重現 + +- 修改前、修改後 `rtk proxy go test -race ./...` 均通過(含既有 goleak 檢查)。 +- 新增測試涵蓋:舊 logger 相容性、資訊日誌啟用/停用/動態切換、重試次數、非 2 次方容量、 + FIFO 跨 wrap/resize、多次 burst、空槽釋放引用、容量拒絕、shutdown 拒絕及 NewPool 選項傳遞。 +- `golangci-lint run` 尚有 **1 個既有問題**:`job/job_test.go:47` 的 `Bool(enabled)` 被 modernize 建議改為 `new(enabled)`。 + 該檔與基準 snapshot 相同,本次沒有更動;本次新增/修改部分無其餘 lint 問題。不宣稱全套 lint 通過。 +- 此為 CORE CODE:影響共享 queue、public options 與日誌擴充契約;失敗會影響所有使用者。 + 需由維護者逐行審查,正式合併建議包含 module owner 的兩位 reviewer;PR 交付狀態與乾淨分支驗證另見下方 PR 補充。 + +每個情境 300ms、每版本四個樣本、`-cpu=12`、不使用 race instrumentation 量測效能。 +輪序:baseline → logging → ring → combined;反序;ring → baseline → combined → logging; +logging → combined → baseline → ring。版本序列執行,benchmark 期間沒有同時跑 Go tests 或 lint。 + +重建四版本並量測(輸出目錄必須不存在): + +```sh +rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-performance-rerun +rtk proxy python3 docs/performance/2026-11-01/summarize.py /tmp/queue-performance-rerun +``` + +重現腳本從基準 commit 加上當時 diff 還原版本,套用 [fixtures.json / implementation](performance/2026-11-01/fixtures.json) 與相同 benchmark, +並核對 SHA256;已執行 `--prepare-only` 驗證四個版本均可完整重建且 hash 一致。 +量測實作由 fixture patch 保存,不依賴目前 queue.go 是否包含其他本機修改;benchmark 檔案仍須符合 hash。 + +- 原始數據:[baseline](performance/2026-11-01/baseline.txt)、[logging](performance/2026-11-01/logging.txt)、[ring](performance/2026-11-01/ring.txt)、[combined](performance/2026-11-01/combined.txt)。 +- [四輪摘要與完整樣本 JSON](performance/2026-11-01/summary.json)、[版本與檔案 SHA256](performance/2026-11-01/manifest.json)。 +- [重現腳本](performance/2026-11-01/run.py)、[彙整腳本](performance/2026-11-01/summarize.py)。 + +回復本次修改時,只移除 InfoLogger/重試檢查及最低容量選項相關差異; +不要還原整份 queue.go,以免覆蓋開始前既有的使用者修改。 + +## PR supplement: clean master versus the actual PR + +The PR branch `perf/queue-allocation-costs` includes only logging checks, Ring retention, tests and evidence. +This comparison uses clean `adf9a1c` versus the actual PR implementation, excluding the pre-existing local +retry-timer reuse and Jitter fixes. It is separate from the historical working-tree comparison above. + +Same machine, 300ms per case, two rounds of three samples each (six samples per version). +Order: base then head; head then base. Runs were sequential, without concurrent Go tests or lint. +The base uses a test-only no-op retention adapter, retaining the original resizing policy. + +| Scenario | base ns/op median (range) | PR ns/op median (range) | Time change | B/op before -> after | allocs/op before -> after | +| --- | ---: | ---: | ---: | ---: | ---: | +| `RingBurstDrain/retained=false` | 14293 (14050-14449) | 14329 (13951-14447) | +0.3% | 55968 -> 55968 | 18 -> 18 | +| `RingBurstDrain/retained=true` | 14229 (13945-14566) | 10170 (10080-10326) | -28.5% | 55968 -> 0 | 18 -> 0 | +| `QueueBurstProducers/producers=1/retained=false` | 1357.5 (1298-1452) | 1385 (1333-1458) | +2.0% | 726 -> 726 | 9 -> 9 | +| `QueueBurstProducers/producers=1/retained=true` | 1360.5 (1272-1460) | 1408 (1327-1434) | +3.5% | 726 -> 672 | 9 -> 9 | +| `QueueBurstProducers/producers=4/retained=false` | 1412 (1369-1535) | 1452.5 (1377-1536) | +2.9% | 727 -> 727 | 9 -> 9 | +| `QueueBurstProducers/producers=4/retained=true` | 1482.5 (1397-1561) | 1446.5 (1321-1549) | -2.4% | 727 -> 672 | 9 -> 9 | +| `HandleRetry/retries=0` | 753.15 (734.3-796.5) | 769 (747.9-800.7) | +2.1% | 576 -> 576 | 8 -> 8 | +| `HandleRetry/retries=1` | 1081.5 (1028-1137) | 1040.5 (1020-1064) | -3.8% | 856 -> 824 | 12 -> 11 | +| `HandleRetry/retries=3` | 1704.5 (1613-1785) | 1619 (1609-1680) | -5.0% | 1416 -> 1320 | 20 -> 17 | +| `HandleRetry/retries=10` | 3705 (3519-3881) | 3471.5 (3414-3552) | -6.3% | 3376 -> 3056 | 48 -> 38 | +| `QueueEndToEnd/workers=1` | 1196.5 (1131-1212) | 1157 (1132-1191) | -3.3% | 726 -> 726 | 9 -> 9 | +| `QueueEndToEnd/workers=4` | 1412.5 (1297-1506) | 1371.5 (1273-1450) | -2.9% | 726 -> 726 | 9 -> 9 | +| `QueueEndToEnd/workers=12` | 1859.5 (1718-2086) | 1863 (1776-1901) | +0.2% | 726 -> 726 | 9 -> 9 | +| `QueueAfterFnEndToEnd` | 1458 (1281-1717) | 1347 (1325-1369) | -7.6% | 766 -> 766 | 11 -> 11 | + +The evidence supports lower allocation costs, not a general end-to-end throughput improvement. +Default-capacity timings vary; neither acceleration nor equivalence is guaranteed by these medians. +Ring burst units are per 1,024-task batch; other cases are per task. Initial preallocation is excluded +from timing, while idle backing storage still increases from 32 B to 16 KiB when retention is enabled. + +Isolated PR validation: `go test -race ./...` passed; `go tool -modfile=go.tools.mod golangci-lint run` +reported **0 issues**; `git diff --check` passed. The historical lint warning above is not part of this PR. +The historical reproduction script also passed `--prepare-only` from the isolated worktree, +matching all four source manifests. + +```sh +rtk proxy python3 docs/performance/2026-11-01/pr-compare.py /tmp/queue-pr-comparison +``` + +The destination must not exist. The script extracts the clean base twice and overlays the PR's four +production files on the head variant, using identical benchmarks. It writes source hashes; compare +those against this report when reproducing from a later source version. + +- [PR base raw samples](performance/2026-11-01/pr-base.txt), [PR head raw samples](performance/2026-11-01/pr-head.txt). +- [PR summary](performance/2026-11-01/pr-summary.json), [PR source hashes](performance/2026-11-01/pr-manifest.json). +- [PR comparison script](performance/2026-11-01/pr-compare.py). diff --git a/docs/performance/2026-11-01/baseline-followup.txt b/docs/performance/2026-11-01/baseline-followup.txt new file mode 100644 index 0000000..7d07ef2 --- /dev/null +++ b/docs/performance/2026-11-01/baseline-followup.txt @@ -0,0 +1,120 @@ + +# Round 1, 2026-11-01T22:24:33.396558 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 761044 1363 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.215s + +# Round 1, 2026-11-01T22:24:34.837088 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 847994 1412 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.287s + +# Round 2, 2026-11-01T22:24:47.207597 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 870998 1304 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.328s + +# Round 2, 2026-11-01T22:24:48.748672 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 819793 1471 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.321s + +# Round 3, 2026-11-01T22:24:51.288601 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 760422 1351 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.227s + +# Round 3, 2026-11-01T22:24:52.735962 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 852685 1457 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.277s + +# Round 4, 2026-11-01T22:25:05.451919 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 856459 1427 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.340s + +# Round 4, 2026-11-01T22:25:08.004882 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 739393 1423 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.253s + +# Round 5, 2026-11-01T22:25:09.475491 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 929649 1265 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.269s + +# Round 5, 2026-11-01T22:25:11.957250 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 870865 1358 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.238s + +# Round 6, 2026-11-01T22:25:23.457914 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 918351 1297 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.370s + +# Round 6, 2026-11-01T22:25:26.037799 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 807738 1418 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.322s diff --git a/docs/performance/2026-11-01/baseline.txt b/docs/performance/2026-11-01/baseline.txt new file mode 100644 index 0000000..5fe4cf6 --- /dev/null +++ b/docs/performance/2026-11-01/baseline.txt @@ -0,0 +1,92 @@ + +# Round 1, 2026-11-01T22:22:23.925519 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 25048 13948 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25682 14098 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 249775 1405 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 278534 1448 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 256404 1501 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 241042 1461 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 447306 805.4 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 307040 1139 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 171444 2121 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 76837 4414 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 295167 1209 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 239550 1357 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 187909 1876 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 247680 1481 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.890s + +# Round 2, 2026-11-01T22:23:06.709635 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24146 14319 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25065 14584 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 203686 1614 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 228826 1555 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 224498 1619 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 249516 1462 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 467152 768.0 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 323049 1087 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 176463 2049 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 83122 4355 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 300956 1169 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 242416 1400 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 199616 1867 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 266316 1396 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.693s + +# Round 3, 2026-11-01T22:23:18.629265 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24349 14337 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 24834 14280 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 275296 1373 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 278055 1269 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 265736 1432 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 274352 1478 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 471948 759.7 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 320318 1089 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 179661 2034 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 82770 4303 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 307252 1184 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 254511 1372 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 185187 1869 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 282591 1426 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.793s + +# Round 4, 2026-11-01T22:23:48.779074 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24417 14086 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25503 14191 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 297747 1345 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 304888 1329 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 262864 1432 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 260905 1721 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 495412 754.6 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 309838 1068 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 167715 2039 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 81021 4355 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 316011 1128 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 295464 1230 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 203437 1894 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 256291 1343 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.861s diff --git a/docs/performance/2026-11-01/combined-followup.txt b/docs/performance/2026-11-01/combined-followup.txt new file mode 100644 index 0000000..c67213e --- /dev/null +++ b/docs/performance/2026-11-01/combined-followup.txt @@ -0,0 +1,120 @@ + +# Round 1, 2026-11-01T22:24:37.343443 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 934442 1285 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.240s + +# Round 1, 2026-11-01T22:24:39.796123 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 849093 1410 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.263s + +# Round 2, 2026-11-01T22:24:42.277860 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 865383 1389 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.216s + +# Round 2, 2026-11-01T22:24:44.712534 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 857128 1428 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.279s + +# Round 3, 2026-11-01T22:24:55.230697 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 913377 1359 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.303s + +# Round 3, 2026-11-01T22:24:57.745381 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 896079 1326 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.265s + +# Round 4, 2026-11-01T22:25:00.234877 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 921465 1402 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.400s + +# Round 4, 2026-11-01T22:25:02.852699 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 848329 1428 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.382s + +# Round 5, 2026-11-01T22:25:14.409187 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 916866 1309 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.295s + +# Round 5, 2026-11-01T22:25:16.914861 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 823438 1414 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.276s + +# Round 6, 2026-11-01T22:25:19.406111 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueEndToEnd/workers=4-12 895750 1394 ns/op 726 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 2.275s + +# Round 6, 2026-11-01T22:25:21.890951 +# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkQueueBurstProducers/producers=4/retained=false-12 762250 1544 ns/op 727 B/op 9 allocs/op +PASS +ok github.com/golang-queue/queue 1.357s diff --git a/docs/performance/2026-11-01/combined.txt b/docs/performance/2026-11-01/combined.txt new file mode 100644 index 0000000..f7ef625 --- /dev/null +++ b/docs/performance/2026-11-01/combined.txt @@ -0,0 +1,92 @@ + +# Round 1, 2026-11-01T22:22:42.666787 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 23170 14193 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35430 10074 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 254922 1544 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 260074 1468 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 249034 1481 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 234189 1496 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 436939 765.3 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 340999 1062 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 185266 1949 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 87391 4007 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 297313 1200 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 254032 1508 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 202423 1917 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 245788 1546 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.936s + +# Round 2, 2026-11-01T22:22:48.934194 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 25156 14019 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35642 10064 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 248974 1418 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 257126 1315 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 235455 1459 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 264558 1482 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 441595 786.7 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 327553 1093 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 183444 1956 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 89738 4019 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 299319 1202 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 279015 1502 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 198405 1957 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 249853 1455 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.723s + +# Round 3, 2026-11-01T22:23:24.635688 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24751 14145 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35778 10071 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 241813 1398 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 236890 1584 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 223633 1670 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 242611 1682 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 496485 739.8 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 345160 1046 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 179949 1925 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 90358 3984 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 321780 1140 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 266468 1381 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 206379 1941 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 275280 1327 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.770s + +# Round 4, 2026-11-01T22:23:42.795291 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24978 14183 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35652 10081 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 298627 1374 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 277252 1321 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 283987 1683 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 239220 1316 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 489903 726.7 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 348201 1023 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 188937 1867 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 91676 3913 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 320838 1118 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 298851 1371 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 177133 1803 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 270514 1352 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.767s diff --git a/docs/performance/2026-11-01/fixtures.json b/docs/performance/2026-11-01/fixtures.json new file mode 100644 index 0000000..adc32de --- /dev/null +++ b/docs/performance/2026-11-01/fixtures.json @@ -0,0 +1,282 @@ +{ + "baseline": [ + "diff --git a/handle_result_test.go b/handle_result_test.go\n", + "index 505bb41..0173337 100644\n", + "--- a/handle_result_test.go\n", + "+++ b/handle_result_test.go\n", + "@@ -4,6 +4,7 @@ import (\n", + " \t\"context\"\n", + " \t\"errors\"\n", + " \t\"testing\"\n", + "+\t\"testing/synctest\"\n", + " \t\"time\"\n", + " \n", + " \t\"github.com/golang-queue/queue/job\"\n", + "@@ -121,3 +122,38 @@ func TestResultProtocolRepeatedRetries(t *testing.T) {\n", + " \t\trequire.Equal(t, 11, attempts)\n", + " \t}\n", + " }\n", + "+\n", + "+// Virtual time verifies that resetting the timer preserves every retry delay.\n", + "+func TestRetryTimerDelays(t *testing.T) {\n", + "+\tfor _, fixed := range []bool{false, true} {\n", + "+\t\tt.Run(map[bool]string{false: \"backoff\", true: \"fixed\"}[fixed], func(t *testing.T) {\n", + "+\t\t\tsynctest.Test(t, func(t *testing.T) {\n", + "+\t\t\t\tq, err := NewQueue(WithWorker(NewRing()), WithLogger(NewEmptyLogger()))\n", + "+\t\t\t\trequire.NoError(t, err)\n", + "+\t\t\t\tt.Cleanup(q.Release)\n", + "+\t\t\t\tvar attempts int\n", + "+\t\t\t\topts := job.AllowOption{\n", + "+\t\t\t\t\tRetryCount: job.Int64(3),\n", + "+\t\t\t\t\tRetryMin: job.Time(10 * time.Millisecond),\n", + "+\t\t\t\t\tRetryMax: job.Time(time.Second),\n", + "+\t\t\t\t}\n", + "+\t\t\t\twant := 70 * time.Millisecond // 10 + 20 + 40\n", + "+\t\t\t\tif fixed {\n", + "+\t\t\t\t\topts.RetryDelay = job.Time(10 * time.Millisecond)\n", + "+\t\t\t\t\twant = 30 * time.Millisecond\n", + "+\t\t\t\t}\n", + "+\t\t\t\tm := job.NewTask(func(context.Context) error {\n", + "+\t\t\t\t\tattempts++\n", + "+\t\t\t\t\tif attempts < 4 {\n", + "+\t\t\t\t\t\treturn errors.New(\"retry\")\n", + "+\t\t\t\t\t}\n", + "+\t\t\t\t\treturn nil\n", + "+\t\t\t\t}, opts)\n", + "+\t\t\t\tstart := time.Now()\n", + "+\t\t\t\trequire.NoError(t, q.handle(&m))\n", + "+\t\t\t\trequire.Equal(t, 4, attempts)\n", + "+\t\t\t\trequire.Equal(t, want, time.Since(start))\n", + "+\t\t\t})\n", + "+\t\t})\n", + "+\t}\n", + "+}\n", + "diff --git a/job/job.go b/job/job.go\n", + "index 17246f4..b714882 100644\n", + "--- a/job/job.go\n", + "+++ b/job/job.go\n", + "@@ -84,6 +84,7 @@ func NewMessage(m core.QueuedMessage, opts ...AllowOption) Message {\n", + " \t\tRetryFactor: o.retryFactor,\n", + " \t\tRetryMin: o.retryMin,\n", + " \t\tRetryMax: o.retryMax,\n", + "+\t\tJitter: o.jitter,\n", + " \t\tTimeout: o.timeout,\n", + " \t\tBody: m.Bytes(),\n", + " \t}\n", + "@@ -99,6 +100,7 @@ func NewTask(task TaskFunc, opts ...AllowOption) Message {\n", + " \t\tRetryFactor: o.retryFactor,\n", + " \t\tRetryMin: o.retryMin,\n", + " \t\tRetryMax: o.retryMax,\n", + "+\t\tJitter: o.jitter,\n", + " \t\tTask: task,\n", + " \t}\n", + " }\n", + "diff --git a/job/job_test.go b/job/job_test.go\n", + "index c9aa133..f6dd482 100644\n", + "--- a/job/job_test.go\n", + "+++ b/job/job_test.go\n", + "@@ -1,6 +1,7 @@\n", + " package job\n", + " \n", + " import (\n", + "+\t\"context\"\n", + " \t\"testing\"\n", + " \t\"time\"\n", + " \n", + "@@ -40,3 +41,14 @@ func TestMessageEncodeDecode(t *testing.T) {\n", + " \tassert.Equal(t, 20*time.Second, out.RetryMax)\n", + " \tassert.InEpsilon(t, 4.0, out.RetryFactor, 1e-9)\n", + " }\n", + "+\n", + "+func TestConstructorsPreserveJitter(t *testing.T) {\n", + "+\tfor _, enabled := range []bool{false, true} {\n", + "+\t\topts := AllowOption{Jitter: Bool(enabled)}\n", + "+\t\tmessage := NewMessage(mockMessage{message: \"foo\"}, opts)\n", + "+\t\ttask := NewTask(func(context.Context) error { return nil }, opts)\n", + "+\t\tassert.Equal(t, enabled, message.Jitter)\n", + "+\t\tassert.Equal(t, enabled, task.Jitter)\n", + "+\t\tassert.Equal(t, enabled, Decode(message.Bytes()).Jitter)\n", + "+\t}\n", + "+}\n", + "diff --git a/queue.go b/queue.go\n", + "index 1c2ae74..2d38820 100644\n", + "--- a/queue.go\n", + "+++ b/queue.go\n", + "@@ -239,8 +239,12 @@ func (q *Queue) handle(m *job.Message) error {\n", + " \n", + " \t// Run the job in a separate goroutine to support timeout and panic recovery.\n", + " \tgo func() {\n", + "+\t\tvar retryTimer *time.Timer\n", + " \t\t// Forward panic through the same result channel.\n", + " \t\tdefer func() {\n", + "+\t\t\tif retryTimer != nil {\n", + "+\t\t\t\tretryTimer.Stop()\n", + "+\t\t\t}\n", + " \t\t\tif p := recover(); p != nil {\n", + " \t\t\t\tdone <- result{panicValue: p}\n", + " \t\t\t}\n", + "@@ -276,8 +280,15 @@ func (q *Queue) handle(m *job.Message) error {\n", + " \t\t\t\tdelay = b.Duration()\n", + " \t\t\t}\n", + " \n", + "+\t\t\t// Allocate only on the first retry and reuse after consuming each tick.\n", + "+\t\t\tif retryTimer == nil {\n", + "+\t\t\t\tretryTimer = time.NewTimer(delay)\n", + "+\t\t\t} else {\n", + "+\t\t\t\tretryTimer.Reset(delay)\n", + "+\t\t\t}\n", + "+\n", + " \t\t\tselect {\n", + "-\t\t\tcase <-time.After(delay): // Wait before retrying\n", + "+\t\t\tcase <-retryTimer.C: // Wait before retrying\n", + " \t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", + " \t\t\tcase <-ctx.Done(): // Timeout reached\n", + " \t\t\t\terr = ctx.Err()\n" + ], + "implementation": [ + "--- a/queue.go\n", + "+++ b/queue.go\n", + "@@ -289,7 +289,9 @@\n", + " \n", + " \t\t\tselect {\n", + " \t\t\tcase <-retryTimer.C: // Wait before retrying\n", + "-\t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", + "+\t\t\t\tif infoEnabled(q.logger) {\n", + "+\t\t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", + "+\t\t\t\t}\n", + " \t\t\tcase <-ctx.Done(): // Timeout reached\n", + " \t\t\t\terr = ctx.Err()\n", + " \t\t\t\tbreak loop\n", + "--- a/logger.go\n", + "+++ b/logger.go\n", + "@@ -33,6 +33,21 @@\n", + " \t// Fatal logs fatal errors with stack trace information.\n", + " \t// Used for panics and critical failures.\n", + " \tFatal(args ...any)\n", + "+}\n", + "+\n", + "+// InfoLogger optionally lets a Logger disable informational messages before the\n", + "+// queue constructs variadic arguments. Loggers without it remain enabled.\n", + "+// InfoEnabled must be safe to call concurrently; it is checked on every retry.\n", + "+type InfoLogger interface {\n", + "+\tLogger\n", + "+\tInfoEnabled() bool\n", + "+}\n", + "+\n", + "+func infoEnabled(l Logger) bool {\n", + "+\tif l, ok := l.(InfoLogger); ok {\n", + "+\t\treturn l.InfoEnabled()\n", + "+\t}\n", + "+\treturn true\n", + " }\n", + " \n", + " // NewLogger creates a standard logger that writes to stderr with timestamps.\n", + "@@ -127,3 +142,6 @@\n", + " func (l emptyLogger) Info(args ...any) {}\n", + " func (l emptyLogger) Error(args ...any) {}\n", + " func (l emptyLogger) Fatal(args ...any) {}\n", + "+\n", + "+// InfoEnabled disables informational argument construction for the no-op logger.\n", + "+func (l emptyLogger) InfoEnabled() bool { return false }\n", + "--- a/ring.go\n", + "+++ b/ring.go\n", + "@@ -21,6 +21,7 @@\n", + " // - When head == tail, the queue is empty\n", + " // - Both pointers wrap around using modulo arithmetic\n", + " type Ring struct {\n", + "+\tminCapacity int // Minimum retained slots, configured at construction\n", + " \tsync.Mutex\n", + " \ttaskQueue []core.TaskMessage // Circular buffer storing queued tasks\n", + " \trunFunc func(context.Context, core.TaskMessage) error // Function to execute when processing tasks\n", + "@@ -131,8 +132,11 @@\n", + " \n", + " \t// Shrink buffer if at most 25% full (to save memory)\n", + " \t// Minimum buffer size is 2 to maintain circular buffer structure\n", + "-\tif n := len(s.taskQueue) / 2; n >= 2 && s.count <= len(s.taskQueue)/4 {\n", + "-\t\ts.resize(n)\n", + "+\tif n := len(\n", + "+\t\ts.taskQueue,\n", + "+\t) / 2; len(s.taskQueue) > s.minCapacity &&\n", + "+\t\ts.count <= len(s.taskQueue)/4 {\n", + "+\t\ts.resize(max(n, s.minCapacity))\n", + " \t}\n", + " \n", + " \treturn data, nil\n", + "@@ -179,7 +183,7 @@\n", + " }\n", + " \n", + " // NewRing creates a new Ring instance with the provided options.\n", + "-// It initializes the task queue with a default size of 2, sets the capacity\n", + "+// It initializes the task queue with at least 2 slots (or WithQueueMinCapacity), sets the capacity\n", + " // based on the provided options, and configures the logger and run function.\n", + " // The function returns a pointer to the newly created Ring instance.\n", + " //\n", + "@@ -192,12 +196,17 @@\n", + " //\t*Ring - A pointer to the newly created Ring instance.\n", + " func NewRing(opts ...Option) *Ring {\n", + " \to := NewOptions(opts...)\n", + "+\tminCapacity := max(2, o.queueMinCapacity)\n", + "+\tif o.queueSize > 0 {\n", + "+\t\tminCapacity = max(2, min(minCapacity, o.queueSize))\n", + "+\t}\n", + " \tw := &Ring{\n", + "-\t\ttaskQueue: make([]core.TaskMessage, 2),\n", + "-\t\tcapacity: o.queueSize,\n", + "-\t\texit: make(chan struct{}),\n", + "-\t\tlogger: o.logger,\n", + "-\t\trunFunc: o.fn,\n", + "+\t\tminCapacity: minCapacity,\n", + "+\t\ttaskQueue: make([]core.TaskMessage, minCapacity),\n", + "+\t\tcapacity: o.queueSize,\n", + "+\t\texit: make(chan struct{}),\n", + "+\t\tlogger: o.logger,\n", + "+\t\trunFunc: o.fn,\n", + " \t}\n", + " \n", + " \treturn w\n", + "--- a/options.go\n", + "+++ b/options.go\n", + "@@ -61,6 +61,17 @@\n", + " \t})\n", + " }\n", + " \n", + "+// WithQueueMinCapacity sets the Ring buffer's initial and minimum retained slots.\n", + "+// Values below 2 use 2 (the default). A positive WithQueueSize limit caps this\n", + "+// setting, except that the buffer always has at least 2 slots. The pending-task\n", + "+// limit is unchanged. Retaining slots reduces burst allocations at the cost of\n", + "+// idle memory; dequeued task references are still cleared. Other backends ignore it.\n", + "+func WithQueueMinCapacity(num int) Option {\n", + "+\treturn OptionFunc(func(q *Options) {\n", + "+\t\tq.queueMinCapacity = num\n", + "+\t})\n", + "+}\n", + "+\n", + " // WithLogger sets a custom logger for queue events and errors.\n", + " // By default, the queue uses a standard logger that writes to stderr.\n", + " // Use NewEmptyLogger() to disable logging entirely.\n", + "@@ -155,14 +166,15 @@\n", + " // Options holds the configuration parameters for a Queue.\n", + " // Use the With* functions to configure these options when creating a queue.\n", + " type Options struct {\n", + "-\tworkerCount int64 // Number of concurrent worker goroutines\n", + "-\tlogger Logger // Logger for queue events\n", + "-\tqueueSize int // Maximum queue capacity, 0 means unlimited\n", + "-\tworker core.Worker // Worker implementation for queue backend\n", + "-\tfn func(context.Context, core.TaskMessage) error // Task handler function\n", + "-\tafterFn func() // Callback executed after each job\n", + "-\tmetric Metric // Metrics collector\n", + "-\tretryInterval time.Duration // Polling interval when queue is empty\n", + "+\tqueueMinCapacity int // Initial and minimum retained Ring slots; normalized by NewRing\n", + "+\tworkerCount int64 // Number of concurrent worker goroutines\n", + "+\tlogger Logger // Logger for queue events\n", + "+\tqueueSize int // Maximum queue capacity, 0 means unlimited\n", + "+\tworker core.Worker // Worker implementation for queue backend\n", + "+\tfn func(context.Context, core.TaskMessage) error // Task handler function\n", + "+\tafterFn func() // Callback executed after each job\n", + "+\tmetric Metric // Metrics collector\n", + "+\tretryInterval time.Duration // Polling interval when queue is empty\n", + " }\n", + " \n", + " // NewOptions creates an Options struct with default values and applies any provided options.\n" + ] +} diff --git a/docs/performance/2026-11-01/followup-summary.json b/docs/performance/2026-11-01/followup-summary.json new file mode 100644 index 0000000..03da2b6 --- /dev/null +++ b/docs/performance/2026-11-01/followup-summary.json @@ -0,0 +1,58 @@ +{ + "baseline": { + "BenchmarkQueueEndToEnd/workers=4-12": { + "samples_ns": [ + 1363.0, + 1304.0, + 1351.0, + 1427.0, + 1265.0, + 1297.0 + ], + "median": 1327.5, + "min": 1265.0, + "max": 1427.0 + }, + "BenchmarkQueueBurstProducers/producers=4/retained=false-12": { + "samples_ns": [ + 1412.0, + 1471.0, + 1457.0, + 1423.0, + 1358.0, + 1418.0 + ], + "median": 1420.5, + "min": 1358.0, + "max": 1471.0 + } + }, + "combined": { + "BenchmarkQueueEndToEnd/workers=4-12": { + "samples_ns": [ + 1285.0, + 1389.0, + 1359.0, + 1402.0, + 1309.0, + 1394.0 + ], + "median": 1374.0, + "min": 1285.0, + "max": 1402.0 + }, + "BenchmarkQueueBurstProducers/producers=4/retained=false-12": { + "samples_ns": [ + 1410.0, + 1428.0, + 1326.0, + 1428.0, + 1414.0, + 1544.0 + ], + "median": 1421.0, + "min": 1326.0, + "max": 1544.0 + } + } +} diff --git a/docs/performance/2026-11-01/logging.txt b/docs/performance/2026-11-01/logging.txt new file mode 100644 index 0000000..602556a --- /dev/null +++ b/docs/performance/2026-11-01/logging.txt @@ -0,0 +1,92 @@ + +# Round 1, 2026-11-01T22:22:30.147043 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 23188 13854 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25768 14294 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 270619 1343 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 257908 1387 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 234274 1561 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 262272 1453 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 442380 782.6 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 313786 1090 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 190357 1977 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 87452 4064 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 306158 1196 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 266751 1424 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 199336 1817 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 263986 1476 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.956s + +# Round 2, 2026-11-01T22:23:00.770724 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24153 14515 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 24879 14166 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 256844 1457 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 255770 1361 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 266577 1480 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 262560 1412 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 453585 777.1 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 339148 1048 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 186278 1950 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 85728 4134 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 301003 1175 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 263035 1403 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 202408 1831 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 253057 1322 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.722s + +# Round 3, 2026-11-01T22:23:30.624045 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24672 14139 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 24586 14727 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 245457 1566 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 250617 1531 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 239944 1377 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 251965 1427 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 502182 736.9 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 341782 1021 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 187906 1910 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 91276 3976 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 321880 1146 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 269452 1247 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 208645 1776 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 249208 1379 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.703s + +# Round 4, 2026-11-01T22:23:36.542673 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24909 14276 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 24598 14234 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 256406 1344 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 279430 1340 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 249990 1379 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 235564 1681 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 471766 749.3 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 350589 1065 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 191136 1898 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=10-12 91230 3903 ns/op 824 B/op 11 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 320517 1117 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 272664 1334 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 199788 1814 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 274263 1337 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 6.036s diff --git a/docs/performance/2026-11-01/manifest.json b/docs/performance/2026-11-01/manifest.json new file mode 100644 index 0000000..f826f85 --- /dev/null +++ b/docs/performance/2026-11-01/manifest.json @@ -0,0 +1,156 @@ +{ + "head": "adf9a1cf9bd0424c9c1286754083bd6038c985df", + "go": "go version go1.26.10 darwin/arm64", + "variants": { + "baseline": { + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", + "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "d2f1fdc64693f6aa3f8aa8e49016071498e15bce7f9750cd1061fe75dcf9ee87", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "retention_compat_test.go": "c00bf1b96525c4fcc5341e2907748c8f6e938d8f355b8e6c8fcd48007e39c5a6", + "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + }, + "logging": { + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", + "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "0830d72280f449e1633a994e6af8d2431fdd0360133d222b3a4b0152ba9589be", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "retention_compat_test.go": "c00bf1b96525c4fcc5341e2907748c8f6e938d8f355b8e6c8fcd48007e39c5a6", + "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + }, + "ring": { + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", + "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "d2f1fdc64693f6aa3f8aa8e49016071498e15bce7f9750cd1061fe75dcf9ee87", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + }, + "combined": { + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", + "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "0830d72280f449e1633a994e6af8d2431fdd0360133d222b3a4b0152ba9589be", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + } + } +} diff --git a/docs/performance/2026-11-01/pr-base.txt b/docs/performance/2026-11-01/pr-base.txt new file mode 100644 index 0000000..52e5486 --- /dev/null +++ b/docs/performance/2026-11-01/pr-base.txt @@ -0,0 +1,100 @@ + +# Round 1: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 23605 14055 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25783 14184 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25678 14050 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25772 13945 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25915 14035 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25334 14061 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 266343 1345 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 265754 1452 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 261768 1432 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 261030 1351 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 252322 1442 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 284739 1460 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 244804 1417 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 228836 1407 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 241516 1475 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 247149 1543 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 248818 1561 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 237507 1503 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 437007 796.5 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 451837 785.5 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 501886 766.2 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 311948 1129 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=1-12 317568 1136 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=1-12 307116 1137 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 202774 1785 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=3-12 198894 1774 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=3-12 209308 1783 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=10-12 92758 3830 ns/op 3376 B/op 48 allocs/op +BenchmarkHandleRetry/retries=10-12 91801 3881 ns/op 3376 B/op 48 allocs/op +BenchmarkHandleRetry/retries=10-12 92510 3873 ns/op 3376 B/op 48 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 288028 1209 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 303657 1212 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 292414 1199 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 242575 1422 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 276072 1506 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 252380 1449 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 184822 1925 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 196460 1978 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 160813 2086 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 216685 1712 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 212546 1717 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 216584 1505 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 17.349s + +# Round 2: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24957 14403 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25207 14402 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 24310 14449 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25306 14397 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25212 14501 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 25014 14566 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 247491 1370 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 296893 1298 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 274621 1315 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 277650 1272 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 306274 1370 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 274818 1309 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 266371 1369 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 266102 1535 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 251109 1394 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 275982 1417 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 275528 1397 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 258381 1462 ns/op 727 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 482842 740.1 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 478311 738.4 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 499866 734.3 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 350870 1034 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=1-12 339878 1032 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=1-12 360026 1028 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 217180 1635 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=3-12 217836 1615 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=3-12 224864 1613 ns/op 1416 B/op 20 allocs/op +BenchmarkHandleRetry/retries=10-12 101126 3519 ns/op 3376 B/op 48 allocs/op +BenchmarkHandleRetry/retries=10-12 103508 3569 ns/op 3376 B/op 48 allocs/op +BenchmarkHandleRetry/retries=10-12 100224 3580 ns/op 3376 B/op 48 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 324015 1194 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 294860 1140 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 307320 1131 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 284756 1297 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 256518 1343 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 298252 1403 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 207580 1718 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 210848 1794 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 210601 1752 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 280666 1411 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 289572 1318 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 277629 1281 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 17.638s diff --git a/docs/performance/2026-11-01/pr-compare.py b/docs/performance/2026-11-01/pr-compare.py new file mode 100644 index 0000000..507e74e --- /dev/null +++ b/docs/performance/2026-11-01/pr-compare.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +"""Compare clean base with this PR. Output directory must not exist.""" +import hashlib +import json +from pathlib import Path +import shutil +import subprocess +import sys + +ROOT = Path(__file__).resolve().parents[3] +DATA = Path(__file__).resolve().parent +DEST = Path(sys.argv[1]).resolve() +DEST.mkdir(parents=True, exist_ok=False) +base = json.loads((DATA / "manifest.json").read_text())["head"] +archive = subprocess.check_output(["git", "archive", base], cwd=ROOT) +versions = ["pr-base", "pr-head"] +manifest = {"base": base, "files": {}} +for version in versions: + d = DEST / version + d.mkdir() + subprocess.run(["tar", "-xf", "-", "-C", str(d)], input=archive, check=True) + if version == "pr-head": + for name in ("queue.go", "logger.go", "ring.go", "options.go"): + shutil.copy2(ROOT / name, d / name) + else: + (d / "retention_compat_test.go").write_text( + "package queue\nfunc WithQueueMinCapacity(int) Option { return OptionFunc(func(*Options) {}) }\n") + shutil.copy2(ROOT / "burst_performance_test.go", d / "burst_performance_test.go") + manifest["files"][version] = {str(p.relative_to(d)): hashlib.sha256(p.read_bytes()).hexdigest() + for p in sorted(d.rglob("*.go"))} +(DEST / "pr-manifest.json").write_text(json.dumps(manifest, indent=2) + "\n") +pattern = "^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$" +for round_no, order in enumerate((versions, list(reversed(versions))), 1): + for version in order: + cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=300ms", "-count=3", "-cpu=12", "."] + with (DEST / (version + ".txt")).open("a") as output: + output.write(f"\n# Round {round_no}: {cmd!r}\n") + output.flush() + subprocess.run(cmd, cwd=DEST / version, stdout=output, stderr=subprocess.STDOUT, check=True) + print(f"Round {round_no}: {version}", flush=True) +print(DEST) diff --git a/docs/performance/2026-11-01/pr-head.txt b/docs/performance/2026-11-01/pr-head.txt new file mode 100644 index 0000000..c4e4515 --- /dev/null +++ b/docs/performance/2026-11-01/pr-head.txt @@ -0,0 +1,100 @@ + +# Round 1: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 22892 13961 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25366 13951 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25720 14364 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35319 10305 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkRingBurstDrain/retained=true-12 34914 10326 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkRingBurstDrain/retained=true-12 34915 10207 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 249838 1452 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 251354 1458 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 264633 1396 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 257113 1411 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 270178 1434 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 255548 1338 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 236432 1401 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 249825 1508 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 250600 1536 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 217346 1538 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 256238 1459 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 262090 1549 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 473252 800.7 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 470780 767.8 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 492057 772.5 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 326998 1064 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=1-12 327853 1048 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=1-12 335607 1064 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 218372 1680 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=3-12 216722 1660 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=3-12 220905 1618 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=10-12 102895 3552 ns/op 3056 B/op 38 allocs/op +BenchmarkHandleRetry/retries=10-12 101895 3499 ns/op 3056 B/op 38 allocs/op +BenchmarkHandleRetry/retries=10-12 102334 3518 ns/op 3056 B/op 38 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 302487 1181 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 293979 1191 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 295192 1187 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 247990 1450 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 254553 1408 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 264274 1413 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 198960 1901 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 186951 1895 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 195313 1868 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 272322 1340 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 270619 1369 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 273514 1365 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 17.236s + +# Round 2: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24934 14419 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25160 14447 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=false-12 25670 14294 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35720 10101 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35620 10133 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35757 10080 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 261014 1374 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 264873 1333 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 271280 1333 ns/op 726 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 285717 1327 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 296550 1414 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 263340 1405 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 257840 1464 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 251316 1441 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 254326 1377 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 247804 1410 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 282567 1321 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 276776 1434 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 482886 770.2 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 454911 747.9 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=0-12 488773 751.1 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 343803 1033 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=1-12 345848 1020 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=1-12 341305 1021 ns/op 824 B/op 11 allocs/op +BenchmarkHandleRetry/retries=3-12 225166 1620 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=3-12 223555 1616 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=3-12 224594 1609 ns/op 1320 B/op 17 allocs/op +BenchmarkHandleRetry/retries=10-12 105237 3444 ns/op 3056 B/op 38 allocs/op +BenchmarkHandleRetry/retries=10-12 105279 3425 ns/op 3056 B/op 38 allocs/op +BenchmarkHandleRetry/retries=10-12 105626 3414 ns/op 3056 B/op 38 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 321027 1133 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 319243 1132 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 319968 1132 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 292736 1273 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 289569 1335 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 268843 1307 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 195470 1776 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 212103 1858 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 200174 1835 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 280508 1354 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 268759 1325 ns/op 766 B/op 11 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 266521 1338 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 17.123s diff --git a/docs/performance/2026-11-01/pr-manifest.json b/docs/performance/2026-11-01/pr-manifest.json new file mode 100644 index 0000000..de06756 --- /dev/null +++ b/docs/performance/2026-11-01/pr-manifest.json @@ -0,0 +1,84 @@ +{ + "base": "adf9a1cf9bd0424c9c1286754083bd6038c985df", + "files": { + "pr-base": { + "_example/example01/main.go": "4fcc55f53ed728e5affcdecd365ea4ab860dd487a3b2c0c38b2e24084d79c03f", + "_example/example02/main.go": "aa3387bd93bbfb8d65a10a1e8f78ec243c5c98ec237eac467209129c59e3d447", + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "d683e39040c83de013eccfab9f4886ba572999742ccece5af74644bf98296147", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "d31de2195404c2f8a243246a106a004bddf95f9646f7062c0e1f021daf7c5d9d", + "job/job_test.go": "54030a5c0a21cf9f5b85e33d637d73fccd5193977f63f83201f43944359cc47b", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "ef2a5345576e8ab36abb566fcb8f395bce9a5e17c233186622bced6d5a32cd5c", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "retention_compat_test.go": "7a25bbd0118bcd4f9f893b532e595f51d5ebcd56d17893331e562613efae95ff", + "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + }, + "pr-head": { + "_example/example01/main.go": "4fcc55f53ed728e5affcdecd365ea4ab860dd487a3b2c0c38b2e24084d79c03f", + "_example/example02/main.go": "aa3387bd93bbfb8d65a10a1e8f78ec243c5c98ec237eac467209129c59e3d447", + "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", + "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", + "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", + "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", + "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", + "handle_result_test.go": "d683e39040c83de013eccfab9f4886ba572999742ccece5af74644bf98296147", + "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", + "job/job.go": "d31de2195404c2f8a243246a106a004bddf95f9646f7062c0e1f021daf7c5d9d", + "job/job_test.go": "54030a5c0a21cf9f5b85e33d637d73fccd5193977f63f83201f43944359cc47b", + "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", + "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", + "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", + "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", + "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", + "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", + "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", + "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", + "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", + "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", + "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", + "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", + "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", + "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", + "queue.go": "324a7b15460ba1d0097faf13064c6f4de06e2bde71e82fd0a4fc14ca894b6992", + "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", + "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", + "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", + "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", + "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", + "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", + "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", + "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", + "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", + "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", + "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" + } + } +} diff --git a/docs/performance/2026-11-01/pr-summary.json b/docs/performance/2026-11-01/pr-summary.json new file mode 100644 index 0000000..7b94264 --- /dev/null +++ b/docs/performance/2026-11-01/pr-summary.json @@ -0,0 +1,34 @@ +{ + "pr-base": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":14055.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14184.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14050.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14403.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14402.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14449.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14293.0,"min":14050.0,"max":14449.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":13945.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14035.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14061.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14397.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14501.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14566.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14229.0,"min":13945.0,"max":14566.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1345.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1452.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1370.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1298.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1315.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1357.5,"min":1298.0,"max":1452.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1351.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1442.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1460.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1272.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1370.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1309.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1360.5,"min":1272.0,"max":1460.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1417.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1407.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1475.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1369.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1535.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1394.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1412.0,"min":1369.0,"max":1535.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1543.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1561.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1503.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1417.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1397.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1462.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1482.5,"min":1397.0,"max":1561.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":796.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":785.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":766.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":740.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":738.4,"B/op":576.0,"allocs/op":8.0},{"ns/op":734.3,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":753.1500000000001,"min":734.3,"max":796.5},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1129.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1136.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1137.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1034.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1032.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1028.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1081.5,"min":1028.0,"max":1137.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1785.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1774.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1783.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1635.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1615.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1613.0,"B/op":1416.0,"allocs/op":20.0}],"summary":{"ns/op":{"median":1704.5,"min":1613.0,"max":1785.0},"B/op":{"median":1416.0,"min":1416.0,"max":1416.0},"allocs/op":{"median":20.0,"min":20.0,"max":20.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":3830.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3881.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3873.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3519.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3569.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3580.0,"B/op":3376.0,"allocs/op":48.0}],"summary":{"ns/op":{"median":3705.0,"min":3519.0,"max":3881.0},"B/op":{"median":3376.0,"min":3376.0,"max":3376.0},"allocs/op":{"median":48.0,"min":48.0,"max":48.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1209.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1212.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1199.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1194.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1140.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1131.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1196.5,"min":1131.0,"max":1212.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1422.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1506.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1449.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1297.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1343.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1403.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1412.5,"min":1297.0,"max":1506.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1925.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1978.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":2086.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1718.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1794.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1752.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1859.5,"min":1718.0,"max":2086.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1712.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1717.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1505.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1411.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1318.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1281.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1458.0,"min":1281.0,"max":1717.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + }, + "pr-head": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13961.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":13951.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14364.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14419.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14447.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14294.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14329.0,"min":13951.0,"max":14447.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10305.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10326.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10207.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10101.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10133.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10080.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10170.0,"min":10080.0,"max":10326.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1452.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1458.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1396.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1374.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1333.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1333.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1385.0,"min":1333.0,"max":1458.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1411.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1338.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1327.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1414.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1405.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1408.0,"min":1327.0,"max":1434.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1401.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1508.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1536.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1464.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1441.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1452.5,"min":1377.0,"max":1536.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1538.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1459.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1549.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1410.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1321.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1446.5,"min":1321.0,"max":1549.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":800.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":767.8,"B/op":576.0,"allocs/op":8.0},{"ns/op":772.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":770.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":747.9,"B/op":576.0,"allocs/op":8.0},{"ns/op":751.1,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":769.0,"min":747.9,"max":800.7},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1048.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1033.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1020.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1021.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1040.5,"min":1020.0,"max":1064.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1680.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1660.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1618.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1620.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1616.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1609.0,"B/op":1320.0,"allocs/op":17.0}],"summary":{"ns/op":{"median":1619.0,"min":1609.0,"max":1680.0},"B/op":{"median":1320.0,"min":1320.0,"max":1320.0},"allocs/op":{"median":17.0,"min":17.0,"max":17.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":3552.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3499.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3518.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3444.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3425.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3414.0,"B/op":3056.0,"allocs/op":38.0}],"summary":{"ns/op":{"median":3471.5,"min":3414.0,"max":3552.0},"B/op":{"median":3056.0,"min":3056.0,"max":3056.0},"allocs/op":{"median":38.0,"min":38.0,"max":38.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1181.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1191.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1187.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1133.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1132.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1132.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1157.0,"min":1132.0,"max":1191.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1450.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1408.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1413.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1273.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1335.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1307.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1371.5,"min":1273.0,"max":1450.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1901.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1895.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1868.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1776.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1858.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1835.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1863.0,"min":1776.0,"max":1901.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1340.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1369.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1365.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1354.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1325.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1338.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1347.0,"min":1325.0,"max":1369.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + } +} diff --git a/docs/performance/2026-11-01/ring.txt b/docs/performance/2026-11-01/ring.txt new file mode 100644 index 0000000..b504222 --- /dev/null +++ b/docs/performance/2026-11-01/ring.txt @@ -0,0 +1,92 @@ + +# Round 1, 2026-11-01T22:22:36.439723 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 23317 13895 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35805 10070 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 242037 1468 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 260857 1477 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 246873 1539 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 244254 1499 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 442185 813.2 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 315342 1142 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 175422 2022 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 80718 4334 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 301330 1230 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 251847 1462 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 189943 1795 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 254506 1453 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.896s + +# Round 2, 2026-11-01T22:22:54.867854 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24452 14114 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35808 10084 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 253450 1434 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 258792 1377 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 247558 1497 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 246758 1524 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 444896 785.1 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 313742 1166 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 174030 2068 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 82233 4401 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 288429 1197 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 214826 1724 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 176238 2038 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 218710 1608 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.689s + +# Round 3, 2026-11-01T22:23:12.607526 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24968 14169 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35637 10063 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 266533 1319 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 265105 1554 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 258612 1697 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 239036 1556 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 468074 743.7 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 341193 1085 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 175869 2064 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 82057 4319 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 298659 1185 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 254196 1447 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 186553 1856 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 275122 1375 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.802s + +# Round 4, 2026-11-01T22:23:54.862140 +# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] +goos: darwin +goarch: arm64 +pkg: github.com/golang-queue/queue +cpu: Apple M4 Pro +BenchmarkRingBurstDrain/retained=false-12 24937 14595 ns/op 32.00 retained-B 55968 B/op 18 allocs/op +BenchmarkRingBurstDrain/retained=true-12 35830 10064 ns/op 16384 retained-B 0 B/op 0 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=false-12 247706 1322 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=1/retained=true-12 280854 1324 ns/op 672 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=false-12 281216 1379 ns/op 727 B/op 9 allocs/op +BenchmarkQueueBurstProducers/producers=4/retained=true-12 263732 1399 ns/op 672 B/op 9 allocs/op +BenchmarkHandleRetry/retries=0-12 474039 739.4 ns/op 576 B/op 8 allocs/op +BenchmarkHandleRetry/retries=1-12 335504 1044 ns/op 856 B/op 12 allocs/op +BenchmarkHandleRetry/retries=3-12 181171 1974 ns/op 920 B/op 14 allocs/op +BenchmarkHandleRetry/retries=10-12 84126 4306 ns/op 1144 B/op 21 allocs/op +BenchmarkQueueEndToEnd/workers=1-12 323054 1152 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=4-12 265258 1350 ns/op 726 B/op 9 allocs/op +BenchmarkQueueEndToEnd/workers=12-12 192166 1795 ns/op 726 B/op 9 allocs/op +BenchmarkQueueAfterFnEndToEnd-12 274467 1440 ns/op 766 B/op 11 allocs/op +PASS +ok github.com/golang-queue/queue 5.694s diff --git a/docs/performance/2026-11-01/run.py b/docs/performance/2026-11-01/run.py new file mode 100644 index 0000000..117564c --- /dev/null +++ b/docs/performance/2026-11-01/run.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +"""Rebuild four variants and reproduce measurements from the report's source tree. +Run: rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-rerun +Requires git, Go, and the implementation/test files accompanying this report. +""" +import hashlib +import json +from pathlib import Path +import shutil +import subprocess +import sys +from datetime import datetime + +ROOT = Path(__file__).resolve().parents[3] +DATA = Path(__file__).resolve().parent +DEST = Path(sys.argv[1]).resolve() +DEST.mkdir(parents=True, exist_ok=False) +MANIFEST = json.loads((DATA / "manifest.json").read_text()) +FIXTURES = json.loads((DATA / "fixtures.json").read_text()) +archive = subprocess.check_output(["git", "archive", MANIFEST["head"]], cwd=ROOT) +variants = ["baseline", "logging", "ring", "combined"] +for variant in variants: + d = DEST / variant + d.mkdir() + subprocess.run(["tar", "-xf", "-", "-C", str(d)], input=archive, check=True) + subprocess.run(["git", "apply", "-"], input="".join(FIXTURES["baseline"]).encode(), cwd=d, check=True) + includes = [] + if variant in ("logging", "combined"): + includes += ["--include=queue.go", "--include=logger.go"] + if variant in ("ring", "combined"): + includes += ["--include=ring.go", "--include=options.go"] + else: + (d / "retention_compat_test.go").write_text( + "package queue\n// Comparison-only adapter: the baseline retains the old resizing policy.\n" + "func WithQueueMinCapacity(int) Option { return OptionFunc(func(*Options) {}) }\n" + ) + if includes: + subprocess.run(["git", "apply", *includes, "-"], input="".join(FIXTURES["implementation"]).encode(), cwd=d, check=True) + shutil.copy2(ROOT / "burst_performance_test.go", d / "burst_performance_test.go") + for name, expected in MANIFEST["variants"][variant].items(): + actual = hashlib.sha256((d / name).read_bytes()).hexdigest() + if actual != expected: + raise SystemExit(f"Source mismatch: {variant}/{name}; use the source version accompanying this report") + +if "--prepare-only" in sys.argv[2:]: + print(f"Verified source snapshots: {DEST}") + raise SystemExit(0) + +if "--followup" in sys.argv[2:]: + patterns = ["^BenchmarkQueueEndToEnd$/^workers=4$", "^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$"] + for round_no in range(6): + order = ["baseline", "combined"] if round_no % 2 == 0 else ["combined", "baseline"] + for variant in order: + with (DEST / (variant + "-followup.txt")).open("a") as output: + for pattern in patterns: + cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=1s", "-count=1", "-cpu=12", "."] + output.write(f"\n# Round {round_no + 1}, {datetime.now().isoformat()}\n# {cmd!r}\n") + output.flush() + subprocess.run(cmd, cwd=DEST / variant, stdout=output, stderr=subprocess.STDOUT, check=True) + print(f"Follow-up {round_no + 1}: {variant}", flush=True) + raise SystemExit(0) + +pattern = "^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$" +orders = [variants, list(reversed(variants)), ["ring", "baseline", "combined", "logging"], ["logging", "combined", "baseline", "ring"]] +for round_no, order in enumerate(orders, 1): + for variant in order: + cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=300ms", "-count=1", "-cpu=12", "."] + with (DEST / (variant + ".txt")).open("a") as output: + output.write(f"\n# Round {round_no}, {datetime.now().isoformat()}\n# {cmd!r}\n") + output.flush() + subprocess.run(cmd, cwd=DEST / variant, stdout=output, stderr=subprocess.STDOUT, check=True) + print(f"Round {round_no}: {variant}", flush=True) +print(f"Results: {DEST}") diff --git a/docs/performance/2026-11-01/summarize.py b/docs/performance/2026-11-01/summarize.py new file mode 100644 index 0000000..0ecb35a --- /dev/null +++ b/docs/performance/2026-11-01/summarize.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +"""Summarize raw Go benchmark output. Optional argument: result directory.""" +import json +from pathlib import Path +import statistics +import sys + +folder = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).resolve().parent +results = {} +for variant in ("baseline", "logging", "ring", "combined"): + samples = {} + for line in (folder / (variant + ".txt")).read_text().splitlines(): + parts = line.split() + if not parts or not parts[0].startswith("Benchmark") or len(parts) < 8: + continue + name = parts[0].rsplit("-", 1)[0] + metrics = {parts[i + 1]: float(parts[i]) for i in range(2, len(parts) - 1, 2)} + samples.setdefault(name, []).append(metrics) + results[variant] = { + name: {"samples": values, "summary": { + unit: {"median": statistics.median(v[unit] for v in values), + "min": min(v[unit] for v in values), + "max": max(v[unit] for v in values)} + for unit in values[0] + }} for name, values in samples.items() + } +(folder / "summary.json").write_text(json.dumps(results, indent=2) + "\n") +for name in results["baseline"]: + before = results["baseline"][name]["summary"] + after = results["combined"][name]["summary"] + a, b = before["ns/op"]["median"], after["ns/op"]["median"] + print(f"{name}: {a:g} -> {b:g} ns/op ({(b/a-1)*100:+.1f}%), " + f'{before["B/op"]["median"]:g} -> {after["B/op"]["median"]:g} B/op, ' + f'{before["allocs/op"]["median"]:g} -> {after["allocs/op"]["median"]:g} allocs/op') diff --git a/docs/performance/2026-11-01/summary.json b/docs/performance/2026-11-01/summary.json new file mode 100644 index 0000000..4d59e58 --- /dev/null +++ b/docs/performance/2026-11-01/summary.json @@ -0,0 +1,66 @@ +{ + "baseline": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13948.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14319.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14337.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14086.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14202.5,"min":13948.0,"max":14337.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":14098.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14584.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14280.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14191.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14235.5,"min":14098.0,"max":14584.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1405.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1614.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1373.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1345.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1389.0,"min":1345.0,"max":1614.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1448.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1555.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1269.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1329.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1388.5,"min":1269.0,"max":1555.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1501.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1619.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1466.5,"min":1432.0,"max":1619.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1461.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1462.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1478.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1721.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1470.0,"min":1461.0,"max":1721.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":805.4,"B/op":576.0,"allocs/op":8.0},{"ns/op":768.0,"B/op":576.0,"allocs/op":8.0},{"ns/op":759.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":754.6,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":763.85,"min":754.6,"max":805.4},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1139.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1087.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1089.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1068.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1088.0,"min":1068.0,"max":1139.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":2121.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2049.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2034.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2039.0,"B/op":920.0,"allocs/op":14.0}],"summary":{"ns/op":{"median":2044.0,"min":2034.0,"max":2121.0},"B/op":{"median":920.0,"min":920.0,"max":920.0},"allocs/op":{"median":14.0,"min":14.0,"max":14.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4414.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4355.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4303.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4355.0,"B/op":1144.0,"allocs/op":21.0}],"summary":{"ns/op":{"median":4355.0,"min":4303.0,"max":4414.0},"B/op":{"median":1144.0,"min":1144.0,"max":1144.0},"allocs/op":{"median":21.0,"min":21.0,"max":21.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1209.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1169.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1184.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1128.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1176.5,"min":1128.0,"max":1209.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1357.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1400.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1372.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1230.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1364.5,"min":1230.0,"max":1400.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1876.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1867.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1869.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1894.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1872.5,"min":1867.0,"max":1894.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1481.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1396.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1426.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1343.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1411.0,"min":1343.0,"max":1481.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + }, + "logging": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13854.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14515.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14139.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14276.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14207.5,"min":13854.0,"max":14515.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":14294.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14166.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14727.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14234.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14264.0,"min":14166.0,"max":14727.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1343.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1457.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1566.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1344.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1400.5,"min":1343.0,"max":1566.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1387.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1361.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1531.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1340.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1374.0,"min":1340.0,"max":1531.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1561.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1480.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1379.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1429.5,"min":1377.0,"max":1561.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1453.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1412.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1427.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1681.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1440.0,"min":1412.0,"max":1681.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":782.6,"B/op":576.0,"allocs/op":8.0},{"ns/op":777.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":736.9,"B/op":576.0,"allocs/op":8.0},{"ns/op":749.3,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":763.2,"min":736.9,"max":782.6},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1090.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1048.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1021.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1065.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1056.5,"min":1021.0,"max":1090.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1977.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1950.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1910.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1898.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1930.0,"min":1898.0,"max":1977.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":4134.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3976.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3903.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":4020.0,"min":3903.0,"max":4134.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1196.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1175.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1146.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1117.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1160.5,"min":1117.0,"max":1196.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1424.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1403.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1247.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1334.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1368.5,"min":1247.0,"max":1424.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1817.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1831.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1776.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1814.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1815.5,"min":1776.0,"max":1831.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1476.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1322.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1379.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1337.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1358.0,"min":1322.0,"max":1476.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + }, + "ring": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13895.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14114.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14169.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14595.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14141.5,"min":13895.0,"max":14595.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10070.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10084.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10063.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10064.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10067.0,"min":10063.0,"max":10084.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1468.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1319.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1322.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1378.0,"min":1319.0,"max":1468.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1477.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1554.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1324.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1427.0,"min":1324.0,"max":1554.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1539.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1497.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1697.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1379.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1518.0,"min":1379.0,"max":1697.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1499.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1524.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1556.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1399.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1511.5,"min":1399.0,"max":1556.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":813.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":785.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":743.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":739.4,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":764.4000000000001,"min":739.4,"max":813.2},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1142.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1166.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1085.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1044.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1113.5,"min":1044.0,"max":1166.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":2022.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2068.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2064.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":1974.0,"B/op":920.0,"allocs/op":14.0}],"summary":{"ns/op":{"median":2043.0,"min":1974.0,"max":2068.0},"B/op":{"median":920.0,"min":920.0,"max":920.0},"allocs/op":{"median":14.0,"min":14.0,"max":14.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4334.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4401.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4319.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4306.0,"B/op":1144.0,"allocs/op":21.0}],"summary":{"ns/op":{"median":4326.5,"min":4306.0,"max":4401.0},"B/op":{"median":1144.0,"min":1144.0,"max":1144.0},"allocs/op":{"median":21.0,"min":21.0,"max":21.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1230.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1197.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1185.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1152.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1191.0,"min":1152.0,"max":1230.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1462.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1724.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1447.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1350.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1454.5,"min":1350.0,"max":1724.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1795.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":2038.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1856.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1795.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1825.5,"min":1795.0,"max":2038.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1453.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1608.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1375.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1440.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1446.5,"min":1375.0,"max":1608.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + }, + "combined": { + "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":14193.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14019.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14145.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14183.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14164.0,"min":14019.0,"max":14193.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, + "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10074.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10064.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10071.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10081.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10072.5,"min":10064.0,"max":10081.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1544.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1418.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1398.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1374.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1408.0,"min":1374.0,"max":1544.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1468.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1315.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1584.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1321.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1394.5,"min":1315.0,"max":1584.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1481.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1459.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1670.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1683.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1575.5,"min":1459.0,"max":1683.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1496.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1482.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1682.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1316.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1489.0,"min":1316.0,"max":1682.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":765.3,"B/op":576.0,"allocs/op":8.0},{"ns/op":786.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":739.8,"B/op":576.0,"allocs/op":8.0},{"ns/op":726.7,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":752.55,"min":726.7,"max":786.7},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, + "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1062.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1093.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1046.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1023.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1054.0,"min":1023.0,"max":1093.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1949.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1956.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1925.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1867.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1937.0,"min":1867.0,"max":1956.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4007.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":4019.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3984.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3913.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":3995.5,"min":3913.0,"max":4019.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, + "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1200.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1202.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1140.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1118.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1170.0,"min":1118.0,"max":1202.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1508.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1502.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1381.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1371.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1441.5,"min":1371.0,"max":1508.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1917.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1957.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1941.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1803.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1929.0,"min":1803.0,"max":1957.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, + "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1546.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1455.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1327.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1352.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1403.5,"min":1327.0,"max":1546.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} + } +} diff --git a/logger.go b/logger.go index 215f063..75e3484 100644 --- a/logger.go +++ b/logger.go @@ -35,6 +35,21 @@ type Logger interface { Fatal(args ...any) } +// InfoLogger optionally lets a Logger disable informational messages before the +// queue constructs variadic arguments. Loggers without it remain enabled. +// InfoEnabled must be safe to call concurrently; it is checked on every retry. +type InfoLogger interface { + Logger + InfoEnabled() bool +} + +func infoEnabled(l Logger) bool { + if l, ok := l.(InfoLogger); ok { + return l.InfoEnabled() + } + return true +} + // NewLogger creates a standard logger that writes to stderr with timestamps. // This is the default logger used by queues unless overridden with WithLogger. // @@ -127,3 +142,6 @@ func (l emptyLogger) Fatalf(format string, args ...any) {} func (l emptyLogger) Info(args ...any) {} func (l emptyLogger) Error(args ...any) {} func (l emptyLogger) Fatal(args ...any) {} + +// InfoEnabled disables informational argument construction for the no-op logger. +func (l emptyLogger) InfoEnabled() bool { return false } diff --git a/options.go b/options.go index 6132f55..65f8ae4 100644 --- a/options.go +++ b/options.go @@ -61,6 +61,17 @@ func WithQueueSize(num int) Option { }) } +// WithQueueMinCapacity sets the Ring buffer's initial and minimum retained slots. +// Values below 2 use 2 (the default). A positive WithQueueSize limit caps this +// setting, except that the buffer always has at least 2 slots. The pending-task +// limit is unchanged. Retaining slots reduces burst allocations at the cost of +// idle memory; dequeued task references are still cleared. Other backends ignore it. +func WithQueueMinCapacity(num int) Option { + return OptionFunc(func(q *Options) { + q.queueMinCapacity = num + }) +} + // WithLogger sets a custom logger for queue events and errors. // By default, the queue uses a standard logger that writes to stderr. // Use NewEmptyLogger() to disable logging entirely. @@ -155,14 +166,15 @@ func WithRetryInterval(d time.Duration) Option { // Options holds the configuration parameters for a Queue. // Use the With* functions to configure these options when creating a queue. type Options struct { - workerCount int64 // Number of concurrent worker goroutines - logger Logger // Logger for queue events - queueSize int // Maximum queue capacity, 0 means unlimited - worker core.Worker // Worker implementation for queue backend - fn func(context.Context, core.TaskMessage) error // Task handler function - afterFn func() // Callback executed after each job - metric Metric // Metrics collector - retryInterval time.Duration // Polling interval when queue is empty + queueMinCapacity int // Initial and minimum retained Ring slots; normalized by NewRing + workerCount int64 // Number of concurrent worker goroutines + logger Logger // Logger for queue events + queueSize int // Maximum queue capacity, 0 means unlimited + worker core.Worker // Worker implementation for queue backend + fn func(context.Context, core.TaskMessage) error // Task handler function + afterFn func() // Callback executed after each job + metric Metric // Metrics collector + retryInterval time.Duration // Polling interval when queue is empty } // NewOptions creates an Options struct with default values and applies any provided options. diff --git a/performance_options_test.go b/performance_options_test.go new file mode 100644 index 0000000..053d5b1 --- /dev/null +++ b/performance_options_test.go @@ -0,0 +1,133 @@ +package queue + +import ( + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/golang-queue/queue/job" + + "github.com/stretchr/testify/require" +) + +type legacyRetryLogger struct { + Logger + messages []string +} + +func (l *legacyRetryLogger) Infof(format string, args ...any) { + l.messages = append(l.messages, fmt.Sprintf(format, args...)) +} + +type filteredRetryLogger struct { + *legacyRetryLogger + enabled bool +} + +func (l *filteredRetryLogger) InfoEnabled() bool { return l.enabled } + +func TestRetryInfoEnabled(t *testing.T) { + for _, mode := range []string{"legacy", "enabled", "disabled", "dynamic"} { + t.Run(mode, func(t *testing.T) { + capture := &legacyRetryLogger{Logger: NewEmptyLogger()} + filtered := &filteredRetryLogger{legacyRetryLogger: capture, enabled: mode == "enabled"} + var logger Logger = filtered + if mode == "legacy" { + logger = capture + } + q, err := NewQueue(WithWorker(NewRing()), WithLogger(logger)) + require.NoError(t, err) + defer q.Release() + attempts := 0 + m := job.NewTask(func(context.Context) error { + attempts++ + if mode == "dynamic" { + filtered.enabled = attempts == 2 + } + if attempts <= 3 { + return errors.New("retry") + } + return nil + }, job.AllowOption{RetryCount: job.Int64(3), RetryDelay: job.Time(time.Nanosecond)}) + require.NoError(t, q.handle(&m)) + require.Equal(t, 4, attempts) + want := 3 + if mode == "disabled" { + want = 0 + } + if mode == "dynamic" { + want = 1 + } + require.Len(t, capture.messages, want) + if mode == "legacy" || mode == "enabled" { + require.Equal(t, "retry remaining times: 2, delay time: 1ns", capture.messages[0]) + } + }) + } + require.False(t, infoEnabled(NewEmptyLogger())) +} + +func TestRingMinCapacity(t *testing.T) { + for _, tc := range []struct { + name string + floor, limit, want int + }{ + {"default", 0, 0, 2}, + {"negative", -1, 0, 2}, + {"retained", 64, 0, 64}, + {"non-power-of-two", 7, 0, 7}, + {"capped", 64, 10, 10}, + {"single", 64, 1, 2}, + } { + t.Run(tc.name, func(t *testing.T) { + w := NewRing(WithQueueMinCapacity(tc.floor), WithQueueSize(tc.limit)) + require.Len(t, w.taskQueue, tc.want) + n := 257 + if tc.limit > 0 { + n = tc.limit + } + for range 3 { + expected := make([]*job.Message, n) + for i := range n { + expected[i] = &job.Message{Body: []byte{byte(i)}} + require.NoError(t, w.Queue(expected[i])) + } + if tc.limit > 0 { + require.ErrorIs(t, w.Queue(new(job.Message)), ErrMaxCapacity) + } + // Drain partly and refill to force wraparound before the final drain. + for i := range n / 2 { + got, err := w.Request() + require.NoError(t, err) + require.Same(t, expected[i], got) + } + for i := range n / 2 { + require.NoError(t, w.Queue(expected[i])) + } + order := append(append([]*job.Message{}, expected[n/2:]...), expected[:n/2]...) + for _, want := range order { + got, err := w.Request() + require.NoError(t, err) + require.Same(t, want, got) + } + require.Len(t, w.taskQueue, tc.want) + for _, slot := range w.taskQueue { + require.Nil(t, slot) + } + _, err := w.Request() + require.ErrorIs(t, err, ErrNoTaskInQueue) + } + require.NoError(t, w.Shutdown()) + require.ErrorIs(t, w.Queue(new(job.Message)), ErrQueueShutdown) + }) + } + // Option ordering must not affect the cap. + require.Len(t, NewRing(WithQueueSize(10), WithQueueMinCapacity(64)).taskQueue, 10) + q := NewPool(1, WithQueueMinCapacity(64), WithLogger(NewEmptyLogger())) + require.Equal(t, 64, q.worker.(*Ring).minCapacity) + require.NoError(t, q.QueueTask(func(context.Context) error { return nil })) + q.Release() + require.EqualValues(t, 1, q.SuccessTasks()) +} diff --git a/queue.go b/queue.go index 1c2ae74..0c84739 100644 --- a/queue.go +++ b/queue.go @@ -278,7 +278,9 @@ func (q *Queue) handle(m *job.Message) error { select { case <-time.After(delay): // Wait before retrying - q.logger.Infof("retry remaining times: %d, delay time: %s", m.RetryCount, delay) + if infoEnabled(q.logger) { + q.logger.Infof("retry remaining times: %d, delay time: %s", m.RetryCount, delay) + } case <-ctx.Done(): // Timeout reached err = ctx.Err() break loop diff --git a/ring.go b/ring.go index 10619a1..c35e533 100644 --- a/ring.go +++ b/ring.go @@ -21,6 +21,7 @@ var _ core.Worker = (*Ring)(nil) // - When head == tail, the queue is empty // - Both pointers wrap around using modulo arithmetic type Ring struct { + minCapacity int // Minimum retained slots, configured at construction sync.Mutex taskQueue []core.TaskMessage // Circular buffer storing queued tasks runFunc func(context.Context, core.TaskMessage) error // Function to execute when processing tasks @@ -131,8 +132,11 @@ func (s *Ring) Request() (core.TaskMessage, error) { // Shrink buffer if at most 25% full (to save memory) // Minimum buffer size is 2 to maintain circular buffer structure - if n := len(s.taskQueue) / 2; n >= 2 && s.count <= len(s.taskQueue)/4 { - s.resize(n) + if n := len( + s.taskQueue, + ) / 2; len(s.taskQueue) > s.minCapacity && + s.count <= len(s.taskQueue)/4 { + s.resize(max(n, s.minCapacity)) } return data, nil @@ -179,7 +183,7 @@ func (s *Ring) resize(n int) { } // NewRing creates a new Ring instance with the provided options. -// It initializes the task queue with a default size of 2, sets the capacity +// It initializes the task queue with at least 2 slots (or WithQueueMinCapacity), sets the capacity // based on the provided options, and configures the logger and run function. // The function returns a pointer to the newly created Ring instance. // @@ -192,12 +196,17 @@ func (s *Ring) resize(n int) { // *Ring - A pointer to the newly created Ring instance. func NewRing(opts ...Option) *Ring { o := NewOptions(opts...) + minCapacity := max(2, o.queueMinCapacity) + if o.queueSize > 0 { + minCapacity = max(2, min(minCapacity, o.queueSize)) + } w := &Ring{ - taskQueue: make([]core.TaskMessage, 2), - capacity: o.queueSize, - exit: make(chan struct{}), - logger: o.logger, - runFunc: o.fn, + minCapacity: minCapacity, + taskQueue: make([]core.TaskMessage, minCapacity), + capacity: o.queueSize, + exit: make(chan struct{}), + logger: o.logger, + runFunc: o.fn, } return w From 499e971eb35d73923130498483edeb5718595001 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 1 Nov 2026 22:52:57 +0800 Subject: [PATCH 2/2] docs(perf): keep benchmark reports in PR description --- docs/performance-followup.md | 245 --------------- .../2026-11-01/baseline-followup.txt | 120 -------- docs/performance/2026-11-01/baseline.txt | 92 ------ .../2026-11-01/combined-followup.txt | 120 -------- docs/performance/2026-11-01/combined.txt | 92 ------ docs/performance/2026-11-01/fixtures.json | 282 ------------------ .../2026-11-01/followup-summary.json | 58 ---- docs/performance/2026-11-01/logging.txt | 92 ------ docs/performance/2026-11-01/manifest.json | 156 ---------- docs/performance/2026-11-01/pr-base.txt | 100 ------- docs/performance/2026-11-01/pr-compare.py | 41 --- docs/performance/2026-11-01/pr-head.txt | 100 ------- docs/performance/2026-11-01/pr-manifest.json | 84 ------ docs/performance/2026-11-01/pr-summary.json | 34 --- docs/performance/2026-11-01/ring.txt | 92 ------ docs/performance/2026-11-01/run.py | 73 ----- docs/performance/2026-11-01/summarize.py | 34 --- docs/performance/2026-11-01/summary.json | 66 ---- 18 files changed, 1881 deletions(-) delete mode 100644 docs/performance-followup.md delete mode 100644 docs/performance/2026-11-01/baseline-followup.txt delete mode 100644 docs/performance/2026-11-01/baseline.txt delete mode 100644 docs/performance/2026-11-01/combined-followup.txt delete mode 100644 docs/performance/2026-11-01/combined.txt delete mode 100644 docs/performance/2026-11-01/fixtures.json delete mode 100644 docs/performance/2026-11-01/followup-summary.json delete mode 100644 docs/performance/2026-11-01/logging.txt delete mode 100644 docs/performance/2026-11-01/manifest.json delete mode 100644 docs/performance/2026-11-01/pr-base.txt delete mode 100644 docs/performance/2026-11-01/pr-compare.py delete mode 100644 docs/performance/2026-11-01/pr-head.txt delete mode 100644 docs/performance/2026-11-01/pr-manifest.json delete mode 100644 docs/performance/2026-11-01/pr-summary.json delete mode 100644 docs/performance/2026-11-01/ring.txt delete mode 100644 docs/performance/2026-11-01/run.py delete mode 100644 docs/performance/2026-11-01/summarize.py delete mode 100644 docs/performance/2026-11-01/summary.json diff --git a/docs/performance-followup.md b/docs/performance-followup.md deleted file mode 100644 index 282a7b7..0000000 --- a/docs/performance-followup.md +++ /dev/null @@ -1,245 +0,0 @@ -# 第二輪 Queue 效能改善報告 - -**Version note: the earlier sections preserve the working-tree experiment. See the final PR supplement for clean master versus the actual PR.** - -日期:2026-11-01。環境:Apple M4 Pro、darwin/arm64、go version go1.26.10 darwin/arm64、`-cpu=12`。 - -## 結果與適用範圍 - -完成兩項修改:停用重試資訊日誌時略過參數配置,以及可選的 Ring 初始/最低保留容量。 -預設縮容策略、任務容量限制、FIFO、timeout、retry 次數與 shutdown 排程維持原行為。 - -- 空 logger、重試 10 次:配置 **21 → 11 次**,**1,144 → 824 B/op**;時間中位數減少 **8.3%**。 -- 每批 1,024 筆的 Ring 填滿/清空,啟用保留 1,024 格:穩態配置 **18 → 0 次/批**,時間減少 **29.2%**,換算吞吐量增加 **41.3%**。 -- 多 producer 的端到端情境:啟用保留容量後每筆配置位元組約減少 **7.4–7.6%**;本次沒有證明端到端吞吐提升。 -- 成本:Ring 清空後的 backing-array 槽位從 **32 B 增至 16,384 B**。這不是 RSS;已出列的 task 引用仍清空。 - -數字取四輪樣本中位數;時間百分比不是統計顯著性宣告,不適用於任意業務工作負載。 - -## 版本定義 - -基準為 `adf9a1cf9bd0424c9c1286754083bd6038c985df` 加上開始實作時已有的工作目錄修改,保存於 -[fixtures.json / baseline](performance/2026-11-01/fixtures.json)。 -這些既有修改只作為量測 fixture 保存,**不包含在本 PR 的產品程式修改中**。 -本 PR 不包含 retry timer 重用與 Jitter 修正,因此此報告的絕對值是當時工作目錄比較, -不是乾淨 master 與 PR head 的直接比較;兩項優化的差異以固定 fixture 隔離。 - -這些既有修改涵蓋 `queue.go`、`handle_result_test.go`、`job/job.go`、`job/job_test.go`,四個版本皆包含。 -因此不能把此報告當成該 commit 的乾淨版本與最終工作目錄直接比較。 - -| 版本 | 修改 | -| --- | --- | -| baseline | 實作前工作目錄 | -| logging | 僅增加可選 InfoEnabled 與重試呼叫端檢查 | -| ring | 僅增加 WithQueueMinCapacity 與 Ring 保留容量 | -| combined | 兩項合併 | - -所有版本使用相同 benchmark。baseline/logging 沒有新 Ring API,僅在測試中提供 no-op -`WithQueueMinCapacity` adapter,讓 `retained=true` 標籤跑相同工作負載下的舊縮容策略。 -這個 adapter 不修改舊版 Ring 行為;原版 `retained=true` 實際仍只保留 2 格。 - -## 1. 重試日誌 - -[logger.go](../logger.go) 新增可選介面 `InfoLogger`(含 `InfoEnabled() bool`);既有 `Logger` -介面不變,未提供方法的 logger 繼續輸出重試日誌。`NewEmptyLogger()` 回報 false。 -[queue.go](../queue.go) 在每次重試記錄之前檢查,避免建立 `...any` 參數;允許執行期間切換設定, -不把結果快取在建構時。自訂 logger 必須讓方法可安全併發呼叫。 -這個檢查目前用於重試資訊日誌,不抑制錯誤/panic 日誌。 - -每次操作為一個完整 handler 執行;retry delay 為 1ns,以凸顯框架成本,並非真實網路重試延遲。 - -| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | -| --- | ---: | ---: | ---: | ---: | ---: | ---: | -| 重試 0 次 | 763.85 | 752.55 | -1.5% | +1.5% | 576 → 576 | 8 → 8 | -| 重試 1 次 | 1,088.00 | 1,054.00 | -3.1% | +3.2% | 856 → 824 | 12 → 11 | -| 重試 3 次 | 2,044.00 | 1,937.00 | -5.2% | +5.5% | 920 → 824 | 14 → 11 | -| 重試 10 次 | 4,355.00 | 3,995.50 | -8.3% | +9.0% | 1144 → 824 | 21 → 11 | - -## 2. Ring 保留容量 - -[options.go](../options.go) 新增 `WithQueueMinCapacity(n)`,只對內建 Ring 有效: - -- 設定初始配置與縮容下限;小於 2 時用 2,預設仍為 2。 -- 有正數 `WithQueueSize` 上限時取較小值,但至少保留 2 格;待處理任務上限仍獨立遵守。 -- 支援非 2 的次方,選項先後順序不影響容量上限。 -- 超過最低容量時仍可擴容;使用量降至 25% 時減半,但不低於設定下限。 - -```go -q := queue.NewPool(4, - queue.WithLogger(queue.NewEmptyLogger()), - queue.WithQueueMinCapacity(1024), -) -defer q.Release() -``` - -此例預先配置 16 KiB 的 Ring 槽位空間(本機每個 interface 槽位 16 B);無 backlog 時仍保留。 -未設定 `WithQueueSize` 時,這不會把佇列限制為 1,024 筆。 - -以下每次操作為 **1,024 次入列+1,024 次出列**;不是單筆任務執行時間。 -預配置位於 ResetTimer 之前,表中的 0 B/op 不包含建構時配置。 - -| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | -| --- | ---: | ---: | ---: | ---: | ---: | ---: | -| 預設容量策略 | 14,202.50 | 14,164.00 | -0.3% | +0.3% | 55968 → 55968 | 18 → 18 | -| 保留 1,024 格 | 14,235.50 | 10,072.50 | -29.2% | +41.3% | 55968 → 0 | 18 → 0 | - -## 3. 端到端:含公開提交、handler 完成與 Release - -每批最多 1,024 筆,使用空任務與空 logger。多 producer 情境固定 4 workers, -計入 producer goroutine 建立成本。入列失敗會使 benchmark 失敗,結尾確認成功數量。 -每筆平均成本包含排程與同步;不是排隊時間、單筆 latency 或 p99。 - -| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | -| --- | ---: | ---: | ---: | ---: | ---: | ---: | -| 1 producer,預設容量 | 1,389.00 | 1,408.00 | +1.4% | -1.3% | 727 → 727 | 9 → 9 | -| 1 producer,保留 1,024 格 | 1,388.50 | 1,394.50 | +0.4% | -0.4% | 726 → 672 | 9 → 9 | -| 4 producer,預設容量 | 1,466.50 | 1,575.50 | +7.4% | -6.9% | 727 → 727 | 9 → 9 | -| 4 producer,保留 1,024 格 | 1,470.00 | 1,489.00 | +1.3% | -1.3% | 727 → 672 | 9 → 9 | - -以下為既有端到端 benchmark,全部維持預設容量: - -| 情境 | 原版 ns/op | 修改後 ns/op | 時間變化 | 吞吐量變化 | B/op 前 → 後 | allocs/op 前 → 後 | -| --- | ---: | ---: | ---: | ---: | ---: | ---: | -| 1 workers | 1,176.50 | 1,170.00 | -0.6% | +0.6% | 726 → 726 | 9 → 9 | -| 4 workers | 1,364.50 | 1,441.50 | +5.6% | -5.3% | 726 → 726 | 9 → 9 | -| 12 workers | 1,872.50 | 1,929.00 | +3.0% | -2.9% | 726 → 726 | 9 → 9 | -| 4 workers+afterFn | 1,411.00 | 1,403.50 | -0.5% | +0.5% | 766 → 766 | 11 → 11 | - -保留容量減少的是 Ring backing-array 的配置位元組;Message、context、handler goroutine 等仍存在。 -攤提後的 `allocs/op` 為整數,因此端到端仍顯示 9,不能解讀成完全沒有減少 Ring 配置。 -首輪系列中有些端到端情境變慢,以下保留所有結果及樣本範圍,不將其略去或宣稱沒有退步。 - -## 預設路徑的延長複測 - -初始四輪出現 4-worker 及 4-producer 預設情境變慢,因此另以每個情境 **1 秒、6 個樣本**, -baseline/combined 交替先後執行;兩個測試分開啟動。結果不與先前 300ms 樣本混算。 - -| 情境 | baseline 中位數(範圍)ns/task | combined 中位數(範圍)ns/task | 時間變化 | -| --- | ---: | ---: | ---: | -| 4 workers,單 producer,預設容量 | 1,327.5(1,265–1,427) | 1,374(1,285–1,402) | +3.5% | -| 4 workers,4 producers,預設容量 | 1,420.5(1,358–1,471) | 1,421(1,326–1,544) | +0.04% | - -4-producer 情境未重現先前 +7.4% 的差距;4-worker 仍有 +3.5% 的中位數差異。 -兩者樣本範圍皆重疊,沒有足夠證據判定穩定退步,也不能保證效能等效。 -因此本次主張限於重試日誌與 burst 配置改善,不宣稱預設路徑加速; -若部署主要是極短任務且關注幾個百分點的吞吐差異,應在目標環境進一步確認此項風險。 - -原始結果:[baseline 複測](performance/2026-11-01/baseline-followup.txt)、 -[combined 複測](performance/2026-11-01/combined-followup.txt)、 -[複測摘要](performance/2026-11-01/followup-summary.json)。重現: - -```sh -rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-performance-followup-rerun --followup -``` - -## 個別修改的貢獻 - -| 情境(ns/op 中位數) | baseline | logging | ring | combined | -| --- | ---: | ---: | ---: | ---: | -| 重試10次 | 4,355.00 | 4,020.00 | 4,326.50 | 3,995.50 | -| Ring burst,保留1024格 | 14,235.50 | 14,264.00 | 10,067.00 | 10,072.50 | -| 4 producers,保留1024格 | 1,470.00 | 1,440.00 | 1,511.50 | 1,489.00 | - -## 樣本範圍與限制 - -| 情境 | baseline ns/op 範圍 | combined ns/op 範圍 | -| --- | ---: | ---: | -| `RingBurstDrain/retained=false` | 13948–14337 | 14019–14193 | -| `RingBurstDrain/retained=true` | 14098–14584 | 10064–10081 | -| `QueueBurstProducers/producers=1/retained=false` | 1345–1614 | 1374–1544 | -| `QueueBurstProducers/producers=1/retained=true` | 1269–1555 | 1315–1584 | -| `QueueBurstProducers/producers=4/retained=false` | 1432–1619 | 1459–1683 | -| `QueueBurstProducers/producers=4/retained=true` | 1461–1721 | 1316–1682 | -| `HandleRetry/retries=0` | 754.6–805.4 | 726.7–786.7 | -| `HandleRetry/retries=1` | 1068–1139 | 1023–1093 | -| `HandleRetry/retries=3` | 2034–2121 | 1867–1956 | -| `HandleRetry/retries=10` | 4303–4414 | 3913–4019 | -| `QueueEndToEnd/workers=1` | 1128–1209 | 1118–1202 | -| `QueueEndToEnd/workers=4` | 1230–1400 | 1371–1508 | -| `QueueEndToEnd/workers=12` | 1867–1894 | 1803–1957 | -| `QueueAfterFnEndToEnd` | 1343–1481 | 1327–1546 | - -僅四個樣本,不提供顯著性或跨機器保證;重疊範圍也不能證明兩者等效。 -本次未量測 RSS、p95/p99、真實 I/O 任務、外部 broker 或長期 soak。 -保留容量是否值得,應依實際 burst 規模與同時存在的 Queue 數量選擇;1,024 只是本次測量值。 - -## 驗證與重現 - -- 修改前、修改後 `rtk proxy go test -race ./...` 均通過(含既有 goleak 檢查)。 -- 新增測試涵蓋:舊 logger 相容性、資訊日誌啟用/停用/動態切換、重試次數、非 2 次方容量、 - FIFO 跨 wrap/resize、多次 burst、空槽釋放引用、容量拒絕、shutdown 拒絕及 NewPool 選項傳遞。 -- `golangci-lint run` 尚有 **1 個既有問題**:`job/job_test.go:47` 的 `Bool(enabled)` 被 modernize 建議改為 `new(enabled)`。 - 該檔與基準 snapshot 相同,本次沒有更動;本次新增/修改部分無其餘 lint 問題。不宣稱全套 lint 通過。 -- 此為 CORE CODE:影響共享 queue、public options 與日誌擴充契約;失敗會影響所有使用者。 - 需由維護者逐行審查,正式合併建議包含 module owner 的兩位 reviewer;PR 交付狀態與乾淨分支驗證另見下方 PR 補充。 - -每個情境 300ms、每版本四個樣本、`-cpu=12`、不使用 race instrumentation 量測效能。 -輪序:baseline → logging → ring → combined;反序;ring → baseline → combined → logging; -logging → combined → baseline → ring。版本序列執行,benchmark 期間沒有同時跑 Go tests 或 lint。 - -重建四版本並量測(輸出目錄必須不存在): - -```sh -rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-performance-rerun -rtk proxy python3 docs/performance/2026-11-01/summarize.py /tmp/queue-performance-rerun -``` - -重現腳本從基準 commit 加上當時 diff 還原版本,套用 [fixtures.json / implementation](performance/2026-11-01/fixtures.json) 與相同 benchmark, -並核對 SHA256;已執行 `--prepare-only` 驗證四個版本均可完整重建且 hash 一致。 -量測實作由 fixture patch 保存,不依賴目前 queue.go 是否包含其他本機修改;benchmark 檔案仍須符合 hash。 - -- 原始數據:[baseline](performance/2026-11-01/baseline.txt)、[logging](performance/2026-11-01/logging.txt)、[ring](performance/2026-11-01/ring.txt)、[combined](performance/2026-11-01/combined.txt)。 -- [四輪摘要與完整樣本 JSON](performance/2026-11-01/summary.json)、[版本與檔案 SHA256](performance/2026-11-01/manifest.json)。 -- [重現腳本](performance/2026-11-01/run.py)、[彙整腳本](performance/2026-11-01/summarize.py)。 - -回復本次修改時,只移除 InfoLogger/重試檢查及最低容量選項相關差異; -不要還原整份 queue.go,以免覆蓋開始前既有的使用者修改。 - -## PR supplement: clean master versus the actual PR - -The PR branch `perf/queue-allocation-costs` includes only logging checks, Ring retention, tests and evidence. -This comparison uses clean `adf9a1c` versus the actual PR implementation, excluding the pre-existing local -retry-timer reuse and Jitter fixes. It is separate from the historical working-tree comparison above. - -Same machine, 300ms per case, two rounds of three samples each (six samples per version). -Order: base then head; head then base. Runs were sequential, without concurrent Go tests or lint. -The base uses a test-only no-op retention adapter, retaining the original resizing policy. - -| Scenario | base ns/op median (range) | PR ns/op median (range) | Time change | B/op before -> after | allocs/op before -> after | -| --- | ---: | ---: | ---: | ---: | ---: | -| `RingBurstDrain/retained=false` | 14293 (14050-14449) | 14329 (13951-14447) | +0.3% | 55968 -> 55968 | 18 -> 18 | -| `RingBurstDrain/retained=true` | 14229 (13945-14566) | 10170 (10080-10326) | -28.5% | 55968 -> 0 | 18 -> 0 | -| `QueueBurstProducers/producers=1/retained=false` | 1357.5 (1298-1452) | 1385 (1333-1458) | +2.0% | 726 -> 726 | 9 -> 9 | -| `QueueBurstProducers/producers=1/retained=true` | 1360.5 (1272-1460) | 1408 (1327-1434) | +3.5% | 726 -> 672 | 9 -> 9 | -| `QueueBurstProducers/producers=4/retained=false` | 1412 (1369-1535) | 1452.5 (1377-1536) | +2.9% | 727 -> 727 | 9 -> 9 | -| `QueueBurstProducers/producers=4/retained=true` | 1482.5 (1397-1561) | 1446.5 (1321-1549) | -2.4% | 727 -> 672 | 9 -> 9 | -| `HandleRetry/retries=0` | 753.15 (734.3-796.5) | 769 (747.9-800.7) | +2.1% | 576 -> 576 | 8 -> 8 | -| `HandleRetry/retries=1` | 1081.5 (1028-1137) | 1040.5 (1020-1064) | -3.8% | 856 -> 824 | 12 -> 11 | -| `HandleRetry/retries=3` | 1704.5 (1613-1785) | 1619 (1609-1680) | -5.0% | 1416 -> 1320 | 20 -> 17 | -| `HandleRetry/retries=10` | 3705 (3519-3881) | 3471.5 (3414-3552) | -6.3% | 3376 -> 3056 | 48 -> 38 | -| `QueueEndToEnd/workers=1` | 1196.5 (1131-1212) | 1157 (1132-1191) | -3.3% | 726 -> 726 | 9 -> 9 | -| `QueueEndToEnd/workers=4` | 1412.5 (1297-1506) | 1371.5 (1273-1450) | -2.9% | 726 -> 726 | 9 -> 9 | -| `QueueEndToEnd/workers=12` | 1859.5 (1718-2086) | 1863 (1776-1901) | +0.2% | 726 -> 726 | 9 -> 9 | -| `QueueAfterFnEndToEnd` | 1458 (1281-1717) | 1347 (1325-1369) | -7.6% | 766 -> 766 | 11 -> 11 | - -The evidence supports lower allocation costs, not a general end-to-end throughput improvement. -Default-capacity timings vary; neither acceleration nor equivalence is guaranteed by these medians. -Ring burst units are per 1,024-task batch; other cases are per task. Initial preallocation is excluded -from timing, while idle backing storage still increases from 32 B to 16 KiB when retention is enabled. - -Isolated PR validation: `go test -race ./...` passed; `go tool -modfile=go.tools.mod golangci-lint run` -reported **0 issues**; `git diff --check` passed. The historical lint warning above is not part of this PR. -The historical reproduction script also passed `--prepare-only` from the isolated worktree, -matching all four source manifests. - -```sh -rtk proxy python3 docs/performance/2026-11-01/pr-compare.py /tmp/queue-pr-comparison -``` - -The destination must not exist. The script extracts the clean base twice and overlays the PR's four -production files on the head variant, using identical benchmarks. It writes source hashes; compare -those against this report when reproducing from a later source version. - -- [PR base raw samples](performance/2026-11-01/pr-base.txt), [PR head raw samples](performance/2026-11-01/pr-head.txt). -- [PR summary](performance/2026-11-01/pr-summary.json), [PR source hashes](performance/2026-11-01/pr-manifest.json). -- [PR comparison script](performance/2026-11-01/pr-compare.py). diff --git a/docs/performance/2026-11-01/baseline-followup.txt b/docs/performance/2026-11-01/baseline-followup.txt deleted file mode 100644 index 7d07ef2..0000000 --- a/docs/performance/2026-11-01/baseline-followup.txt +++ /dev/null @@ -1,120 +0,0 @@ - -# Round 1, 2026-11-01T22:24:33.396558 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 761044 1363 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.215s - -# Round 1, 2026-11-01T22:24:34.837088 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 847994 1412 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.287s - -# Round 2, 2026-11-01T22:24:47.207597 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 870998 1304 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.328s - -# Round 2, 2026-11-01T22:24:48.748672 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 819793 1471 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.321s - -# Round 3, 2026-11-01T22:24:51.288601 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 760422 1351 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.227s - -# Round 3, 2026-11-01T22:24:52.735962 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 852685 1457 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.277s - -# Round 4, 2026-11-01T22:25:05.451919 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 856459 1427 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.340s - -# Round 4, 2026-11-01T22:25:08.004882 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 739393 1423 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.253s - -# Round 5, 2026-11-01T22:25:09.475491 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 929649 1265 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.269s - -# Round 5, 2026-11-01T22:25:11.957250 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 870865 1358 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.238s - -# Round 6, 2026-11-01T22:25:23.457914 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 918351 1297 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.370s - -# Round 6, 2026-11-01T22:25:26.037799 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 807738 1418 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.322s diff --git a/docs/performance/2026-11-01/baseline.txt b/docs/performance/2026-11-01/baseline.txt deleted file mode 100644 index 5fe4cf6..0000000 --- a/docs/performance/2026-11-01/baseline.txt +++ /dev/null @@ -1,92 +0,0 @@ - -# Round 1, 2026-11-01T22:22:23.925519 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 25048 13948 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25682 14098 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 249775 1405 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 278534 1448 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 256404 1501 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 241042 1461 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 447306 805.4 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 307040 1139 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 171444 2121 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 76837 4414 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 295167 1209 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 239550 1357 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 187909 1876 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 247680 1481 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.890s - -# Round 2, 2026-11-01T22:23:06.709635 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24146 14319 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25065 14584 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 203686 1614 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 228826 1555 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 224498 1619 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 249516 1462 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 467152 768.0 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 323049 1087 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 176463 2049 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 83122 4355 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 300956 1169 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 242416 1400 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 199616 1867 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 266316 1396 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.693s - -# Round 3, 2026-11-01T22:23:18.629265 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24349 14337 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 24834 14280 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 275296 1373 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 278055 1269 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 265736 1432 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 274352 1478 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 471948 759.7 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 320318 1089 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 179661 2034 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 82770 4303 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 307252 1184 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 254511 1372 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 185187 1869 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 282591 1426 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.793s - -# Round 4, 2026-11-01T22:23:48.779074 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24417 14086 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25503 14191 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 297747 1345 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 304888 1329 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 262864 1432 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 260905 1721 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 495412 754.6 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 309838 1068 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 167715 2039 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 81021 4355 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 316011 1128 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 295464 1230 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 203437 1894 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 256291 1343 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.861s diff --git a/docs/performance/2026-11-01/combined-followup.txt b/docs/performance/2026-11-01/combined-followup.txt deleted file mode 100644 index c67213e..0000000 --- a/docs/performance/2026-11-01/combined-followup.txt +++ /dev/null @@ -1,120 +0,0 @@ - -# Round 1, 2026-11-01T22:24:37.343443 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 934442 1285 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.240s - -# Round 1, 2026-11-01T22:24:39.796123 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 849093 1410 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.263s - -# Round 2, 2026-11-01T22:24:42.277860 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 865383 1389 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.216s - -# Round 2, 2026-11-01T22:24:44.712534 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 857128 1428 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.279s - -# Round 3, 2026-11-01T22:24:55.230697 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 913377 1359 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.303s - -# Round 3, 2026-11-01T22:24:57.745381 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 896079 1326 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.265s - -# Round 4, 2026-11-01T22:25:00.234877 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 921465 1402 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.400s - -# Round 4, 2026-11-01T22:25:02.852699 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 848329 1428 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.382s - -# Round 5, 2026-11-01T22:25:14.409187 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 916866 1309 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.295s - -# Round 5, 2026-11-01T22:25:16.914861 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 823438 1414 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.276s - -# Round 6, 2026-11-01T22:25:19.406111 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueEndToEnd$/^workers=4$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueEndToEnd/workers=4-12 895750 1394 ns/op 726 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 2.275s - -# Round 6, 2026-11-01T22:25:21.890951 -# ['go', 'test', '-run', '^$', '-bench', '^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$', '-benchmem', '-benchtime=1s', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkQueueBurstProducers/producers=4/retained=false-12 762250 1544 ns/op 727 B/op 9 allocs/op -PASS -ok github.com/golang-queue/queue 1.357s diff --git a/docs/performance/2026-11-01/combined.txt b/docs/performance/2026-11-01/combined.txt deleted file mode 100644 index f7ef625..0000000 --- a/docs/performance/2026-11-01/combined.txt +++ /dev/null @@ -1,92 +0,0 @@ - -# Round 1, 2026-11-01T22:22:42.666787 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 23170 14193 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35430 10074 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 254922 1544 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 260074 1468 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 249034 1481 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 234189 1496 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 436939 765.3 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 340999 1062 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 185266 1949 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 87391 4007 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 297313 1200 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 254032 1508 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 202423 1917 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 245788 1546 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.936s - -# Round 2, 2026-11-01T22:22:48.934194 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 25156 14019 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35642 10064 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 248974 1418 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 257126 1315 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 235455 1459 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 264558 1482 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 441595 786.7 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 327553 1093 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 183444 1956 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 89738 4019 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 299319 1202 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 279015 1502 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 198405 1957 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 249853 1455 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.723s - -# Round 3, 2026-11-01T22:23:24.635688 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24751 14145 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35778 10071 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 241813 1398 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 236890 1584 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 223633 1670 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 242611 1682 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 496485 739.8 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 345160 1046 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 179949 1925 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 90358 3984 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 321780 1140 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 266468 1381 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 206379 1941 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 275280 1327 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.770s - -# Round 4, 2026-11-01T22:23:42.795291 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24978 14183 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35652 10081 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 298627 1374 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 277252 1321 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 283987 1683 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 239220 1316 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 489903 726.7 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 348201 1023 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 188937 1867 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 91676 3913 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 320838 1118 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 298851 1371 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 177133 1803 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 270514 1352 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.767s diff --git a/docs/performance/2026-11-01/fixtures.json b/docs/performance/2026-11-01/fixtures.json deleted file mode 100644 index adc32de..0000000 --- a/docs/performance/2026-11-01/fixtures.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "baseline": [ - "diff --git a/handle_result_test.go b/handle_result_test.go\n", - "index 505bb41..0173337 100644\n", - "--- a/handle_result_test.go\n", - "+++ b/handle_result_test.go\n", - "@@ -4,6 +4,7 @@ import (\n", - " \t\"context\"\n", - " \t\"errors\"\n", - " \t\"testing\"\n", - "+\t\"testing/synctest\"\n", - " \t\"time\"\n", - " \n", - " \t\"github.com/golang-queue/queue/job\"\n", - "@@ -121,3 +122,38 @@ func TestResultProtocolRepeatedRetries(t *testing.T) {\n", - " \t\trequire.Equal(t, 11, attempts)\n", - " \t}\n", - " }\n", - "+\n", - "+// Virtual time verifies that resetting the timer preserves every retry delay.\n", - "+func TestRetryTimerDelays(t *testing.T) {\n", - "+\tfor _, fixed := range []bool{false, true} {\n", - "+\t\tt.Run(map[bool]string{false: \"backoff\", true: \"fixed\"}[fixed], func(t *testing.T) {\n", - "+\t\t\tsynctest.Test(t, func(t *testing.T) {\n", - "+\t\t\t\tq, err := NewQueue(WithWorker(NewRing()), WithLogger(NewEmptyLogger()))\n", - "+\t\t\t\trequire.NoError(t, err)\n", - "+\t\t\t\tt.Cleanup(q.Release)\n", - "+\t\t\t\tvar attempts int\n", - "+\t\t\t\topts := job.AllowOption{\n", - "+\t\t\t\t\tRetryCount: job.Int64(3),\n", - "+\t\t\t\t\tRetryMin: job.Time(10 * time.Millisecond),\n", - "+\t\t\t\t\tRetryMax: job.Time(time.Second),\n", - "+\t\t\t\t}\n", - "+\t\t\t\twant := 70 * time.Millisecond // 10 + 20 + 40\n", - "+\t\t\t\tif fixed {\n", - "+\t\t\t\t\topts.RetryDelay = job.Time(10 * time.Millisecond)\n", - "+\t\t\t\t\twant = 30 * time.Millisecond\n", - "+\t\t\t\t}\n", - "+\t\t\t\tm := job.NewTask(func(context.Context) error {\n", - "+\t\t\t\t\tattempts++\n", - "+\t\t\t\t\tif attempts < 4 {\n", - "+\t\t\t\t\t\treturn errors.New(\"retry\")\n", - "+\t\t\t\t\t}\n", - "+\t\t\t\t\treturn nil\n", - "+\t\t\t\t}, opts)\n", - "+\t\t\t\tstart := time.Now()\n", - "+\t\t\t\trequire.NoError(t, q.handle(&m))\n", - "+\t\t\t\trequire.Equal(t, 4, attempts)\n", - "+\t\t\t\trequire.Equal(t, want, time.Since(start))\n", - "+\t\t\t})\n", - "+\t\t})\n", - "+\t}\n", - "+}\n", - "diff --git a/job/job.go b/job/job.go\n", - "index 17246f4..b714882 100644\n", - "--- a/job/job.go\n", - "+++ b/job/job.go\n", - "@@ -84,6 +84,7 @@ func NewMessage(m core.QueuedMessage, opts ...AllowOption) Message {\n", - " \t\tRetryFactor: o.retryFactor,\n", - " \t\tRetryMin: o.retryMin,\n", - " \t\tRetryMax: o.retryMax,\n", - "+\t\tJitter: o.jitter,\n", - " \t\tTimeout: o.timeout,\n", - " \t\tBody: m.Bytes(),\n", - " \t}\n", - "@@ -99,6 +100,7 @@ func NewTask(task TaskFunc, opts ...AllowOption) Message {\n", - " \t\tRetryFactor: o.retryFactor,\n", - " \t\tRetryMin: o.retryMin,\n", - " \t\tRetryMax: o.retryMax,\n", - "+\t\tJitter: o.jitter,\n", - " \t\tTask: task,\n", - " \t}\n", - " }\n", - "diff --git a/job/job_test.go b/job/job_test.go\n", - "index c9aa133..f6dd482 100644\n", - "--- a/job/job_test.go\n", - "+++ b/job/job_test.go\n", - "@@ -1,6 +1,7 @@\n", - " package job\n", - " \n", - " import (\n", - "+\t\"context\"\n", - " \t\"testing\"\n", - " \t\"time\"\n", - " \n", - "@@ -40,3 +41,14 @@ func TestMessageEncodeDecode(t *testing.T) {\n", - " \tassert.Equal(t, 20*time.Second, out.RetryMax)\n", - " \tassert.InEpsilon(t, 4.0, out.RetryFactor, 1e-9)\n", - " }\n", - "+\n", - "+func TestConstructorsPreserveJitter(t *testing.T) {\n", - "+\tfor _, enabled := range []bool{false, true} {\n", - "+\t\topts := AllowOption{Jitter: Bool(enabled)}\n", - "+\t\tmessage := NewMessage(mockMessage{message: \"foo\"}, opts)\n", - "+\t\ttask := NewTask(func(context.Context) error { return nil }, opts)\n", - "+\t\tassert.Equal(t, enabled, message.Jitter)\n", - "+\t\tassert.Equal(t, enabled, task.Jitter)\n", - "+\t\tassert.Equal(t, enabled, Decode(message.Bytes()).Jitter)\n", - "+\t}\n", - "+}\n", - "diff --git a/queue.go b/queue.go\n", - "index 1c2ae74..2d38820 100644\n", - "--- a/queue.go\n", - "+++ b/queue.go\n", - "@@ -239,8 +239,12 @@ func (q *Queue) handle(m *job.Message) error {\n", - " \n", - " \t// Run the job in a separate goroutine to support timeout and panic recovery.\n", - " \tgo func() {\n", - "+\t\tvar retryTimer *time.Timer\n", - " \t\t// Forward panic through the same result channel.\n", - " \t\tdefer func() {\n", - "+\t\t\tif retryTimer != nil {\n", - "+\t\t\t\tretryTimer.Stop()\n", - "+\t\t\t}\n", - " \t\t\tif p := recover(); p != nil {\n", - " \t\t\t\tdone <- result{panicValue: p}\n", - " \t\t\t}\n", - "@@ -276,8 +280,15 @@ func (q *Queue) handle(m *job.Message) error {\n", - " \t\t\t\tdelay = b.Duration()\n", - " \t\t\t}\n", - " \n", - "+\t\t\t// Allocate only on the first retry and reuse after consuming each tick.\n", - "+\t\t\tif retryTimer == nil {\n", - "+\t\t\t\tretryTimer = time.NewTimer(delay)\n", - "+\t\t\t} else {\n", - "+\t\t\t\tretryTimer.Reset(delay)\n", - "+\t\t\t}\n", - "+\n", - " \t\t\tselect {\n", - "-\t\t\tcase <-time.After(delay): // Wait before retrying\n", - "+\t\t\tcase <-retryTimer.C: // Wait before retrying\n", - " \t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", - " \t\t\tcase <-ctx.Done(): // Timeout reached\n", - " \t\t\t\terr = ctx.Err()\n" - ], - "implementation": [ - "--- a/queue.go\n", - "+++ b/queue.go\n", - "@@ -289,7 +289,9 @@\n", - " \n", - " \t\t\tselect {\n", - " \t\t\tcase <-retryTimer.C: // Wait before retrying\n", - "-\t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", - "+\t\t\t\tif infoEnabled(q.logger) {\n", - "+\t\t\t\t\tq.logger.Infof(\"retry remaining times: %d, delay time: %s\", m.RetryCount, delay)\n", - "+\t\t\t\t}\n", - " \t\t\tcase <-ctx.Done(): // Timeout reached\n", - " \t\t\t\terr = ctx.Err()\n", - " \t\t\t\tbreak loop\n", - "--- a/logger.go\n", - "+++ b/logger.go\n", - "@@ -33,6 +33,21 @@\n", - " \t// Fatal logs fatal errors with stack trace information.\n", - " \t// Used for panics and critical failures.\n", - " \tFatal(args ...any)\n", - "+}\n", - "+\n", - "+// InfoLogger optionally lets a Logger disable informational messages before the\n", - "+// queue constructs variadic arguments. Loggers without it remain enabled.\n", - "+// InfoEnabled must be safe to call concurrently; it is checked on every retry.\n", - "+type InfoLogger interface {\n", - "+\tLogger\n", - "+\tInfoEnabled() bool\n", - "+}\n", - "+\n", - "+func infoEnabled(l Logger) bool {\n", - "+\tif l, ok := l.(InfoLogger); ok {\n", - "+\t\treturn l.InfoEnabled()\n", - "+\t}\n", - "+\treturn true\n", - " }\n", - " \n", - " // NewLogger creates a standard logger that writes to stderr with timestamps.\n", - "@@ -127,3 +142,6 @@\n", - " func (l emptyLogger) Info(args ...any) {}\n", - " func (l emptyLogger) Error(args ...any) {}\n", - " func (l emptyLogger) Fatal(args ...any) {}\n", - "+\n", - "+// InfoEnabled disables informational argument construction for the no-op logger.\n", - "+func (l emptyLogger) InfoEnabled() bool { return false }\n", - "--- a/ring.go\n", - "+++ b/ring.go\n", - "@@ -21,6 +21,7 @@\n", - " // - When head == tail, the queue is empty\n", - " // - Both pointers wrap around using modulo arithmetic\n", - " type Ring struct {\n", - "+\tminCapacity int // Minimum retained slots, configured at construction\n", - " \tsync.Mutex\n", - " \ttaskQueue []core.TaskMessage // Circular buffer storing queued tasks\n", - " \trunFunc func(context.Context, core.TaskMessage) error // Function to execute when processing tasks\n", - "@@ -131,8 +132,11 @@\n", - " \n", - " \t// Shrink buffer if at most 25% full (to save memory)\n", - " \t// Minimum buffer size is 2 to maintain circular buffer structure\n", - "-\tif n := len(s.taskQueue) / 2; n >= 2 && s.count <= len(s.taskQueue)/4 {\n", - "-\t\ts.resize(n)\n", - "+\tif n := len(\n", - "+\t\ts.taskQueue,\n", - "+\t) / 2; len(s.taskQueue) > s.minCapacity &&\n", - "+\t\ts.count <= len(s.taskQueue)/4 {\n", - "+\t\ts.resize(max(n, s.minCapacity))\n", - " \t}\n", - " \n", - " \treturn data, nil\n", - "@@ -179,7 +183,7 @@\n", - " }\n", - " \n", - " // NewRing creates a new Ring instance with the provided options.\n", - "-// It initializes the task queue with a default size of 2, sets the capacity\n", - "+// It initializes the task queue with at least 2 slots (or WithQueueMinCapacity), sets the capacity\n", - " // based on the provided options, and configures the logger and run function.\n", - " // The function returns a pointer to the newly created Ring instance.\n", - " //\n", - "@@ -192,12 +196,17 @@\n", - " //\t*Ring - A pointer to the newly created Ring instance.\n", - " func NewRing(opts ...Option) *Ring {\n", - " \to := NewOptions(opts...)\n", - "+\tminCapacity := max(2, o.queueMinCapacity)\n", - "+\tif o.queueSize > 0 {\n", - "+\t\tminCapacity = max(2, min(minCapacity, o.queueSize))\n", - "+\t}\n", - " \tw := &Ring{\n", - "-\t\ttaskQueue: make([]core.TaskMessage, 2),\n", - "-\t\tcapacity: o.queueSize,\n", - "-\t\texit: make(chan struct{}),\n", - "-\t\tlogger: o.logger,\n", - "-\t\trunFunc: o.fn,\n", - "+\t\tminCapacity: minCapacity,\n", - "+\t\ttaskQueue: make([]core.TaskMessage, minCapacity),\n", - "+\t\tcapacity: o.queueSize,\n", - "+\t\texit: make(chan struct{}),\n", - "+\t\tlogger: o.logger,\n", - "+\t\trunFunc: o.fn,\n", - " \t}\n", - " \n", - " \treturn w\n", - "--- a/options.go\n", - "+++ b/options.go\n", - "@@ -61,6 +61,17 @@\n", - " \t})\n", - " }\n", - " \n", - "+// WithQueueMinCapacity sets the Ring buffer's initial and minimum retained slots.\n", - "+// Values below 2 use 2 (the default). A positive WithQueueSize limit caps this\n", - "+// setting, except that the buffer always has at least 2 slots. The pending-task\n", - "+// limit is unchanged. Retaining slots reduces burst allocations at the cost of\n", - "+// idle memory; dequeued task references are still cleared. Other backends ignore it.\n", - "+func WithQueueMinCapacity(num int) Option {\n", - "+\treturn OptionFunc(func(q *Options) {\n", - "+\t\tq.queueMinCapacity = num\n", - "+\t})\n", - "+}\n", - "+\n", - " // WithLogger sets a custom logger for queue events and errors.\n", - " // By default, the queue uses a standard logger that writes to stderr.\n", - " // Use NewEmptyLogger() to disable logging entirely.\n", - "@@ -155,14 +166,15 @@\n", - " // Options holds the configuration parameters for a Queue.\n", - " // Use the With* functions to configure these options when creating a queue.\n", - " type Options struct {\n", - "-\tworkerCount int64 // Number of concurrent worker goroutines\n", - "-\tlogger Logger // Logger for queue events\n", - "-\tqueueSize int // Maximum queue capacity, 0 means unlimited\n", - "-\tworker core.Worker // Worker implementation for queue backend\n", - "-\tfn func(context.Context, core.TaskMessage) error // Task handler function\n", - "-\tafterFn func() // Callback executed after each job\n", - "-\tmetric Metric // Metrics collector\n", - "-\tretryInterval time.Duration // Polling interval when queue is empty\n", - "+\tqueueMinCapacity int // Initial and minimum retained Ring slots; normalized by NewRing\n", - "+\tworkerCount int64 // Number of concurrent worker goroutines\n", - "+\tlogger Logger // Logger for queue events\n", - "+\tqueueSize int // Maximum queue capacity, 0 means unlimited\n", - "+\tworker core.Worker // Worker implementation for queue backend\n", - "+\tfn func(context.Context, core.TaskMessage) error // Task handler function\n", - "+\tafterFn func() // Callback executed after each job\n", - "+\tmetric Metric // Metrics collector\n", - "+\tretryInterval time.Duration // Polling interval when queue is empty\n", - " }\n", - " \n", - " // NewOptions creates an Options struct with default values and applies any provided options.\n" - ] -} diff --git a/docs/performance/2026-11-01/followup-summary.json b/docs/performance/2026-11-01/followup-summary.json deleted file mode 100644 index 03da2b6..0000000 --- a/docs/performance/2026-11-01/followup-summary.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "baseline": { - "BenchmarkQueueEndToEnd/workers=4-12": { - "samples_ns": [ - 1363.0, - 1304.0, - 1351.0, - 1427.0, - 1265.0, - 1297.0 - ], - "median": 1327.5, - "min": 1265.0, - "max": 1427.0 - }, - "BenchmarkQueueBurstProducers/producers=4/retained=false-12": { - "samples_ns": [ - 1412.0, - 1471.0, - 1457.0, - 1423.0, - 1358.0, - 1418.0 - ], - "median": 1420.5, - "min": 1358.0, - "max": 1471.0 - } - }, - "combined": { - "BenchmarkQueueEndToEnd/workers=4-12": { - "samples_ns": [ - 1285.0, - 1389.0, - 1359.0, - 1402.0, - 1309.0, - 1394.0 - ], - "median": 1374.0, - "min": 1285.0, - "max": 1402.0 - }, - "BenchmarkQueueBurstProducers/producers=4/retained=false-12": { - "samples_ns": [ - 1410.0, - 1428.0, - 1326.0, - 1428.0, - 1414.0, - 1544.0 - ], - "median": 1421.0, - "min": 1326.0, - "max": 1544.0 - } - } -} diff --git a/docs/performance/2026-11-01/logging.txt b/docs/performance/2026-11-01/logging.txt deleted file mode 100644 index 602556a..0000000 --- a/docs/performance/2026-11-01/logging.txt +++ /dev/null @@ -1,92 +0,0 @@ - -# Round 1, 2026-11-01T22:22:30.147043 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 23188 13854 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25768 14294 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 270619 1343 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 257908 1387 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 234274 1561 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 262272 1453 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 442380 782.6 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 313786 1090 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 190357 1977 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 87452 4064 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 306158 1196 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 266751 1424 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 199336 1817 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 263986 1476 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.956s - -# Round 2, 2026-11-01T22:23:00.770724 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24153 14515 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 24879 14166 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 256844 1457 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 255770 1361 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 266577 1480 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 262560 1412 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 453585 777.1 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 339148 1048 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 186278 1950 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 85728 4134 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 301003 1175 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 263035 1403 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 202408 1831 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 253057 1322 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.722s - -# Round 3, 2026-11-01T22:23:30.624045 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24672 14139 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 24586 14727 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 245457 1566 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 250617 1531 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 239944 1377 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 251965 1427 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 502182 736.9 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 341782 1021 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 187906 1910 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 91276 3976 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 321880 1146 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 269452 1247 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 208645 1776 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 249208 1379 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.703s - -# Round 4, 2026-11-01T22:23:36.542673 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24909 14276 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 24598 14234 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 256406 1344 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 279430 1340 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 249990 1379 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 235564 1681 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 471766 749.3 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 350589 1065 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 191136 1898 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=10-12 91230 3903 ns/op 824 B/op 11 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 320517 1117 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 272664 1334 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 199788 1814 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 274263 1337 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 6.036s diff --git a/docs/performance/2026-11-01/manifest.json b/docs/performance/2026-11-01/manifest.json deleted file mode 100644 index f826f85..0000000 --- a/docs/performance/2026-11-01/manifest.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "head": "adf9a1cf9bd0424c9c1286754083bd6038c985df", - "go": "go version go1.26.10 darwin/arm64", - "variants": { - "baseline": { - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", - "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "d2f1fdc64693f6aa3f8aa8e49016071498e15bce7f9750cd1061fe75dcf9ee87", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "retention_compat_test.go": "c00bf1b96525c4fcc5341e2907748c8f6e938d8f355b8e6c8fcd48007e39c5a6", - "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - }, - "logging": { - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", - "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "0830d72280f449e1633a994e6af8d2431fdd0360133d222b3a4b0152ba9589be", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "retention_compat_test.go": "c00bf1b96525c4fcc5341e2907748c8f6e938d8f355b8e6c8fcd48007e39c5a6", - "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - }, - "ring": { - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", - "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "d2f1fdc64693f6aa3f8aa8e49016071498e15bce7f9750cd1061fe75dcf9ee87", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - }, - "combined": { - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "2ff0c0e35884001a20260c6f7a91d38d66c67b5c5074275061ad58c77f7ff37a", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "002eb0799961ce9333d86ef7afd36919de51cb966c24493875646d0bb06ae5d4", - "job/job_test.go": "3652cb3bc1e5ae32d457c4bb176b24850219a15d04570064cb5edc6973db745e", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "0830d72280f449e1633a994e6af8d2431fdd0360133d222b3a4b0152ba9589be", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - } - } -} diff --git a/docs/performance/2026-11-01/pr-base.txt b/docs/performance/2026-11-01/pr-base.txt deleted file mode 100644 index 52e5486..0000000 --- a/docs/performance/2026-11-01/pr-base.txt +++ /dev/null @@ -1,100 +0,0 @@ - -# Round 1: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 23605 14055 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25783 14184 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25678 14050 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25772 13945 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25915 14035 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25334 14061 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 266343 1345 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 265754 1452 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 261768 1432 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 261030 1351 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 252322 1442 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 284739 1460 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 244804 1417 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 228836 1407 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 241516 1475 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 247149 1543 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 248818 1561 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 237507 1503 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 437007 796.5 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 451837 785.5 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 501886 766.2 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 311948 1129 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=1-12 317568 1136 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=1-12 307116 1137 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 202774 1785 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=3-12 198894 1774 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=3-12 209308 1783 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=10-12 92758 3830 ns/op 3376 B/op 48 allocs/op -BenchmarkHandleRetry/retries=10-12 91801 3881 ns/op 3376 B/op 48 allocs/op -BenchmarkHandleRetry/retries=10-12 92510 3873 ns/op 3376 B/op 48 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 288028 1209 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 303657 1212 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 292414 1199 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 242575 1422 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 276072 1506 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 252380 1449 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 184822 1925 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 196460 1978 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 160813 2086 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 216685 1712 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 212546 1717 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 216584 1505 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 17.349s - -# Round 2: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24957 14403 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25207 14402 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 24310 14449 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25306 14397 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25212 14501 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 25014 14566 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 247491 1370 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 296893 1298 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 274621 1315 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 277650 1272 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 306274 1370 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 274818 1309 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 266371 1369 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 266102 1535 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 251109 1394 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 275982 1417 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 275528 1397 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 258381 1462 ns/op 727 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 482842 740.1 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 478311 738.4 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 499866 734.3 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 350870 1034 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=1-12 339878 1032 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=1-12 360026 1028 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 217180 1635 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=3-12 217836 1615 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=3-12 224864 1613 ns/op 1416 B/op 20 allocs/op -BenchmarkHandleRetry/retries=10-12 101126 3519 ns/op 3376 B/op 48 allocs/op -BenchmarkHandleRetry/retries=10-12 103508 3569 ns/op 3376 B/op 48 allocs/op -BenchmarkHandleRetry/retries=10-12 100224 3580 ns/op 3376 B/op 48 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 324015 1194 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 294860 1140 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 307320 1131 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 284756 1297 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 256518 1343 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 298252 1403 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 207580 1718 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 210848 1794 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 210601 1752 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 280666 1411 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 289572 1318 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 277629 1281 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 17.638s diff --git a/docs/performance/2026-11-01/pr-compare.py b/docs/performance/2026-11-01/pr-compare.py deleted file mode 100644 index 507e74e..0000000 --- a/docs/performance/2026-11-01/pr-compare.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 -"""Compare clean base with this PR. Output directory must not exist.""" -import hashlib -import json -from pathlib import Path -import shutil -import subprocess -import sys - -ROOT = Path(__file__).resolve().parents[3] -DATA = Path(__file__).resolve().parent -DEST = Path(sys.argv[1]).resolve() -DEST.mkdir(parents=True, exist_ok=False) -base = json.loads((DATA / "manifest.json").read_text())["head"] -archive = subprocess.check_output(["git", "archive", base], cwd=ROOT) -versions = ["pr-base", "pr-head"] -manifest = {"base": base, "files": {}} -for version in versions: - d = DEST / version - d.mkdir() - subprocess.run(["tar", "-xf", "-", "-C", str(d)], input=archive, check=True) - if version == "pr-head": - for name in ("queue.go", "logger.go", "ring.go", "options.go"): - shutil.copy2(ROOT / name, d / name) - else: - (d / "retention_compat_test.go").write_text( - "package queue\nfunc WithQueueMinCapacity(int) Option { return OptionFunc(func(*Options) {}) }\n") - shutil.copy2(ROOT / "burst_performance_test.go", d / "burst_performance_test.go") - manifest["files"][version] = {str(p.relative_to(d)): hashlib.sha256(p.read_bytes()).hexdigest() - for p in sorted(d.rglob("*.go"))} -(DEST / "pr-manifest.json").write_text(json.dumps(manifest, indent=2) + "\n") -pattern = "^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$" -for round_no, order in enumerate((versions, list(reversed(versions))), 1): - for version in order: - cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=300ms", "-count=3", "-cpu=12", "."] - with (DEST / (version + ".txt")).open("a") as output: - output.write(f"\n# Round {round_no}: {cmd!r}\n") - output.flush() - subprocess.run(cmd, cwd=DEST / version, stdout=output, stderr=subprocess.STDOUT, check=True) - print(f"Round {round_no}: {version}", flush=True) -print(DEST) diff --git a/docs/performance/2026-11-01/pr-head.txt b/docs/performance/2026-11-01/pr-head.txt deleted file mode 100644 index c4e4515..0000000 --- a/docs/performance/2026-11-01/pr-head.txt +++ /dev/null @@ -1,100 +0,0 @@ - -# Round 1: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 22892 13961 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25366 13951 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25720 14364 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35319 10305 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkRingBurstDrain/retained=true-12 34914 10326 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkRingBurstDrain/retained=true-12 34915 10207 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 249838 1452 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 251354 1458 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 264633 1396 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 257113 1411 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 270178 1434 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 255548 1338 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 236432 1401 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 249825 1508 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 250600 1536 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 217346 1538 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 256238 1459 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 262090 1549 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 473252 800.7 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 470780 767.8 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 492057 772.5 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 326998 1064 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=1-12 327853 1048 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=1-12 335607 1064 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 218372 1680 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=3-12 216722 1660 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=3-12 220905 1618 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=10-12 102895 3552 ns/op 3056 B/op 38 allocs/op -BenchmarkHandleRetry/retries=10-12 101895 3499 ns/op 3056 B/op 38 allocs/op -BenchmarkHandleRetry/retries=10-12 102334 3518 ns/op 3056 B/op 38 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 302487 1181 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 293979 1191 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 295192 1187 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 247990 1450 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 254553 1408 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 264274 1413 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 198960 1901 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 186951 1895 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 195313 1868 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 272322 1340 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 270619 1369 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 273514 1365 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 17.236s - -# Round 2: ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=3', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24934 14419 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25160 14447 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=false-12 25670 14294 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35720 10101 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35620 10133 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35757 10080 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 261014 1374 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 264873 1333 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 271280 1333 ns/op 726 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 285717 1327 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 296550 1414 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 263340 1405 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 257840 1464 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 251316 1441 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 254326 1377 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 247804 1410 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 282567 1321 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 276776 1434 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 482886 770.2 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 454911 747.9 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=0-12 488773 751.1 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 343803 1033 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=1-12 345848 1020 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=1-12 341305 1021 ns/op 824 B/op 11 allocs/op -BenchmarkHandleRetry/retries=3-12 225166 1620 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=3-12 223555 1616 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=3-12 224594 1609 ns/op 1320 B/op 17 allocs/op -BenchmarkHandleRetry/retries=10-12 105237 3444 ns/op 3056 B/op 38 allocs/op -BenchmarkHandleRetry/retries=10-12 105279 3425 ns/op 3056 B/op 38 allocs/op -BenchmarkHandleRetry/retries=10-12 105626 3414 ns/op 3056 B/op 38 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 321027 1133 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 319243 1132 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 319968 1132 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 292736 1273 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 289569 1335 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 268843 1307 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 195470 1776 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 212103 1858 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 200174 1835 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 280508 1354 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 268759 1325 ns/op 766 B/op 11 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 266521 1338 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 17.123s diff --git a/docs/performance/2026-11-01/pr-manifest.json b/docs/performance/2026-11-01/pr-manifest.json deleted file mode 100644 index de06756..0000000 --- a/docs/performance/2026-11-01/pr-manifest.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "base": "adf9a1cf9bd0424c9c1286754083bd6038c985df", - "files": { - "pr-base": { - "_example/example01/main.go": "4fcc55f53ed728e5affcdecd365ea4ab860dd487a3b2c0c38b2e24084d79c03f", - "_example/example02/main.go": "aa3387bd93bbfb8d65a10a1e8f78ec243c5c98ec237eac467209129c59e3d447", - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "d683e39040c83de013eccfab9f4886ba572999742ccece5af74644bf98296147", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "d31de2195404c2f8a243246a106a004bddf95f9646f7062c0e1f021daf7c5d9d", - "job/job_test.go": "54030a5c0a21cf9f5b85e33d637d73fccd5193977f63f83201f43944359cc47b", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "8fc5fb3c5e261239b69e948c57853562a689abc2169f80af681228e28a5b35ac", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "8c657cb15bedca4d2df75e494d58feafcd406db3e4190769e7f3adbe709d734c", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "ef2a5345576e8ab36abb566fcb8f395bce9a5e17c233186622bced6d5a32cd5c", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "retention_compat_test.go": "7a25bbd0118bcd4f9f893b532e595f51d5ebcd56d17893331e562613efae95ff", - "ring.go": "d38f2e662c201c46278d084a751b26188a7c119c4ddd016630a6a0288f51d5d7", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - }, - "pr-head": { - "_example/example01/main.go": "4fcc55f53ed728e5affcdecd365ea4ab860dd487a3b2c0c38b2e24084d79c03f", - "_example/example02/main.go": "aa3387bd93bbfb8d65a10a1e8f78ec243c5c98ec237eac467209129c59e3d447", - "benchmark_test.go": "a3e5a9151f7e74c32b4d25ca34d6277a18d676d915a8a82800381309900cdc43", - "burst_performance_test.go": "9f70ef00e016346b057689d9585f2d07c3fd93735a5e2edfbb9b04a6b8927917", - "core/worker.go": "57b0dd236386b00c5442a7da73c8d34af3927ddcbddf515e9893c1228cdecc9c", - "errors.go": "2360bc414cf838cb6586c3dc0df78f58624f27942d840e6248b9b7fffda7a794", - "handle_performance_test.go": "477fa3a0fd21f188b1e43c616df0d4b3f6dc1e5cd5914320b383819684c83562", - "handle_result_test.go": "d683e39040c83de013eccfab9f4886ba572999742ccece5af74644bf98296147", - "job/benchmark_test.go": "cdbab5937cb71bcc8a6223b25e5504f9ef623538d45e746206b55ec099df94ab", - "job/job.go": "d31de2195404c2f8a243246a106a004bddf95f9646f7062c0e1f021daf7c5d9d", - "job/job_test.go": "54030a5c0a21cf9f5b85e33d637d73fccd5193977f63f83201f43944359cc47b", - "job/option.go": "4de8389786b2ac5ba88f2a281ce8ec5f454e72dd716bfd9126aec3821a513f0f", - "job/option_test.go": "014cf85d6b9fc4a2774c59ace3772480724aae49bc4a9429db029c4c76da5da9", - "logger.go": "96a1375ccd2875f14ff80f611bbfcee4c5aebc9c517041d22b0418389ccbfc73", - "logger_test.go": "8ee4eaf10ef58783fdf0bc29c6268dcc2d69309ca65442ea10adbae74cd159c1", - "metric.go": "c1d018eef5cb07011cb8d7789fd40986eb0763782c5a63a91fcb76c4220a937e", - "metric_test.go": "46768c041c83ed03ca7f3b1f98ffad1c5087ee0534f82f11d4ea0ec721cd533e", - "mocks/mock_queued_message.go": "ffb8f332cdecc6d9882f6f8cad28a49ee59b67a6a29207c0a1e3446952889174", - "mocks/mock_task_message.go": "265651a6a75355a4eb369d24a4e876e469488949c65b6c53141b952a38ca079a", - "mocks/mock_worker.go": "749afdc4335fca54ba6a452babf63bcdef32343de190b310269344e1cf95eef7", - "mocks/mocks.go": "0a1046af3819a403ca64f09e87da13aa7aae6b7fd0bb4e58712b780eb6e5661c", - "options.go": "341e3773fc02792aea038a0f7b9b379004270bef044e748b9f2b02fa6bcae744", - "options_test.go": "884f48667148b75e91467126704a6c785f6014e0676fc8742cb7d64f25b4ab2f", - "pool.go": "7f3256139650937ed0c267c06d0316167a3aa8973a99ad4f8c7b620088cee8df", - "pool_test.go": "3e87331c188a17ab9b1b00e7ff04b053fabdadf18d8ba9d3678dc15141cf2d07", - "queue.go": "324a7b15460ba1d0097faf13064c6f4de06e2bde71e82fd0a4fc14ca894b6992", - "queue_example_test.go": "d6b43dd265c1b1951b970dd1197d35e649e88baa0a846b3d52f51eeb0bf7c761", - "queue_performance_test.go": "e6ef2c4acd222d077b82bbbbd9cf04e2411ea0eed3513a9d7a17d484e061859f", - "queue_test.go": "08d25d4a4707f73b741482021d7a7175138d304a38096a66d98810a9ca8629fd", - "recovery.go": "686772820c23c3b32cb526934c0e9bf098d2b60c0a6151df75fd02ee20c5ab96", - "ring.go": "9b30a698cfaeed5d51f43d5d58aba7067491db05a93d74b1463e2615a5a8ab06", - "ring_performance_test.go": "133d56843339be04d5a3253f903571f4effe06103173cf3a37b1f0c5b79ed11b", - "ring_resize_test.go": "e08153ce911b91b07349fed8fae8698fc085ab12d02d102a18d404f82e0ba207", - "ring_test.go": "ff4092622e6841e203565f1b119a216aacfb443c769a27284934a15b65d67c88", - "scheduling_test.go": "5ab43e3f8cc20db0084bec8eeaa5633889d69f2184a8144e3c4efbe9575efded", - "thread.go": "0bc644bd92d927081ee3d9b369c3baba714b754dbf58d550fa05698dda38d356", - "thread_test.go": "aa3ff5c631dbca50e4c7893c642fe8b6b837a99ab11a07855d17a5b34e5aa7da" - } - } -} diff --git a/docs/performance/2026-11-01/pr-summary.json b/docs/performance/2026-11-01/pr-summary.json deleted file mode 100644 index 7b94264..0000000 --- a/docs/performance/2026-11-01/pr-summary.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "pr-base": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":14055.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14184.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14050.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14403.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14402.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14449.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14293.0,"min":14050.0,"max":14449.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":13945.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14035.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14061.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14397.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14501.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14566.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14229.0,"min":13945.0,"max":14566.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1345.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1452.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1370.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1298.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1315.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1357.5,"min":1298.0,"max":1452.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1351.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1442.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1460.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1272.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1370.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1309.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1360.5,"min":1272.0,"max":1460.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1417.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1407.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1475.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1369.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1535.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1394.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1412.0,"min":1369.0,"max":1535.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1543.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1561.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1503.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1417.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1397.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1462.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1482.5,"min":1397.0,"max":1561.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":796.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":785.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":766.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":740.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":738.4,"B/op":576.0,"allocs/op":8.0},{"ns/op":734.3,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":753.1500000000001,"min":734.3,"max":796.5},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1129.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1136.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1137.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1034.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1032.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1028.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1081.5,"min":1028.0,"max":1137.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1785.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1774.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1783.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1635.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1615.0,"B/op":1416.0,"allocs/op":20.0},{"ns/op":1613.0,"B/op":1416.0,"allocs/op":20.0}],"summary":{"ns/op":{"median":1704.5,"min":1613.0,"max":1785.0},"B/op":{"median":1416.0,"min":1416.0,"max":1416.0},"allocs/op":{"median":20.0,"min":20.0,"max":20.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":3830.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3881.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3873.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3519.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3569.0,"B/op":3376.0,"allocs/op":48.0},{"ns/op":3580.0,"B/op":3376.0,"allocs/op":48.0}],"summary":{"ns/op":{"median":3705.0,"min":3519.0,"max":3881.0},"B/op":{"median":3376.0,"min":3376.0,"max":3376.0},"allocs/op":{"median":48.0,"min":48.0,"max":48.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1209.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1212.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1199.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1194.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1140.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1131.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1196.5,"min":1131.0,"max":1212.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1422.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1506.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1449.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1297.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1343.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1403.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1412.5,"min":1297.0,"max":1506.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1925.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1978.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":2086.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1718.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1794.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1752.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1859.5,"min":1718.0,"max":2086.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1712.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1717.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1505.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1411.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1318.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1281.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1458.0,"min":1281.0,"max":1717.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - }, - "pr-head": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13961.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":13951.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14364.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14419.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14447.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14294.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14329.0,"min":13951.0,"max":14447.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10305.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10326.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10207.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10101.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10133.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10080.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10170.0,"min":10080.0,"max":10326.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1452.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1458.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1396.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1374.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1333.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1333.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1385.0,"min":1333.0,"max":1458.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1411.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1338.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1327.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1414.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1405.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1408.0,"min":1327.0,"max":1434.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1401.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1508.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1536.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1464.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1441.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1452.5,"min":1377.0,"max":1536.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1538.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1459.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1549.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1410.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1321.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1446.5,"min":1321.0,"max":1549.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":800.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":767.8,"B/op":576.0,"allocs/op":8.0},{"ns/op":772.5,"B/op":576.0,"allocs/op":8.0},{"ns/op":770.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":747.9,"B/op":576.0,"allocs/op":8.0},{"ns/op":751.1,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":769.0,"min":747.9,"max":800.7},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1048.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1033.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1020.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1021.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1040.5,"min":1020.0,"max":1064.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1680.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1660.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1618.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1620.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1616.0,"B/op":1320.0,"allocs/op":17.0},{"ns/op":1609.0,"B/op":1320.0,"allocs/op":17.0}],"summary":{"ns/op":{"median":1619.0,"min":1609.0,"max":1680.0},"B/op":{"median":1320.0,"min":1320.0,"max":1320.0},"allocs/op":{"median":17.0,"min":17.0,"max":17.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":3552.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3499.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3518.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3444.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3425.0,"B/op":3056.0,"allocs/op":38.0},{"ns/op":3414.0,"B/op":3056.0,"allocs/op":38.0}],"summary":{"ns/op":{"median":3471.5,"min":3414.0,"max":3552.0},"B/op":{"median":3056.0,"min":3056.0,"max":3056.0},"allocs/op":{"median":38.0,"min":38.0,"max":38.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1181.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1191.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1187.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1133.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1132.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1132.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1157.0,"min":1132.0,"max":1191.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1450.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1408.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1413.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1273.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1335.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1307.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1371.5,"min":1273.0,"max":1450.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1901.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1895.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1868.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1776.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1858.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1835.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1863.0,"min":1776.0,"max":1901.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1340.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1369.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1365.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1354.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1325.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1338.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1347.0,"min":1325.0,"max":1369.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - } -} diff --git a/docs/performance/2026-11-01/ring.txt b/docs/performance/2026-11-01/ring.txt deleted file mode 100644 index b504222..0000000 --- a/docs/performance/2026-11-01/ring.txt +++ /dev/null @@ -1,92 +0,0 @@ - -# Round 1, 2026-11-01T22:22:36.439723 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 23317 13895 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35805 10070 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 242037 1468 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 260857 1477 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 246873 1539 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 244254 1499 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 442185 813.2 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 315342 1142 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 175422 2022 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 80718 4334 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 301330 1230 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 251847 1462 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 189943 1795 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 254506 1453 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.896s - -# Round 2, 2026-11-01T22:22:54.867854 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24452 14114 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35808 10084 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 253450 1434 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 258792 1377 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 247558 1497 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 246758 1524 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 444896 785.1 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 313742 1166 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 174030 2068 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 82233 4401 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 288429 1197 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 214826 1724 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 176238 2038 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 218710 1608 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.689s - -# Round 3, 2026-11-01T22:23:12.607526 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24968 14169 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35637 10063 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 266533 1319 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 265105 1554 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 258612 1697 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 239036 1556 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 468074 743.7 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 341193 1085 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 175869 2064 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 82057 4319 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 298659 1185 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 254196 1447 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 186553 1856 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 275122 1375 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.802s - -# Round 4, 2026-11-01T22:23:54.862140 -# ['go', 'test', '-run', '^$', '-bench', '^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$', '-benchmem', '-benchtime=300ms', '-count=1', '-cpu=12', '.'] -goos: darwin -goarch: arm64 -pkg: github.com/golang-queue/queue -cpu: Apple M4 Pro -BenchmarkRingBurstDrain/retained=false-12 24937 14595 ns/op 32.00 retained-B 55968 B/op 18 allocs/op -BenchmarkRingBurstDrain/retained=true-12 35830 10064 ns/op 16384 retained-B 0 B/op 0 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=false-12 247706 1322 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=1/retained=true-12 280854 1324 ns/op 672 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=false-12 281216 1379 ns/op 727 B/op 9 allocs/op -BenchmarkQueueBurstProducers/producers=4/retained=true-12 263732 1399 ns/op 672 B/op 9 allocs/op -BenchmarkHandleRetry/retries=0-12 474039 739.4 ns/op 576 B/op 8 allocs/op -BenchmarkHandleRetry/retries=1-12 335504 1044 ns/op 856 B/op 12 allocs/op -BenchmarkHandleRetry/retries=3-12 181171 1974 ns/op 920 B/op 14 allocs/op -BenchmarkHandleRetry/retries=10-12 84126 4306 ns/op 1144 B/op 21 allocs/op -BenchmarkQueueEndToEnd/workers=1-12 323054 1152 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=4-12 265258 1350 ns/op 726 B/op 9 allocs/op -BenchmarkQueueEndToEnd/workers=12-12 192166 1795 ns/op 726 B/op 9 allocs/op -BenchmarkQueueAfterFnEndToEnd-12 274467 1440 ns/op 766 B/op 11 allocs/op -PASS -ok github.com/golang-queue/queue 5.694s diff --git a/docs/performance/2026-11-01/run.py b/docs/performance/2026-11-01/run.py deleted file mode 100644 index 117564c..0000000 --- a/docs/performance/2026-11-01/run.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 -"""Rebuild four variants and reproduce measurements from the report's source tree. -Run: rtk proxy python3 docs/performance/2026-11-01/run.py /tmp/queue-rerun -Requires git, Go, and the implementation/test files accompanying this report. -""" -import hashlib -import json -from pathlib import Path -import shutil -import subprocess -import sys -from datetime import datetime - -ROOT = Path(__file__).resolve().parents[3] -DATA = Path(__file__).resolve().parent -DEST = Path(sys.argv[1]).resolve() -DEST.mkdir(parents=True, exist_ok=False) -MANIFEST = json.loads((DATA / "manifest.json").read_text()) -FIXTURES = json.loads((DATA / "fixtures.json").read_text()) -archive = subprocess.check_output(["git", "archive", MANIFEST["head"]], cwd=ROOT) -variants = ["baseline", "logging", "ring", "combined"] -for variant in variants: - d = DEST / variant - d.mkdir() - subprocess.run(["tar", "-xf", "-", "-C", str(d)], input=archive, check=True) - subprocess.run(["git", "apply", "-"], input="".join(FIXTURES["baseline"]).encode(), cwd=d, check=True) - includes = [] - if variant in ("logging", "combined"): - includes += ["--include=queue.go", "--include=logger.go"] - if variant in ("ring", "combined"): - includes += ["--include=ring.go", "--include=options.go"] - else: - (d / "retention_compat_test.go").write_text( - "package queue\n// Comparison-only adapter: the baseline retains the old resizing policy.\n" - "func WithQueueMinCapacity(int) Option { return OptionFunc(func(*Options) {}) }\n" - ) - if includes: - subprocess.run(["git", "apply", *includes, "-"], input="".join(FIXTURES["implementation"]).encode(), cwd=d, check=True) - shutil.copy2(ROOT / "burst_performance_test.go", d / "burst_performance_test.go") - for name, expected in MANIFEST["variants"][variant].items(): - actual = hashlib.sha256((d / name).read_bytes()).hexdigest() - if actual != expected: - raise SystemExit(f"Source mismatch: {variant}/{name}; use the source version accompanying this report") - -if "--prepare-only" in sys.argv[2:]: - print(f"Verified source snapshots: {DEST}") - raise SystemExit(0) - -if "--followup" in sys.argv[2:]: - patterns = ["^BenchmarkQueueEndToEnd$/^workers=4$", "^BenchmarkQueueBurstProducers$/^producers=4$/^retained=false$"] - for round_no in range(6): - order = ["baseline", "combined"] if round_no % 2 == 0 else ["combined", "baseline"] - for variant in order: - with (DEST / (variant + "-followup.txt")).open("a") as output: - for pattern in patterns: - cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=1s", "-count=1", "-cpu=12", "."] - output.write(f"\n# Round {round_no + 1}, {datetime.now().isoformat()}\n# {cmd!r}\n") - output.flush() - subprocess.run(cmd, cwd=DEST / variant, stdout=output, stderr=subprocess.STDOUT, check=True) - print(f"Follow-up {round_no + 1}: {variant}", flush=True) - raise SystemExit(0) - -pattern = "^(BenchmarkHandleRetry|BenchmarkQueueEndToEnd|BenchmarkQueueAfterFnEndToEnd|BenchmarkRingBurstDrain|BenchmarkQueueBurstProducers)$" -orders = [variants, list(reversed(variants)), ["ring", "baseline", "combined", "logging"], ["logging", "combined", "baseline", "ring"]] -for round_no, order in enumerate(orders, 1): - for variant in order: - cmd = ["go", "test", "-run", "^$", "-bench", pattern, "-benchmem", "-benchtime=300ms", "-count=1", "-cpu=12", "."] - with (DEST / (variant + ".txt")).open("a") as output: - output.write(f"\n# Round {round_no}, {datetime.now().isoformat()}\n# {cmd!r}\n") - output.flush() - subprocess.run(cmd, cwd=DEST / variant, stdout=output, stderr=subprocess.STDOUT, check=True) - print(f"Round {round_no}: {variant}", flush=True) -print(f"Results: {DEST}") diff --git a/docs/performance/2026-11-01/summarize.py b/docs/performance/2026-11-01/summarize.py deleted file mode 100644 index 0ecb35a..0000000 --- a/docs/performance/2026-11-01/summarize.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 -"""Summarize raw Go benchmark output. Optional argument: result directory.""" -import json -from pathlib import Path -import statistics -import sys - -folder = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).resolve().parent -results = {} -for variant in ("baseline", "logging", "ring", "combined"): - samples = {} - for line in (folder / (variant + ".txt")).read_text().splitlines(): - parts = line.split() - if not parts or not parts[0].startswith("Benchmark") or len(parts) < 8: - continue - name = parts[0].rsplit("-", 1)[0] - metrics = {parts[i + 1]: float(parts[i]) for i in range(2, len(parts) - 1, 2)} - samples.setdefault(name, []).append(metrics) - results[variant] = { - name: {"samples": values, "summary": { - unit: {"median": statistics.median(v[unit] for v in values), - "min": min(v[unit] for v in values), - "max": max(v[unit] for v in values)} - for unit in values[0] - }} for name, values in samples.items() - } -(folder / "summary.json").write_text(json.dumps(results, indent=2) + "\n") -for name in results["baseline"]: - before = results["baseline"][name]["summary"] - after = results["combined"][name]["summary"] - a, b = before["ns/op"]["median"], after["ns/op"]["median"] - print(f"{name}: {a:g} -> {b:g} ns/op ({(b/a-1)*100:+.1f}%), " - f'{before["B/op"]["median"]:g} -> {after["B/op"]["median"]:g} B/op, ' - f'{before["allocs/op"]["median"]:g} -> {after["allocs/op"]["median"]:g} allocs/op') diff --git a/docs/performance/2026-11-01/summary.json b/docs/performance/2026-11-01/summary.json deleted file mode 100644 index 4d59e58..0000000 --- a/docs/performance/2026-11-01/summary.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "baseline": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13948.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14319.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14337.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14086.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14202.5,"min":13948.0,"max":14337.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":14098.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14584.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14280.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14191.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14235.5,"min":14098.0,"max":14584.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1405.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1614.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1373.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1345.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1389.0,"min":1345.0,"max":1614.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1448.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1555.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1269.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1329.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1388.5,"min":1269.0,"max":1555.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1501.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1619.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1432.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1466.5,"min":1432.0,"max":1619.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1461.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1462.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1478.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1721.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1470.0,"min":1461.0,"max":1721.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":805.4,"B/op":576.0,"allocs/op":8.0},{"ns/op":768.0,"B/op":576.0,"allocs/op":8.0},{"ns/op":759.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":754.6,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":763.85,"min":754.6,"max":805.4},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1139.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1087.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1089.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1068.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1088.0,"min":1068.0,"max":1139.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":2121.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2049.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2034.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2039.0,"B/op":920.0,"allocs/op":14.0}],"summary":{"ns/op":{"median":2044.0,"min":2034.0,"max":2121.0},"B/op":{"median":920.0,"min":920.0,"max":920.0},"allocs/op":{"median":14.0,"min":14.0,"max":14.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4414.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4355.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4303.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4355.0,"B/op":1144.0,"allocs/op":21.0}],"summary":{"ns/op":{"median":4355.0,"min":4303.0,"max":4414.0},"B/op":{"median":1144.0,"min":1144.0,"max":1144.0},"allocs/op":{"median":21.0,"min":21.0,"max":21.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1209.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1169.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1184.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1128.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1176.5,"min":1128.0,"max":1209.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1357.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1400.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1372.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1230.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1364.5,"min":1230.0,"max":1400.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1876.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1867.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1869.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1894.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1872.5,"min":1867.0,"max":1894.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1481.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1396.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1426.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1343.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1411.0,"min":1343.0,"max":1481.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - }, - "logging": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13854.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14515.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14139.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14276.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14207.5,"min":13854.0,"max":14515.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":14294.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14166.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14727.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14234.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14264.0,"min":14166.0,"max":14727.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1343.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1457.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1566.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1344.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1400.5,"min":1343.0,"max":1566.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1387.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1361.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1531.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1340.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1374.0,"min":1340.0,"max":1531.0},"B/op":{"median":726.0,"min":726.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1561.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1480.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1379.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1429.5,"min":1377.0,"max":1561.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1453.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1412.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1427.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1681.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1440.0,"min":1412.0,"max":1681.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":782.6,"B/op":576.0,"allocs/op":8.0},{"ns/op":777.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":736.9,"B/op":576.0,"allocs/op":8.0},{"ns/op":749.3,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":763.2,"min":736.9,"max":782.6},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1090.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1048.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1021.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1065.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1056.5,"min":1021.0,"max":1090.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1977.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1950.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1910.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1898.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1930.0,"min":1898.0,"max":1977.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4064.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":4134.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3976.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3903.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":4020.0,"min":3903.0,"max":4134.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1196.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1175.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1146.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1117.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1160.5,"min":1117.0,"max":1196.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1424.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1403.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1247.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1334.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1368.5,"min":1247.0,"max":1424.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1817.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1831.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1776.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1814.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1815.5,"min":1776.0,"max":1831.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1476.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1322.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1379.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1337.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1358.0,"min":1322.0,"max":1476.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - }, - "ring": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":13895.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14114.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14169.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14595.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14141.5,"min":13895.0,"max":14595.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10070.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10084.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10063.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10064.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10067.0,"min":10063.0,"max":10084.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1468.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1434.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1319.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1322.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1378.0,"min":1319.0,"max":1468.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1477.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1377.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1554.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1324.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1427.0,"min":1324.0,"max":1554.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1539.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1497.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1697.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1379.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1518.0,"min":1379.0,"max":1697.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1499.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1524.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1556.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1399.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1511.5,"min":1399.0,"max":1556.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":813.2,"B/op":576.0,"allocs/op":8.0},{"ns/op":785.1,"B/op":576.0,"allocs/op":8.0},{"ns/op":743.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":739.4,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":764.4000000000001,"min":739.4,"max":813.2},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1142.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1166.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1085.0,"B/op":856.0,"allocs/op":12.0},{"ns/op":1044.0,"B/op":856.0,"allocs/op":12.0}],"summary":{"ns/op":{"median":1113.5,"min":1044.0,"max":1166.0},"B/op":{"median":856.0,"min":856.0,"max":856.0},"allocs/op":{"median":12.0,"min":12.0,"max":12.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":2022.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2068.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":2064.0,"B/op":920.0,"allocs/op":14.0},{"ns/op":1974.0,"B/op":920.0,"allocs/op":14.0}],"summary":{"ns/op":{"median":2043.0,"min":1974.0,"max":2068.0},"B/op":{"median":920.0,"min":920.0,"max":920.0},"allocs/op":{"median":14.0,"min":14.0,"max":14.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4334.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4401.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4319.0,"B/op":1144.0,"allocs/op":21.0},{"ns/op":4306.0,"B/op":1144.0,"allocs/op":21.0}],"summary":{"ns/op":{"median":4326.5,"min":4306.0,"max":4401.0},"B/op":{"median":1144.0,"min":1144.0,"max":1144.0},"allocs/op":{"median":21.0,"min":21.0,"max":21.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1230.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1197.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1185.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1152.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1191.0,"min":1152.0,"max":1230.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1462.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1724.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1447.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1350.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1454.5,"min":1350.0,"max":1724.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1795.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":2038.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1856.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1795.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1825.5,"min":1795.0,"max":2038.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1453.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1608.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1375.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1440.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1446.5,"min":1375.0,"max":1608.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - }, - "combined": { - "BenchmarkRingBurstDrain/retained=false": {"samples":[{"ns/op":14193.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14019.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14145.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0},{"ns/op":14183.0,"retained-B":32.0,"B/op":55968.0,"allocs/op":18.0}],"summary":{"ns/op":{"median":14164.0,"min":14019.0,"max":14193.0},"retained-B":{"median":32.0,"min":32.0,"max":32.0},"B/op":{"median":55968.0,"min":55968.0,"max":55968.0},"allocs/op":{"median":18.0,"min":18.0,"max":18.0}}}, - "BenchmarkRingBurstDrain/retained=true": {"samples":[{"ns/op":10074.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10064.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10071.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0},{"ns/op":10081.0,"retained-B":16384.0,"B/op":0.0,"allocs/op":0.0}],"summary":{"ns/op":{"median":10072.5,"min":10064.0,"max":10081.0},"retained-B":{"median":16384.0,"min":16384.0,"max":16384.0},"B/op":{"median":0.0,"min":0.0,"max":0.0},"allocs/op":{"median":0.0,"min":0.0,"max":0.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=false": {"samples":[{"ns/op":1544.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1418.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1398.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1374.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1408.0,"min":1374.0,"max":1544.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=1/retained=true": {"samples":[{"ns/op":1468.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1315.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1584.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1321.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1394.5,"min":1315.0,"max":1584.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=false": {"samples":[{"ns/op":1481.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1459.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1670.0,"B/op":727.0,"allocs/op":9.0},{"ns/op":1683.0,"B/op":727.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1575.5,"min":1459.0,"max":1683.0},"B/op":{"median":727.0,"min":727.0,"max":727.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueBurstProducers/producers=4/retained=true": {"samples":[{"ns/op":1496.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1482.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1682.0,"B/op":672.0,"allocs/op":9.0},{"ns/op":1316.0,"B/op":672.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1489.0,"min":1316.0,"max":1682.0},"B/op":{"median":672.0,"min":672.0,"max":672.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkHandleRetry/retries=0": {"samples":[{"ns/op":765.3,"B/op":576.0,"allocs/op":8.0},{"ns/op":786.7,"B/op":576.0,"allocs/op":8.0},{"ns/op":739.8,"B/op":576.0,"allocs/op":8.0},{"ns/op":726.7,"B/op":576.0,"allocs/op":8.0}],"summary":{"ns/op":{"median":752.55,"min":726.7,"max":786.7},"B/op":{"median":576.0,"min":576.0,"max":576.0},"allocs/op":{"median":8.0,"min":8.0,"max":8.0}}}, - "BenchmarkHandleRetry/retries=1": {"samples":[{"ns/op":1062.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1093.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1046.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1023.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1054.0,"min":1023.0,"max":1093.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkHandleRetry/retries=3": {"samples":[{"ns/op":1949.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1956.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1925.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":1867.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1937.0,"min":1867.0,"max":1956.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkHandleRetry/retries=10": {"samples":[{"ns/op":4007.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":4019.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3984.0,"B/op":824.0,"allocs/op":11.0},{"ns/op":3913.0,"B/op":824.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":3995.5,"min":3913.0,"max":4019.0},"B/op":{"median":824.0,"min":824.0,"max":824.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}}, - "BenchmarkQueueEndToEnd/workers=1": {"samples":[{"ns/op":1200.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1202.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1140.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1118.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1170.0,"min":1118.0,"max":1202.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=4": {"samples":[{"ns/op":1508.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1502.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1381.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1371.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1441.5,"min":1371.0,"max":1508.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueEndToEnd/workers=12": {"samples":[{"ns/op":1917.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1957.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1941.0,"B/op":726.0,"allocs/op":9.0},{"ns/op":1803.0,"B/op":726.0,"allocs/op":9.0}],"summary":{"ns/op":{"median":1929.0,"min":1803.0,"max":1957.0},"B/op":{"median":726.0,"min":726.0,"max":726.0},"allocs/op":{"median":9.0,"min":9.0,"max":9.0}}}, - "BenchmarkQueueAfterFnEndToEnd": {"samples":[{"ns/op":1546.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1455.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1327.0,"B/op":766.0,"allocs/op":11.0},{"ns/op":1352.0,"B/op":766.0,"allocs/op":11.0}],"summary":{"ns/op":{"median":1403.5,"min":1327.0,"max":1546.0},"B/op":{"median":766.0,"min":766.0,"max":766.0},"allocs/op":{"median":11.0,"min":11.0,"max":11.0}}} - } -}