Page MenuHomePhabricator

Minor optimization for unit test
ClosedPublic

Authored by joshuaspence on May 2 2015, 6:05 AM.
Tags
None
Referenced Files
F15462369: D12654.id.diff
Tue, Apr 1, 2:35 PM
F15460378: D12654.diff
Mon, Mar 31, 10:25 PM
F15454806: D12654.diff
Sat, Mar 29, 8:32 PM
F15430778: D12654.id30398.diff
Mon, Mar 24, 8:53 AM
F15430647: D12654.id30531.diff
Mon, Mar 24, 8:30 AM
F15427555: D12654.diff
Sun, Mar 23, 2:54 PM
F15424412: D12654.id30397.diff
Sat, Mar 22, 10:12 PM
F15421316: D12654.id30398.diff
Fri, Mar 21, 10:36 PM

Details

Summary

I noticed that PhabricatorLibraryTestCase::testMethodVisibility takes a long time to execute (up to 90 seconds on my laptop). Looking at the profile it seems that most (54.5%) of the execution time is spent in PhutilLibraryTestCase::getVisibility. Rewriting PhutilLibraryTestCase::testMethodVisibility to use a bitmask instead of strings seems to provide a significant performance improvement (on my local machine, this test now takes 45 seconds, see the profile).

Test Plan

arc unit

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Minor optimization for unit test.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 2 2015, 11:37 AM
argp added inline comments.
src/__tests__/PhutilLibraryTestCase.php
74

test comment 1234

75

comment line 75

This revision was automatically updated to reflect the committed changes.