You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Ken Hu via users <us...@groovy.apache.org> on 2023/02/03 19:58:51 UTC

Import Statement Resolving

Hi Everyone,

I'm facing a performance issue for Groovy 2.5.X when running multiple short
scripts that contain roughly 150 imports.

The application is built on top of groovysh. For convenience, we import the
most common methods and classes to help enhance our user's experience. The
imports are a mix of simple, star, static, and static star imports. We
noticed that since the introduction of the fix for GROOVY-5103, the import
statements are taking much longer to resolve. If the user enters a simple
line that is executable (e.g. 1+2) then the majority of the time is spent
resolving the imports. We are trying to minimize the number of imports but
the slowdown can be substantial if many simple lines are executed.

Does anyone know of any potential options or workarounds for this issue?

Thanks,
Ken