Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces optimizeWriteLatencyPool in storage/rapid/optimize_write_latency_pool.go to optimize write latency using a pre-warmed pool of writers for zonal buckets, along with corresponding unit tests in storage/rapid/rapid_test.go. The review feedback recommends handling and logging errors in the background goroutine when pre-warming a replacement writer fails, rather than silently ignoring them, to prevent debugging difficulties.
07184d5 to
0ca534e
Compare
Adds optimizeWriteLatencyPool sample (region tag: storage_optimize_write_latency_pool) demonstrating a pre-warmed pool of zonal bucket writers with FinalizeOnClose = false and Flush() to avoid object creation and finalization metadata overhead on the critical write path. Verified with both mock unit tests and live integration testing against a Rapid (zonal) bucket in us-central1-a: Running live Go test against bucket=<zonal-bucket>, prefix=live_go_pool_1790087532323 Go 1. Init pool (3 writers): 1.075960737s Go 2. Write+flush: 26.459652ms Go 4. Read back: "0123456789", pool size after refill: 3 --- PASS: TestWriterPoolGoSample (1.40s) PASS
f7750d4 to
c8055a8
Compare
- Use a buffered channel for the writer pool instead of a mutex-guarded slice. - Take a writer with select and a timeout. - Remove redundant FinalizeOnClose = false (it defaults to false). - Clarify the TODO on the pre-warm Flush.
|
@cpriti-os would you mind reviewing/approving this one? |
Adds optimizeWriteLatencyPool sample (region tag: storage_optimize_write_latency_pool) demonstrating a pre-warmed pool of zonal bucket writers with FinalizeOnClose = false and Flush() to avoid object creation and finalization metadata overhead on the critical write path.
Verified with both mock unit tests and live integration testing against a Rapid (zonal) bucket in us-central1-a:
Running live Go test against bucket=, prefix=live_go_pool_1790087532323
Go 1. Init pool (3 writers): 1.075960737s
Go 2. Write+flush: 26.459652ms
Go 4. Read back: "0123456789", pool size after refill: 3
--- PASS: TestWriterPoolGoSample (1.40s)
PASS
Description
Fixes #
Checklist
go test -v ./...(see Testing)gofmt(see Formatting)go vet(see Formatting)