Notice that class path scanning only occurs when the following evaluates to 
true:

if (builtInPlugins.isEmpty()) {
We encourage the value of this to always be false. I think it would be good to 
log an info message indicating that package scanning is taking place and the 
application should be corrected.

Ralph


> On Mar 8, 2021, at 2:06 PM, Volkan Yazıcı <volkan.yaz...@gmail.com> wrote:
> 
> PluginManager#collectPlugins() performs quite some package scanning
> sequentially. I have the impression that this operation can simply be
> parallelized as follows:
> 
> Stream
>        .of(inputs)
>        .flatMap(input -> Stream
>            .of(ops)
>            .map(op -> new Object[]{op, input}))
>        .parallel()
>        .map(opAndInput -> {
>            final Function<Input, Output> op = opAndInput[0];
>            final Input input = opAndInput[1];
>            return op.accept(input);
>        })
>        .reduce(this::merge);
> 
> Here input denotes the packages and ops denote the independent sequential
> steps performed in collectPlugins(). I don't know about the overhead of
> this call, but the above simple effort might be worth a shot. What do you
> think?

Reply via email to