Tatu Saloranta created CASSJAVA-60:
--------------------------------------

             Summary: Improve encoding performance of `CqlVector` by avoiding 
allocation of large number of temp `ByteBuffer`s
                 Key: CASSJAVA-60
                 URL: https://issues.apache.org/jira/browse/CASSJAVA-60
             Project: Apache Cassandra Java driver
          Issue Type: Improvement
          Components: Core
            Reporter: Tatu Saloranta


When profiling service that uses Cassandra Java Driver, inserting rows with 
Vector columns, I noticed that a significant source of generated garbage (and 
cpu usage) was due to encoding of `CqlVector` (which is essentially thin 
wrapper around `List<Float>`).
A major reason is that value is encoded using delegation so that every 
individual vector element is encoded separately into throw-away `ByteBuffer` 
and only appended along with others in the end to get to actual full value.

It should be possible to instead directly encode element values into fully 
allocated target buffer (as element count & per-element size are known). And 
possibly even just remove use of delegation if and when it is known that 
elements are always `Float`s.

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to