[clangd] Don't create child AND and OR iterators with one posting list
authorKirill Bobyrev <kbobyrev.opensource@gmail.com>
Thu, 13 Sep 2018 10:02:48 +0000 (10:02 +0000)
committerKirill Bobyrev <kbobyrev.opensource@gmail.com>
Thu, 13 Sep 2018 10:02:48 +0000 (10:02 +0000)
commitd9f33b129ccff18321bfa63e0f22972e48e7143f
treee7dd2e2f23b008d47031bbe72a4fec88d502f0a1
parent33b72d8d348a459e9d3e537418ed45098b5511a9
[clangd] Don't create child AND and OR iterators with one posting list

`AND( AND( Child ) ... )` -> `AND( Child ... )`
`AND( OR( Child ) ... )` -> `AND( Child ... )`

This simple optimization results in 5-6% performance improvement in the
benchmark with 2000 serialized `FuzzyFindRequest`s.

Reviewed By: ilya-biryukov

Differential Revision: https://reviews.llvm.org/D52016

llvm-svn: 342124
clang-tools-extra/clangd/index/dex/Iterator.cpp