szetszwo commented on PR #10438:
URL: https://github.com/apache/ozone/pull/10438#issuecomment-4662897858
Just tried but got negative improvement:
```
ChunkBuffer.put(byte[]) microbenchmark (pre-allocated buffer, put-only)
JVM: 17.0.19 on aarch64
=== Throughput showcase ===
--- Incremental buffer showcase ---
Config: ozone.client.stream.buffer.size=4MB,
ozone.client.stream.buffer.increment=64KB, io.file.buffer.size=4KB
Pattern: 4KB stream fill into IncrementalChunkBuffer (64KB steps)
Chunk=4096KB increment=64KB write=4KB
(wrap path blackholes each ByteBuffer.wrap to model real allocation cost)
round 1:
direct put(byte[]): 35,665.9 MB/s | 110 ns/op | 20.00s | 182,609,920
ops
wrap put(ByteBuffer): 36,778.3 MB/s | 106 ns/op | 20.00s | 188,305,408
ops
improvement: -3.0% faster (0.97x) per 4KB write; throughput -3.0% (0.97x)
round 2:
direct put(byte[]): 35,690.1 MB/s | 109 ns/op | 20.00s | 182,733,824
ops
wrap put(ByteBuffer): 36,511.7 MB/s | 107 ns/op | 20.00s | 186,940,416
ops
improvement: -2.3% faster (0.98x) per 4KB write; throughput -2.3% (0.98x)
round 3:
direct put(byte[]): 35,652.3 MB/s | 110 ns/op | 20.00s | 182,540,288
ops
wrap put(ByteBuffer): 37,125.0 MB/s | 105 ns/op | 20.00s | 190,080,000
ops
improvement: -4.0% faster (0.96x) per 4KB write; throughput -4.0% (0.96x)
median improvement over 3 rounds: -3.0%
=== Allocation showcase ===
--- Incremental buffer showcase ---
Config: ozone.client.stream.buffer.size=4MB,
ozone.client.stream.buffer.increment=64KB, io.file.buffer.size=4KB
Pattern: 4KB stream fill into IncrementalChunkBuffer (64KB steps)
Chunk=4096KB increment=64KB write=4KB
direct put(byte[]): 51,306,496 put ops | 0 ByteBuffer TLAB allocs | 0
alloc bytes
wrap put(ByteBuffer): 46,695,424 put ops | 860 ByteBuffer TLAB allocs |
48,160 alloc bytes
ByteBuffer.wrap calls on wrap path (1 per put): 46,695,424
direct path avoids 46,695,424 ByteBuffer.wrap calls per run
JFR confirms zero ByteBuffer TLAB allocations on direct path
JFR sampled ByteBuffer TLAB allocations avoided on direct path: 860
(JFR samples TLAB events; put-op count is the exact wrap-call metric)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]