[PATCH] D52083: [clangd] Store OR iterator children in heap

2018-09-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. > Seems like this optimization is not worth (yet?). As soon as we get more > proximity paths (and hence more OR iterator children) that might make sense. WDYT about storing **all** the elements with the minimal doc-id outside the heap? I.e. we can pop **all** elem

[PATCH] D52083: [clangd] Store OR iterator children in heap

2018-09-14 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 165471. kbobyrev marked 3 inline comments as done. kbobyrev edited the summary of this revision. kbobyrev added a comment. Fixed the bug with incorrect assumption of `Children` being sorted (instead of being a heap). This caused a huge overhead (~30%). When

[PATCH] D52083: [clangd] Store OR iterator children in heap

2018-09-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:128 +// Return LHS > RHS. +auto Compare = [](const std::unique_ptr &LHS, ilya-biryukov wrote: > NIT: use triple-slash comments. > NIT: LHS > RHS seems to be exactly

[PATCH] D52083: [clangd] Store OR iterator children in heap

2018-09-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:128 +// Return LHS > RHS. +auto Compare = [](const std::unique_ptr &LHS, NIT: use triple-slash comments. NIT: LHS > RHS seems to be exactly what's defined by this f

[PATCH] D52083: [clangd] Store OR iterator children in heap

2018-09-14 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision. kbobyrev added reviewers: ioeric, sammccall, ilya-biryukov. kbobyrev added a project: clang-tools-extra. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Use min-heap invariant for OR iterator's children. This helps to avoid iterating through all chi