[PATCH] D51689: [clangd] Dense posting lists proof-of-concept

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 09:31:33 PDT 2018


sammccall created this revision.
sammccall added a reviewer: kbobyrev.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov.

This uses a bitmap representation instead of a list if the density of
the list is high enough (at least 1 in 32, which is the breakeven point
sizewise).

Experimenting with the LLVM index, this saves about 3% of total posting
list size, which isn't worth the complexity.

However it should also improve iterator performance somewhat:

- advance is within a constant factor (find next set bit, average step is bounded)
- advanceTo is constant time instead of log(n) with random accesses

If the posting lists that are dense are also commonly used in queries
(seems likely for common trigrams) then this may be worth doing for
latency reasons.
I'm uploading this so Kirill can experiment with benchmarks.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51689

Files:
  clangd/index/dex/DexIndex.cpp
  clangd/index/dex/Iterator.cpp
  clangd/index/dex/Iterator.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51689.164056.patch
Type: text/x-patch
Size: 9820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180905/e5c92d63/attachment.bin>


More information about the cfe-commits mailing list