[
https://issues.apache.org/jira/browse/CASSANDRA-15215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17449488#comment-17449488
]
Aleksandr Sorokoumov commented on CASSANDRA-15215:
--------------------------------------------------
While working on the read path I've realized that it already has the
optimization we discussed since CASSANDRA-8630 -
https://github.com/apache/cassandra/blob/951d72cd929d1f6c9329becbdd7604a9e709587b/src/java/org/apache/cassandra/io/util/RebufferingInputStream.java#L239-L268.
Since the last update I added new test cases to {{VIntCodingTest}} to cover
buffered and unbuffered reads and writes as well as extended {{DataOutputTest}}
to cover {{DataOutputPlus#writeBytes}}.
Patches:
* [3.0|https://github.com/apache/cassandra/pull/1343]
* [3.11|https://github.com/apache/cassandra/pull/1344]
* [4.0|https://github.com/apache/cassandra/pull/1345]
* [trunk|https://github.com/apache/cassandra/pull/1346]
To demonstrate the results I picked a single benchmark -
{{testWriteRandomLongDOP}} as it shows overall performance improvement and is
relevant for all Cassandra versions. The results are for the megamorphic
benchmark variation.
!testWriteRandomLongDOP_final.png|width=800px!
[~benedict], [~blambov] Can you please review the patch and run the CI?
> VIntCoding should read and write more efficiently
> -------------------------------------------------
>
> Key: CASSANDRA-15215
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15215
> Project: Cassandra
> Issue Type: Bug
> Components: Local/Compaction, Local/SSTable
> Reporter: Benedict Elliott Smith
> Assignee: Aleksandr Sorokoumov
> Priority: Normal
> Fix For: 3.0.x, 3.11.x, 4.x
>
> Attachments: testWriteRandomLongDOP_final.png,
> writeUnsignedVInt_megamorphic_BB.png, writeUnsignedVInt_megamorphic_DOP.png
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Most vints occupy significantly fewer than 8 bytes, and most buffers have >=
> 8 bytes spare, in which case we can construct the relevant bytes in a
> register and memcpy them to the correct position. Since we read and write a
> lot of vints, this waste is probably measurable, particularly during
> compaction and flush, and can probably be considered a performance bug.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]