Page MenuHomePhabricator

Minor optimization for unit test
ClosedPublic

Authored by joshuaspence on May 2 2015, 6:05 AM.
Tags
None
Referenced Files
F19749060: D12654.id30531.diff
Sun, Feb 15, 7:57 PM
F19703777: D12654.id30397.diff
Wed, Feb 11, 2:45 AM
F19681159: D12654.id30397.diff
Sun, Feb 8, 9:19 PM
F19562313: D12654.id30398.diff
Jan 31 2026, 12:26 PM
F19512333: D12654.id30531.diff
Jan 12 2026, 4:58 PM
F19502390: D12654.id30398.diff
Jan 8 2026, 4:22 PM
F19055226: D12654.id30398.diff
Nov 28 2025, 4:07 PM
F19055225: D12654.id30398.diff
Nov 28 2025, 4:07 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.