This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Dense posting lists proof-of-concept
Needs ReviewPublic

Authored by sammccall on Sep 5 2018, 9:31 AM.
This revision needs review, but all reviewers have resigned.

Details

Reviewers
kbobyrev
Summary

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.

Event Timeline

sammccall created this revision.Sep 5 2018, 9:31 AM
sammccall updated this revision to Diff 164191.Sep 6 2018, 5:34 AM

[Tooling] JSONCompilationDatabasePlugin infers compile commands for missing files

See the existing InterpolatingCompilationDatabase for details on how this works.
We've been using this in clangd for a while, the heuristics seem to work well.

Uh, please ignore the last comment, arc/I got confused.

kbobyrev resigned from this revision.Sep 26 2018, 2:43 AM

For anyone interested in the direction of posting list compression, an implementation of Variable length Byte compression (VByte) has landed: D52300.