Page MenuHomePhabricator

Memoize paths
ClosedPublic

Authored by joshuaspence on Apr 23 2015, 1:44 AM.
Tags
None
Referenced Files
F13274718: D12520.diff
Fri, May 31, 4:01 AM
F13260769: D12520.diff
Mon, May 27, 12:22 AM
F13249661: D12520.id30185.diff
Fri, May 24, 10:21 AM
F13243224: D12520.diff
Thu, May 23, 3:34 AM
F13223121: D12520.diff
Sun, May 19, 4:18 AM
F13177761: D12520.diff
Wed, May 8, 7:56 PM
Unknown Object (File)
Apr 28 2024, 2:34 AM
Unknown Object (File)
Apr 25 2024, 12:38 AM
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.