[ 
https://issues.apache.org/jira/browse/CASSANDRA-9499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593474#comment-14593474
 ] 

Benedict commented on CASSANDRA-9499:
-------------------------------------

Looking good. I've pushed some suggestions to the bit fiddling, for both 
clarity and performance 
[here|https://github.com/belliottsmith/cassandra/tree/C-9499-suggestions]. 
Including efficient size computation, some extraneous operation removal, and 
what seemed to me clearer names to methods (please feel free to dispute). I had 
to strip out the debugging statements to figure out what was going on, hope 
that isn't a problem for you.

It's still more computationally involved than I would _like_, and I feel there 
may be some more efficiencies. So I will mull it over a little more, but wanted 
to upload what I had so we didn't tread too much on each other.

Some further suggestions I did not implement: 

* I'm not sure why we need the try/finally block, and I'd prefer we removed it 
- there's nothing that should be able to throw an exception between our setting 
and unsetting the limit.
* The extra reading in NIODataInputStream, I would prefer we extract to a 
separate method, and force it to not be inlined. Since it should be a rare 
occurrence that we need to do this, and we incur more expensive costs than this 
inner method invocation when this does happen, I would prefer to keep the rest 
of the method as tightly packed for icache behaviour as possible

> Introduce writeVInt method to DataOutputStreamPlus
> --------------------------------------------------
>
>                 Key: CASSANDRA-9499
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9499
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Ariel Weisberg
>            Priority: Minor
>             Fix For: 3.0 beta 1
>
>
> CASSANDRA-8099 really could do with a writeVInt method, for both fixing 
> CASSANDRA-9498 but also efficiently encoding timestamp/deletion deltas. It 
> should be possible to make an especially efficient implementation against 
> BufferedDataOutputStreamPlus.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to