This significantly speeds up the configuration of libc++'s test suite
by making sure that we don't perform the same operations over and over
again.
Details
- Reviewers
arichardson - Group Reviewers
Restricted Project - Commits
- rG5390c5a96e97: [libc++] Add caching for feature-detection Lit tests
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Thanks, this is much better than my specialized version. However, I don't think it's correct since you are passing a reference to a mutable object to the cache so c.substitutions it will always be equal.
I just tested this and the cache will still hit if we append a value to config.substitutions between checks.
I think copy.deepcopy() (as I used in D89109) should be a bit faster than pickle and also provide the same guarantee?
Oops, I'm sloppy -- I had not seen your D89109 yet. Sorry about that. Does deepcopy allow us to use a dict? If not, I think I still prefer dumping to a string for simplicity. Speed isn't a huge concern here if we compare pickling to running the processes.
My bad, I should have linked the revision in this comment. I think doing the dict lookup is better since the cache ends up holding about 60 elements in some cases.