-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Improve CLI performance by serializing pregenerating data at build time that can deserialized during runtime #323
Comments
I've implemented a solution that covers part of the problem, by serializing a CLI tree state snapshot using Kryo to file and reading it back instead of recreating the tree from scratch. This improves performance by about 25%. I'm still looking into further optimization, because a lot of performance is lost by the therapi library, which provides Javadoc in runtime (which is used to fuel the CLI commands/options documentation). |
I've also implemented a serialized cache now that maps lookups from Method to their resolved MethodJavadoc therapi counterpart. Total runtime has not been reduced to maybe 10-20% of the old runtime. On my heavy duty dev laptop it took 4 seconds to start executing from CLI, which is now takes mere milliseconds. Huge performance increase from the command line. |
… snapshot as serialized data (using Kryo) and reading that back instead of rebuilding the tree from scratch (saves 1 seconds or roughly 25% of total time)
…instances in addition to the previous CLI tree snapshot serialized data file. These cache data files are generated during package phase and included in the CLI artifact zips in the classpath folder. [skip ci]
7.0.0 just released with this improvement. |
The way CLI support works is that each time the Main method is invoked, Simple Java Mail builds up the entire CLI command tree that can be invoked. This is a time consuming action and delays and command line execution by many seconds.
Instead, it would be great if we could generate it before each release, serialize the result to a file and deserialize that instead each time. That would make CLI commands execute near instantly.
The text was updated successfully, but these errors were encountered: