Page MenuHomePhabricator

Parsoid/PHP parser tests run takes 2.5x as long as Parsoid/JS parser tests run
Closed, InvalidPublic

Description

As it says in the title, the php parser tests run is 2.5x slower compared to the js run. For one, there are some differences. All env and config objects are recreated for every test on the PHP side (which simplifies the logic and the messiness the sharing causes in the core code) whereas on the JS side, there is some amount of reuse. But, I don't think that in and of itself explains the performance difference.

On my laptop, the 5min test run for parser tests is a productivity dampener and will probably lead me to push the full test run to jenkins. So, at some point, we should investigate this and see if we can speed it up.

Event Timeline

ssastry created this task.Aug 29 2019, 5:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 29 2019, 5:18 PM
ssastry renamed this task from Parsoid/PHP parser tests run takes 2.5x as long as Parsoid/PHP parser tests run to Parsoid/PHP parser tests run takes 2.5x as long as Parsoid/JS parser tests run.Aug 29 2019, 5:18 PM
ssastry triaged this task as Normal priority.
ssastry moved this task from Backlog to Testing / QA on the Parsoid-PHP board.
ssastry moved this task from Testing / QA to Performance on the Parsoid-PHP board.
Arlolra closed this task as Invalid.Aug 29 2019, 9:48 PM
Arlolra added a subscriber: Arlolra.

On my laptop

Not sure what's up with your laptop, but ... in CI here, https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/531520

17:16:48 ParserTests running with node v6.11.0
17:16:48 Initialization complete. Now launching tests.
17:19:46 ==========================================================
17:19:46 SUMMARY: parserTests.txt
17:19:46 Execution time: 178567.760ms
17:14:30 Runtime:       PHP 7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1
...
17:14:46 > php bin/parserTests.php --wt2html --wt2wt --html2wt --html2html --selser true --quiet --blacklist true
17:14:46 Loaded blacklist from /src/tests/parserTests-php-blacklist.json. Found 1656 entries!
17:16:38 ==========================================================
17:16:38 SUMMARY:parserTests.txt
17:16:38 Execution time: 112240.935ms
17:14:29 Runtime:       PHP 7.3.6-1+0~20190531112735.39+stretch~1.gbp6131b7
...
17:14:41 > php bin/parserTests.php --wt2html --wt2wt --html2wt --html2html --selser true --quiet --blacklist true
17:14:41 Loaded blacklist from /src/tests/parserTests-php-blacklist.json. Found 1656 entries!
17:16:10 ==========================================================
17:16:10 SUMMARY:parserTests.txt
17:16:10 Execution time: 88633.366ms

The numbers are comparable, if not better, for me locally.

Huh ... interrresting! I wonder whats up with my laptop indeed ...

Turns out this was because I had php-xdebug installed / enabled. Uninstalling it brought the test times to < 2 mins (faster than JS).