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

Make classpath entries properly lazy #118

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zml2008
Copy link
Collaborator

@zml2008 zml2008 commented May 8, 2022

This primarily reduces the memory consumed by FF, now able to decompile one of the 1.18.2 snapshots with a minimum of 2GB of ram, rather than the 4+GB previously required.

There may be some performance improvements from this change as well, but the difference between this change and just #116 is pretty negligible, so it's not super useful for judging this PR.

I've also introduced a -jrt <1|current|path> option, which allows reading JDK classes from a JEP220 java runtime image, or the legacy rt/lib/*.jar and lib/*.jar format, to cover modern and pre-J9 runtimes. This means that users who want to decompile classes produced for a version of Java older than the one required for Forgeflower (now J17) can reference that runtime, without any attachment to what FF requires.

There is no change to the decompiled output from this branch.

Currently, these changes are tacked into a patch at the end of the list -- once I gather up the motivation/initial review has happened, I'll move the lazy classpath patch earlier in the sequence, so later patches can make their changes taking advantage of the lazy classpath API. I'll leave it as a draft until then.

This brings total time needed to decompile Minecraft 1.18.2 from
~38 seconds, to ~25 seconds on my machine. Decomplication can be quite
easily performed with only 2GB of memory allocated to the JVM, when
previously 4+GB was required.

Add -jrt option to enable decompiling with classes from another JVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TODO: Reevaluate include-entire-classpath
1 participant