Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize startup time #5

Merged
merged 3 commits into from
Sep 6, 2023
Merged

Conversation

TheItivitist
Copy link

Optimize listJar() method

listJar() is a method that returns a list of files contained within a Jar file according to a glob pattern.

It used to rely on a ZipInputStream that needs to read the entire file to discover its content.

Now switched to a ZipFileSystem that is able to use the Central Directory at the end of the file directly to list contained files, therefore it is by order of magnitude faster.

Optimize pathing jar generation

Manually generate a file name using regular Random rather than using Files.createTempFile() since this latter uses SecuredRandom which itself queries network interfaces which takes more time than a good old System.nanotime() of Random.

JavaNCSS is no longer maintained and stopped
its support to Java 7...

Change-Id: I900e36f2dfc9f5b9746d5bc9afc3987a6314113b
listJar() is a method that returns a list of files
contained within a Jar file according to a glob pattern.

It used to rely on a ZipInputStream that needs to read
the entire file to discover its content.

Now switched to a ZipFileSystem that is able to use the
Central Directory at the end of the file directly to list
contained files, therefore it is by order of magnitude
faster.

Change-Id: Idecd9c512fc878d13e04f60d9500173b26220db0
Manually generate a file name rather than using Files.createTempFile()
since this latter queries network interfaces which takes more time
than a good old System.nanotime().

Change-Id: Ib1e8765f010e8332e882b77d5a6ccac1d4860b9e
@benoitdesire benoitdesire merged commit f9fe866 into Itiviti:master Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants