This is an archive of the discontinued LLVM Phabricator instance.

[clangd][NFC] Change TidyProvider cache to use a linked list approach
AbandonedPublic

Authored by njames93 on Feb 8 2021, 12:36 PM.

Details

Reviewers
sammccall
Summary

I know linked lists are the work of the devil, but it makes sense here.

Change the map in the DotClangTidyTree to store the FileCache as well as a link to its parent FileCache.
By storing a pointer to each items parent in the map, we no longer need to traverse the entire directory tree and populating a vector for each item.
Instead we just grab the tail from the map and (in all but the first run) it will contain links to the whole directory structure we need for querying.
This can save a lot of redundant work if the config file was in the tail directory but there was 15 parent directories above it.

Diff Detail

Event Timeline

njames93 created this revision.Feb 8 2021, 12:36 PM
njames93 requested review of this revision.Feb 8 2021, 12:36 PM

A similar approach could be used for the config provider, however It may not make as much sense there. The directories are traversed in the opposite order and we will always attempt to read from each directory.

njames93 updated this revision to Diff 325266.Feb 20 2021, 5:51 PM

Update using absoluteParent helper

njames93 edited the summary of this revision. (Show Details)Feb 20 2021, 5:51 PM

Ping @sammccall Any issues with this?

Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2021, 3:40 PM
njames93 retitled this revision from [clangd] Change TidyProvider cache to use a linked list approach to [clangd][NFC] Change TidyProvider cache to use a linked list approach.Apr 21 2021, 1:25 AM
njames93 edited the summary of this revision. (Show Details)

Ping?

njames93 abandoned this revision.Jun 22 2022, 9:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 9:36 AM