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

java 8 support, huge fps bump, cuz java 17 is utter trash #188

Closed
wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 9, 2024

please, instead of closing this pr immediately, i want you to actually think about how you can implement java 8 support upstream instead of outright not supporting it. i went from 25fps to 80fps by switching from https://adoptium.net/temurin/releases/ jdk 17 to oracle jdk8u231 with this mod. its not a want, its a necessity. for a version of minecraft which is expected to get high performance, it should be possible to use java 8 with this mod which is undoubtedly much faster then java 17

my laptop is a 2017 macbook pro and the bootcamp drivers for windows dont let me play vanilla 1.7.10 on this laptop, it spazzes out. this mod allows me to play 1.7.10 on this laptop. having java 8 support is a necessity to me.

if you could please implement the same or similar changes upstream to allow users to choose between java 8 or java 17 for example, id greatly appreciate that. thank you

image

@ghost ghost force-pushed the feature/1.8 branch from 7ad74b3 to 25b3f7f Compare November 9, 2024 05:11
@eigenraven
Copy link
Member

Lwjgl3ify already supports java 8 if you don't use the relauncher and install it in prism/multimc directly (and remove a couple of java arguments that java 8 interprets differently from the launcher json). Most of your code changes are completely unnecessary, we're using Jabel that compiles Java 17 switches and enhanced instanceof to Java 8 bytecode that runs just fine on 8 (a bunch of mods like twilight forest, gt5u and ae2 use this too).

The relauncher itself relies on modern java for the better ProcessHandle api to coordinate starting the new game process with the parent launcher process exit to avoid out-of-memory crashes that would otherwise occur on systems with limited memory, this is something that just doesn't exist on Java 8 and you can only add sleeps or similar to try to guess when it's safe.

Fwiw, for GTNH we plan to enforce Java 21 or maybe 25 when that releases as a new minimum required version at some point in the future, for all the useful standard library features it provides that are much less efficient or impossible on Java 8. This is not happening this year, but it will at some point in the near future.

@eigenraven eigenraven closed this Nov 9, 2024
@ghost
Copy link
Author

ghost commented Nov 9, 2024

using java 17 syntax to code java 8 bytecode is haram

thats like saying oh yes lets speak spanish itll be alright because i got my handy dandy little translator guy right here to make it all work out

its an inferior syntax, language

also you might wanna fix your readme then, if what your saying is accurate

image

additionally, you can use JNA on windows to replace the use of the ProcessHandle api for use on java 8

https://stackoverflow.com/a/9463010

simply make a while loop that checks if the parent process pid is alive or not using JNA that breaks once it no longer isnt alive

and if you still insist on using ProcessHandle api for newer java versions, you can add a if statement to check which java version number they are running and if it is java 8 do JNA and if its anything newer do ProcessHandle

i might make another commit to do this actually when i get to work in a few hours

@ghost
Copy link
Author

ghost commented Nov 9, 2024

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.

1 participant