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

Paul Joseph Davis commented on COUCHDB-1130:
--------------------------------------------

The first thing I noticed is that v3 while faster has a much broader range than 
v2. I played around with the first function a bit to see if I could improve it 
a bit. I think I did, but I also notice that reordering the functions appears 
to impact the ranges reported as well. I think to get anything meaningful we'd 
need to run many more iterations and get a better statistical understanding of 
it.

I'm +1 on switching to either v2 or v3.

Good work Randall.

> binary optimization in couch_file
> ---------------------------------
>
>                 Key: COUCHDB-1130
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1130
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: Database Core
>    Affects Versions: 1.0.2
>            Reporter: Randall Leeds
>            Priority: Minor
>         Attachments: 
> 0001-refactor-remove_block_prefixes-2-for-optimization.patch, 
> davisp_prof_bin_opt, prof_bin_opt
>
>
> I've had this patch sitting around since January and kept forgetting to file 
> the ticket. Hurray spring cleaning.
> Just for fun I ran erlc with +bin_opt_info, which gives information about how 
> the Erlang VM can optimize creating binary objects.
> What follows is the commit message from my patch.
> Even if I'm wrong about the last point, it can't hurt.
> What think you all?
> -------------------
> Running erlc with +bin_opt_info gives an INFO message stating that "matching
> anything else but a plain variable to the left of a binary pattern will 
> prevent
> delayed sub binary optimization; SUGGEST changing argument order"
> I guess matching 0 is triggering this. If I understand correctly, this change
> will allow the compiler to skip creating a sub-binary that starts at the block
> boundary in the third clause and delay creation until we strip the leading 
> byte
> in the 0 clause. This means one less 1-byte binary every time we read across a
> block boundary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to