Page MenuHomePhabricator

Minor optimization for unit test
ClosedPublic

Authored by joshuaspence on May 2 2015, 6:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 3:01 PM
Unknown Object (File)
Fri, Dec 13, 3:10 AM
Unknown Object (File)
Wed, Dec 11, 10:21 PM
Unknown Object (File)
Nov 25 2024, 4:20 PM
Unknown Object (File)
Nov 22 2024, 5:03 AM
Unknown Object (File)
Nov 18 2024, 4:37 AM
Unknown Object (File)
Nov 10 2024, 3:32 AM
Unknown Object (File)
Nov 6 2024, 7:04 AM

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.