This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Avoid wasteful data structures in RefSlab::Builder
ClosedPublic

Authored by sammccall on May 14 2020, 10:23 AM.

Details

Summary

This is worth another 10% or so on InedxBenchmark.DexBuild.

Diff Detail

Event Timeline

sammccall created this revision.May 14 2020, 10:23 AM
kbobyrev accepted this revision.May 18 2020, 1:52 AM

LGTM with a couple of nits.

Thank you for the patch, this is a good idea!

clang-tools-extra/clangd/index/Ref.cpp
11

This defines BumpPtrAllocator, right? I think it should be included in clang-tools-extra/clangd/index/Ref.h, not here if the intent is to explicitly include used headers. Same for StringSaver.h, this source file does not use any additional variables of these types.

clang-tools-extra/clangd/index/Ref.h
141

nit: I know you like the short names, but with R I had to get back to Entry definition each time I saw it (I was thinking "wait, R? is there an L somewhere here?". Maybe it's just me, but one-letter fields seem scary. Maybe Reference?

This revision is now accepted and ready to land.May 18 2020, 1:52 AM
sammccall marked 4 inline comments as done.May 18 2020, 1:34 PM
sammccall added inline comments.
clang-tools-extra/clangd/index/Ref.cpp
11

Yup, that's right, thanks.
(An intermediate version of the code used the overloaded new from allocator.h)

clang-tools-extra/clangd/index/Ref.h
141

Oops, I agree but forgot to do this, thanks!

This revision was automatically updated to reflect the committed changes.
sammccall marked 2 inline comments as done.