I just discovered something interesting while I was reviewing the django 
documentation to ensure I was replying correctly in a pull request review 
for Ajay on openwisp-controller 
<https://github.com/openwisp/openwisp-controller/pull/190#discussion_r415188156>
. 

It seems that since at least django 1.10 it has been possible to run tests 
in parallel 
<https://docs.djangoproject.com/en/3.0/topics/testing/overview/#speeding-up-the-tests>,
 
the docs say: "As long as your tests are properly isolated, you can run 
them in parallel to gain a speed up on multi-core hardware".

So I tried this on openwisp-controller, let's see how non-parallel and 
parallel compare on my laptop (which apparently has got an octa-core which 
means 8 cores):

*Non-parallel (classic)*

./runtests.py --keepdb

Ran 196 tests in 41.479s

*Parallel*

./runtests.py --keepdb --parallel

Ran 196 tests in 12.965s

*WOW*

That's a reduction in time of almost 69%! It's more than 3 times faster.
We should try this on all the modules and find out if there's some test 
which doesn't run in isolation and fix it, we may be able to drastically 
reduce the build time of each module, as well as help developers run tests 
faster!

Let's find out how many cores travis uses for its docker builds. What if 
it's more than 8 cores? That may result even faster.

Fed

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/50ec5d66-6a00-4cd4-8e31-0f6b71906f53%40googlegroups.com.

Reply via email to