Page MenuHomePhabricator

Memoize paths
ClosedPublic

Authored by joshuaspence on Apr 23 2015, 1:44 AM.
Tags
None
Referenced Files
F14096578: D12520.diff
Tue, Nov 26, 4:12 AM
Unknown Object (File)
Sun, Nov 24, 6:10 PM
Unknown Object (File)
Fri, Nov 22, 6:17 PM
Unknown Object (File)
Tue, Nov 19, 4:24 PM
Unknown Object (File)
Sun, Nov 17, 5:29 PM
Unknown Object (File)
Thu, Nov 14, 3:44 AM
Unknown Object (File)
Sat, Nov 9, 11:12 PM
Unknown Object (File)
Sat, Nov 9, 2:51 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
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 5458
Build 5476: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
983 msArcanistPuppetLintLinterTestCase::testLinter
11,639 msArcanistXHPASTLinterTestCase::testLinter
645 msArcanistCSSLintLinterTestCase::testLinter
115 msArcanistCSSLintLinterTestCase::testVersion
136 msArcanistChmodLinterTestCase::testLinter
View Full Test Results (2 Failed · 47 Passed · 4 Skipped)

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.