Performance / Architecture

22 views
Skip to first unread message

Thomas Mauch

unread,
Apr 3, 2020, 6:14:12 AM4/3/20
to CDI-Unit
Hi

I have questions regarding performance and architecure of CdiUnit.

We use CdiUnit to run tests in our application which has a quite big classpath, including MBs of JARs.
This makes starting up a single test quite slow.

A first analysis showed that more than a second is spent in scanning the classpath by WeldTestUrlDeployment.populateCdiClasspathSet() which then finally delegates to ClassGraphScanner.getClassPathURLs.
To improve performance, I just commented populateCdiClasspathSet out and always return true in isCdiClass() - and it seems that all our tests are running fine.

So my questions are:
- Why do we have to scan the whole classpath necessary? I always had the impression that this should not be needed as we have to declare addtional dependencies using @AdditionalClasses etc.
- If I comment populateCdiClasspathSet out and tweak isCdiClass as described, tests using which functionality would fail?

Many thanks
Thomas

Illya Kysil

unread,
Apr 15, 2020, 3:57:52 PM4/15/20
to CDI-Unit
Hi Thomas,


You may be interested in this PR : https://github.com/BrynCooke/cdi-unit/pull/158


Regards,
ILLYA
Reply all
Reply to author
Forward
0 new messages