learn-co / learn-test

⚠️ This gem is no longer maintained & its web features are no longer available
MIT License
3 stars 29 forks source link

Optimize runtime of test command #43

Closed Tonkpils closed 7 years ago

Tonkpils commented 7 years ago

The optimizations performed lower the runtime of the command by autoloading dependencies and processing the results request in a separate process. I've also added a retry functionality for attempts that failed in the past due to connection issues.

Benchmarks

Standalone test run

npm test  1.18s user 0.13s system 102% cpu 1.278 total

Unoptimized implementation

learn  2.61s user 0.37s system 96% cpu 3.079 total

Optimized without debug

learn  1.40s user 0.19s system 101% cpu 1.565 total

Optimized with debug and no existing issues

learn --debug  1.62s user 0.22s system 93% cpu 1.971 total

This was tested against labs using Rspec and Mocha. The benchmarks should apply to other strategies but if there's any specific lab/language/library you'd like me to run against I'd be more than happy to.

joshrowley commented 7 years ago

great thanks @Tonkpils !

joshrowley commented 7 years ago

gonna probably test/QA some more tomorrow and then cut the new release on Monday