hypirion / c-rrb

RRB-tree implemented as a library in C.
MIT License
164 stars 14 forks source link

Measure loop unroll performance #6

Open hypirion opened 10 years ago

hypirion commented 10 years ago

I have some ideas on how loop unrolling could be done very efficiently. However, that is purely theoretical and would require performance measurements.

The idea is as follows: In almost all cases, we know how many iteration steps there will be before the actual iteration is done. Additionally, the code for a trie walk is exactly the same, with the possible exception of the last step. Henceforth, loop unrolling can, with some macro tricks, be done as shown on the experimental branch.

There are some other tricks which can be used as well, for example fact that any subtrie not containing a size table will never have a child with a size table (this is where it gets messy).