Speed up text markup for test results
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.
Reviewers: JoelB, lifeihuang, epriestley, #blessed_reviewers
Reviewed By: epriestley
CC: Korvin, epriestley, aran
Differential Revision: https://secure.phabricator.com/D7690