Page MenuHomePhabricator

Speed up text markup for test results
ClosedPublic

Authored by sowedance on Dec 3 2013, 6:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 31, 2:53 PM
Unknown Object (File)
Fri, Dec 20, 8:51 PM
Unknown Object (File)
Wed, Dec 18, 12:39 AM
Unknown Object (File)
Mon, Dec 16, 7:09 PM
Unknown Object (File)
Mon, Dec 16, 2:48 PM
Unknown Object (File)
Mon, Dec 16, 8:12 AM
Unknown Object (File)
Dec 4 2024, 4:52 AM
Unknown Object (File)
Oct 18 2024, 1:26 AM

Details

Summary

Recently there are quite a few diffs hitting timeout when loaded in phabricator page. The reason is that those tests have huge amount of test results and it takes more than two minutes to finish rendering the user data part of the test results. And more than 90 percent of the time was spending on the shouldMergeBlocks calls. There is some unnecessary work in that function, especially first concatenate the lines and then split it using regex, which is a time killer.

Test Plan

Load D1071019. It has more than 15k test results and always times out before. Now it loads in about 5 seconds. Click on 'show all test results' seems to bring up all the test results in right format.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Broadly, I think the right fix for this problem is to stop rendering 15,000 unit test results, as they're presumably not useful to anyone. In the upstream, we're going to move all build/CI stuff into Harbormaster, but I'm not sure if Facebook is ever going to update Phabricator again so this might not be relevant for you guys.

This is a reasonable change in isolation, though. Some additional cleanup inline, feel free to send me a followup.

src/markup/engine/PhutilRemarkupEngine.php
191–195

We could remove this, it doesn't make much sense to do this check here. I think this is vestigial. There's no reasonable way it will ever do anything useful, we've already called getMatchingLineCount() on the object so at a minimum it quacks like a BlockRule.