This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Persistently cache memoized operations during Lit configuration
ClosedPublic

Authored by ldionne on Jan 14 2022, 2:20 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG4afa9c17262c: [libc++] Persistently cache memoized operations during Lit configuration
Summary

When invoking Lit repeatedly, we perform all the configuration checks
over and over again, which takes a lot of time. This patch allows caching
the result of configuration checks persistently across Lit invocations to
speed this up.

In theory, this should still be functionally correct since the cache
key should contain everything that determines the output of the
configuration check. However, in cases where e.g. the compiler has
changed but is at the same path as previously, the Lit configuration
checks will be cached even though technically the cache should have
been invalidated.

Diff Detail

Event Timeline

ldionne created this revision.Jan 14 2022, 2:20 PM
ldionne requested review of this revision.Jan 14 2022, 2:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2022, 2:20 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

I've previously held off with submitting this change because I'm scared that if something's wrong with it, it's going to be very tricky to figure out. But it's likely that the added benefit of extra-fast configuration time is worth taking the risk.

ldionne accepted this revision as: Restricted Project.Jan 18 2022, 7:44 AM

I'm going to ship this. If someone sees weird behavior that could be related to tests not being configured properly, and if these issues go away when you nuke build directory, please ping this review to get my attention.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 18 2022, 7:44 AM
This revision was automatically updated to reflect the committed changes.