You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve PlexusIoZipFileResourceCollection performance by using JarFile
Currently `PlexusIoZipFileResourceCollection` uses `PlexusIoURLResource`
to get the `InputStream` of the JAR entries. `PlexusIoURLResource`
uses `URL` and `URLConnection` to get the input stream. The problem is
that they create a new `JarFile` for every entry and in some cases
the `JarFile` initialization could be expensive
(for example when he JAR is signed). Using the `URLConnection`
cache would solve the performance issues but opens new one.
The cache is global for the build so if the JAR file have changed
during the build you may get the cached instance (see plexus-io#2).
Modify `PlexusIoZipFileResourceCollection` to use `JarFile`
directly instead of using `PlexusIoURLResource`.
That would solve solves the two issues - `JarFile` is initialized once
so there is no performance penalty and it is local so if the file
changed during the build the latest version will be picked up.
Under the hood `PlexusIoURLResource` uses `JarFile` as well
and keeping `ZipFileResource` extending `PlexusIoURLResource` would
both keep the behaviour and interface backward compatible.
Closes#106
0 commit comments