3 ms·
The delay is all in compiling exs files. It uses Kernel.ParallelCompiler to compile every .exs file, so it's very CPU/core dependent. On my weaker laptop, `mix
by latch 5y ago
The delay is all in compiling exs files. It uses Kernel.ParallelCompiler to compile every .exs file, so it's very CPU/core dependent. On my weaker laptop, `mix test` takes nearly 10 seconds to just start.
I've looked into this in more details in the past. We've had success just writing our own test runner and avoiding exs files. But re-implementing things like running tests based on line number, or integrating with external tools (like excoveralls) has been a dealbreaker.
- lawik 5y agoReally? I'm surprised that is your test bottleneck. I've mostly seen it be actually slow tests and things that can't be asynced.
- ericmj 5y agoWhat made your test runner faster? We would be very interested in porting those optimizations to ex_unit.
- josevalim 5y agoFWIW, I recently pushed a commit to master that made loading of Elixir's test suite 33% faster (from 15s to 10s): https://github.com/elixir-lang/elixir/commit/2eb03e4a314c0e6b986b4fb88af2df549e088288 https://github.com/elixir-lang/elixir/commit/2eb03e4a314c0e6... Unfortunately, it is a bit too large (and too late) for v1.12, but if loading times have been problematic for you, it would be awesome if you could try master out and let us know in the issues tracker (or in the commit) if you see any improvements.
- bostonvaulter2 5y agoAre you sure that you're not including application startup in that 10 second measurement? I've seen code bases where horde or some other clustering was enabled in the test env and causing a ~5 second delay on application startup.