Page MenuHomePhabricator

Memoize paths
ClosedPublic

Authored by joshuaspence on Apr 23 2015, 1:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 9 2024, 2:43 AM
Unknown Object (File)
Feb 13 2024, 10:32 AM
Unknown Object (File)
Feb 8 2024, 11:18 AM
Unknown Object (File)
Jan 12 2024, 5:48 AM
Unknown Object (File)
Jan 5 2024, 5:34 AM
Unknown Object (File)
Dec 30 2023, 5:06 PM
Unknown Object (File)
Dec 26 2023, 8:47 PM
Unknown Object (File)
Dec 23 2023, 7:15 PM
Subscribers

Details

Summary

Ref T7892. Memoize paths returned from ARcanistLinter::getPaths() to improve runtime performance.

Test Plan

Wiped ~0.5 seconds off the total time to lint rARC.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Memoize paths.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

I think these need to be properties ($this->filteredPaths), not statics, because a lint engine may instantiate several copies of some subclass but they might conceivably be configured to filter different paths. For example:

$linters[] = new X()->setRunOnDirectories(true);
$linters[] = new X()->setRunOnDirectories(false);

Then just set $this->filteredPaths = null; in setPaths() to wipe the cache.

This revision now requires changes to proceed.Apr 23 2015, 1:47 AM
joshuaspence edited edge metadata.

Don't use a static variable

epriestley edited edge metadata.
This revision is now accepted and ready to land.Apr 23 2015, 9:43 AM
This revision was automatically updated to reflect the committed changes.