Lendfating / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[PULL] Speedup Slice::compare #151

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please pull https://code.google.com/r/savetherbtz-leveldb/ 

commit 0b63bc80fb080f40a96d562b58a5d2f554b59609
Author: Alexey Ivanov <SaveTheRbtz@GMail.com>
Date:   Fri Mar 1 15:26:58 2013 +0530

    Speedup Slice::compare

    Micro optimization simplifies code, reduces number of branches and
    overall code footprint(both C and machine code).

See 
https://code.google.com/r/savetherbtz-leveldb/source/detail?r=0b63bc80fb080f40a9
6d562b58a5d2f554b59609

Original issue reported on code.google.com by SaveTheR...@gmail.com on 1 Mar 2013 at 10:51

GoogleCodeExporter commented 9 years ago
can you pl provide some numbers on how much improvement you get and which 
compiler you are using.

Original comment by dhr...@gmail.com on 1 Mar 2013 at 6:02

GoogleCodeExporter commented 9 years ago
Doesn't this also change the behaviour? It will order by length rather than 
lexicographically, no?

Original comment by bionicbe...@gmail.com on 1 Mar 2013 at 7:26

GoogleCodeExporter commented 9 years ago
Yes, grouping keys by sizes and sorting lexicographically within each size gave 
a big performance boost for our workflow. But I guess some workflows could be 
hurt by that.

Original comment by SaveTheR...@gmail.com on 2 Mar 2013 at 6:39

GoogleCodeExporter commented 9 years ago
If one want to preserve lexicographical order you may pull following patch 
instead - this removes one branch from resulting code and makes code smaller. 
But I don't suppose that this one will be visible on any benchmarks.

Original comment by SaveTheR...@gmail.com on 2 Mar 2013 at 7:01

Attachments: