Minify the JSON output from XHPAST by removing whitespace. This is a micro-optimization which sacrifices readability for performance.
Details
Details
Diff Detail
Diff Detail
- Repository
- rPHU libphutil
- Branch
- master
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 7739 Build 8511: [Placeholder Plan] Wait for 30 Seconds Build 8510: arc lint + arc unit
Event Timeline
Comment Actions
It's implausible to me that this really improves performance by 50%!!!!! unless we have another issue somewhere else. Let me poke at this...
Comment Actions
I can't reproduce this effect locally in isolation. Here's an unmodified binary:
epriestley@orbital ~/dev/libphutil $ time ./xhpast.with-whitespace < ../phabricator/src/__phutil_library_map__.php | wc -c 965744 real 0m0.142s user 0m0.139s sys 0m0.006s
Here's a modified binary:
epriestley@orbital ~/dev/libphutil $ time ./xhpast.no-whitespace < ../phabricator/src/__phutil_library_map__.php | wc -c 912648 real 0m0.143s user 0m0.140s sys 0m0.007s
The runtime is identical and the output size differs by only 5%.
Can you reproduce the effect by running the binary directly?
Comment Actions
It's quite possible that my thinking is wrong, but I figured that this might be faster because there is less data being passed through ExecFuture rather than directly improving XHPAST. I agree that the observed speed up seems unwarranted though.