Closed nirvdrum closed 6 years ago
As mentioned on IRC, I would like to see if a simple BufferedInputStream has the same impact, since it would be simpler code and would not need to read the zipped content entirely into memory.
BufferedInputStream
might be a tad slower because it will end up opening the JAR file multiple times, but I think it borders on inconsequential. I've updated the PR to use it since it's much clearer.
Individual reads from ZipFileInputStream, as would be encountered when reading a resource from a JAR, can be very inefficient. They allocate a single-byte array and require unzipping the source file for each read (at least in OpenJDK 8).