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)
Mon, Nov 18, 4:37 AM
Unknown Object (File)
Sun, Nov 10, 3:32 AM
Unknown Object (File)
Wed, Nov 6, 7:04 AM
Unknown Object (File)
Oct 22 2024, 6:16 AM
Unknown Object (File)
Oct 16 2024, 12:15 AM
Unknown Object (File)
Oct 2 2024, 11:54 PM
Unknown Object (File)
Oct 2 2024, 12:43 AM
Unknown Object (File)
Sep 3 2024, 6:58 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.