agiledigital / mule-metadata-extractor

This is a tool for extracting extracting icons and metadata from Anypoint Studio
Apache License 2.0
0 stars 3 forks source link

Improve efficiency of Jar extraction #4

Open NoxHarmonium opened 4 years ago

NoxHarmonium commented 4 years ago

The way it works right now, every time a call is made to extract a file from a Jar, the whole Jar file has to be streamed.

https://github.com/agiledigital/mule-metadata-extractor/blob/master/src/mule_preview/tools/zip_utils.clj#L24

The only reason this isn't prohibitively slow is because of the OS file cache. All the Jars get loaded into the file cache and are accessed from memory. You notice this when running the tool for the first time and cache isn't populated.

It would be much more efficient to get a list of files to extract from a Jar and stream the Jar file once.