spekframework / spek

A specification framework for Kotlin
Other
2.23k stars 179 forks source link

[jvm] Scan classes in parallel #905

Closed raniejade closed 4 years ago

raniejade commented 4 years ago

//cc @arturbosch

I'll merge this to the 2.0.x branch which will trigger a CI build and publish an artifact to: https://bintray.com/spekframework/spek-dev/

raniejade commented 4 years ago

@arturbosch new build is out https://bintray.com/spekframework/spek-dev/spek2/2.0.13-alpha.0.1%2Bcecb731 can you try it out?

arturbosch commented 4 years ago

@arturbosch new build is out https://bintray.com/spekframework/spek-dev/spek2/2.0.13-alpha.0.1%2Bcecb731 can you try it out?

I've updated https://github.com/detekt/detekt/issues/2902#issuecomment-666259022

This patch decreases the discovery time by 1 second :tada: . Jupiter still is 1 second faster though. I will now run build scans for the whole build and keep you updated.

raniejade commented 4 years ago

Ohh, that's good news! I'll see if I can configure classgraph further to scan less.

arturbosch commented 4 years ago

Our full test time without the gradle plugin decreased by ~ 20s from 2m8s to 1m47s!

Is Spek using a lot of concurrency by default? If yes, maybe this could lead to threads starving when used together with gradle --parallel. I know that Jupiter uses opt-in for concurrency.

I see 10seconds discovery time for very simple modules:

With snapshot: 2020-07-30-131741_1191x156_scrot

With 2.0.12: 2020-07-30-131857_1182x66_scrot

raniejade commented 4 years ago

I had a closer look, Classgraph is already scanning in parallel by default - so adding disableJarScanning() probably made the biggest difference.