dart-lang / test

A library for writing unit tests in Dart.
https://pub.dev/packages/test
493 stars 212 forks source link

Test Execution Time Tanks with Json Reporter on Dart2Js #1112

Open todbachman-wf opened 4 years ago

todbachman-wf commented 4 years ago

On a number of our larger internal projects we're seeing a considerable increase in test execution time when we use the json reporter rather than the standard reporter. We don't see the same increase in execution time when running tests using DDC and the json reporter (though execution is still higher). As an example, this is the execution time I see on one of our internal projects w/ the standard reporter and w/ the json reporter:

~/some_project (master) $ time pub run build_runner test --release > /dev/null
real    4m16.270s
user    0m24.014s
sys     0m6.270s
~/some_project (master) $ time pub run build_runner test --release -- -r json > /dev/null
real    8m52.191s
user    0m36.285s
sys     0m16.477s

We're seeing this behavior across a number of our projects, btw. It's not isolated to one.

These tests were executed on version Dart 2.6.1 and Chrome 78.

natebosch commented 4 years ago

cc @jakemac53 - any idea if this is strictly related to json encoding?

todbachman-wf commented 4 years ago

FWIW, the difference in execution time when running the same tests on DDC is only around a minute.