This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add OverriddenBy Relation to index.
ClosedPublic

Authored by usaxena95 on Nov 17 2020, 3:32 AM.

Details

Summary

This was previously explored in reviews.llvm.org/D69094.

For LLVM

  • Negligible change in indexing time: 4m4s
  • Negligible change in memory usage: 486MB
  • Number of relations get 2.3x: 20k to 47k

Details:
With OverridenBy relations:
Loaded Dex from static-index.idx with estimated memory usage 510179407 bytes

  • number of symbols: 505566
  • number of refs: 7813996
  • number of relations: 47523

Dex build took 10,368 ms.

Baseline:
Loaded Dex from base-index.idx with estimated memory usage 509652178 bytes

  • number of symbols: 505535
  • number of refs: 7813807
  • number of relations: 20036

Dex build took 10,449 ms.
dexp>

Diff Detail

Event Timeline

usaxena95 created this revision.Nov 17 2020, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 3:32 AM
usaxena95 requested review of this revision.Nov 17 2020, 3:32 AM
usaxena95 updated this revision to Diff 305727.Nov 17 2020, 3:59 AM

added more tests.

usaxena95 edited the summary of this revision. (Show Details)Nov 17 2020, 4:40 AM
usaxena95 added a reviewer: hokein.

Thanks! I think we need to bump the index version number (in index/Serialization.cpp) in order to let the index pick up this change.

clang-tools-extra/clangd/index/Relation.h
28–32

nit: can you add an override example here?

clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
880

looks like these changes are unexpected?

usaxena95 updated this revision to Diff 305776.Nov 17 2020, 6:51 AM
usaxena95 marked an inline comment as done.

Addressed comments.

usaxena95 marked an inline comment as done.Nov 17 2020, 6:51 AM

Bumped the index version. Thanks.

Quuxplusone added inline comments.
clang-tools-extra/clangd/index/Relation.cpp
21

Also here.
And there's a bogus extra space in RelationKind ::BaseOf.

clang-tools-extra/clangd/index/Relation.h
24

s/Overriden/Overridden/g

usaxena95 updated this revision to Diff 305780.Nov 17 2020, 7:02 AM

Updated sample input for index-serialization test.

usaxena95 retitled this revision from [clangd] Add OverridenBy Relation to index. to [clangd] Add OverriddenBy Relation to index..Nov 17 2020, 7:05 AM
kadircet added inline comments.Nov 17 2020, 7:07 AM
clang-tools-extra/clangd/test/index-serialization/Inputs/sample.cpp
6 ↗(On Diff #305780)

could you also add a comment for the reason we have this in the test (i.e. Introduces an OverridenBy relation)

usaxena95 updated this revision to Diff 305783.Nov 17 2020, 7:09 AM
usaxena95 marked 2 inline comments as done.

s/OverridenBy/OverriddenBy

clang-tools-extra/clangd/index/Relation.h
24

Thanks.

usaxena95 updated this revision to Diff 305787.Nov 17 2020, 7:14 AM
usaxena95 marked an inline comment as done.

Add documentation for change in index test.

hokein accepted this revision.Nov 17 2020, 12:48 PM
hokein added inline comments.
clang-tools-extra/clangd/index/Relation.h
31

nit: I would explicitly indicate the base hierarchy here, maybe Derived::Foo() overrides Base::Foo().

This revision is now accepted and ready to land.Nov 17 2020, 12:48 PM
usaxena95 updated this revision to Diff 305976.Nov 17 2020, 9:58 PM
usaxena95 marked an inline comment as done.

Addressed final comments. Ready to land.

This revision was landed with ongoing or failed builds.Nov 17 2020, 10:11 PM
This revision was automatically updated to reflect the committed changes.