Skip to content

HDDS-15592 use heap allocation in ChunkBuffer#10536

Open
yandrey321 wants to merge 2 commits into
apache:masterfrom
yandrey321:HDDS-15592
Open

HDDS-15592 use heap allocation in ChunkBuffer#10536
yandrey321 wants to merge 2 commits into
apache:masterfrom
yandrey321:HDDS-15592

Conversation

@yandrey321

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

When ChunkBuffer allocates heap buffer UnsafeByteOperations.unsafeWrap() returns a BoundedByteString with a backing array, enabling a single System.arraycopy into the gRPC/Netty wire buffer instead of the slow byte-by-byte NioByteString path for direct buffers.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15592

How was this patch tested?

Benchmark run on m3 mac/ARM with 14 cores producing the following results:

--- scaling summary writeSize=4096KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      5,098.0 |      5,624.6 |       1.10x |       1.00 |       1.00
   2 |      9,326.6 |     10,766.9 |       1.15x |       0.91 |       0.96
   4 |     17,293.4 |     18,886.2 |       1.09x |       0.85 |       0.84
   7 |     24,220.6 |     27,652.1 |       1.14x |       0.68 |       0.70
  14 |     25,092.3 |     31,294.6 |       1.25x |       0.35 |       0.40
  28 |     26,017.8 |     28,899.0 |       1.11x |       0.18 |       0.18
  42 |     27,288.1 |     30,836.3 |       1.13x |       0.13 |       0.13

--- scaling summary writeSize=3072KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      6,441.7 |      7,407.9 |       1.15x |       1.00 |       1.00
   2 |     12,718.8 |     14,405.9 |       1.13x |       0.99 |       0.97
   4 |     24,420.3 |     27,779.9 |       1.14x |       0.95 |       0.94
   7 |     39,524.5 |     44,928.1 |       1.14x |       0.88 |       0.87
  14 |     47,319.0 |     58,903.6 |       1.24x |       0.52 |       0.57
  28 |     41,418.1 |     50,173.2 |       1.21x |       0.23 |       0.24
  42 |     39,672.7 |     50,588.1 |       1.28x |       0.15 |       0.16

--- scaling summary writeSize=2048KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      5,092.0 |      5,753.0 |       1.13x |       1.00 |       1.00
   2 |      9,601.4 |     10,889.3 |       1.13x |       0.94 |       0.95
   4 |     17,719.7 |     18,854.6 |       1.06x |       0.87 |       0.82
   7 |     24,087.2 |     27,649.2 |       1.15x |       0.68 |       0.69
  14 |     26,875.0 |     30,787.4 |       1.15x |       0.38 |       0.38
  28 |     26,819.5 |     30,021.1 |       1.12x |       0.19 |       0.19
  42 |     27,593.0 |     30,644.9 |       1.11x |       0.13 |       0.13

--- scaling summary writeSize=1024KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      5,059.7 |      5,682.8 |       1.12x |       1.00 |       1.00
   2 |      9,736.1 |     10,943.2 |       1.12x |       0.96 |       0.96
   4 |     17,766.6 |     19,292.5 |       1.09x |       0.88 |       0.85
   7 |     24,588.8 |     28,444.3 |       1.16x |       0.69 |       0.72
  14 |     27,671.9 |     31,524.6 |       1.14x |       0.39 |       0.40
  28 |     26,259.2 |     30,340.7 |       1.16x |       0.19 |       0.19
  42 |     27,058.7 |     30,937.3 |       1.14x |       0.13 |       0.13

--- scaling summary writeSize=512KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      4,843.5 |      5,502.6 |       1.14x |       1.00 |       1.00
   2 |      9,165.2 |     10,428.1 |       1.14x |       0.95 |       0.95
   4 |     17,641.7 |     19,249.4 |       1.09x |       0.91 |       0.87
   7 |     24,383.0 |     27,974.6 |       1.15x |       0.72 |       0.73
  14 |     27,056.3 |     30,301.9 |       1.12x |       0.40 |       0.39
  28 |     27,436.6 |     30,545.3 |       1.11x |       0.20 |       0.20
  42 |     27,118.8 |     30,685.3 |       1.13x |       0.13 |       0.13 

--- scaling summary writeSize=256KB ---

threads direct MB/s heap MB/s heap/direct direct eff. heap eff.
   1 |      4,985.1 |      5,655.3 |       1.13x |       1.00 |       1.00
   2 |      9,738.0 |     10,646.6 |       1.09x |       0.98 |       0.94
   4 |     17,132.0 |     19,142.1 |       1.12x |       0.86 |       0.85
   7 |     24,196.4 |     28,211.3 |       1.17x |       0.69 |       0.71
  14 |     27,048.4 |     31,631.4 |       1.17x |       0.39 |       0.40
  28 |     27,276.7 |     28,319.7 |       1.04x |       0.20 |       0.18
  42 |     26,891.1 |     30,444.4 |       1.13x |       0.13 |       0.13 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant