HyperCubeMC / Modern-Minecraft-Decompiler

Modern Minecraft Decompiler
https://the-hyperzone.github.io/Modern-Minecraft-Decompiler/
MIT License
60 stars 8 forks source link

HotSwap recompiles all classes every time and compilation is in general slow #11

Open FTC55 opened 4 years ago

FTC55 commented 4 years ago

Hi, I have an issue with the tool in IntelliJ. Whenever i modify the code and then compile it with CTRL+SHIFT+F9 while the client is running not only does it take a very long time to recompile (just like it does to compile everytime even when you're not actually hotswapping while the client is running so the issues might be related), but I can also see that even if i only apply changes to one class, all of the classes are reloaded which also takes an incredible amount of time. My guess would be that there is something that tries to compile everything everytime no matter what, even if only a small modification was made to the code.

Justsnoopy30 commented 4 years ago

Yep, happened for me too when I used this tool. It's not really maintained by me unless it's a version bump as I have other projects (not on GitHub) I'm working on, and school. This is GitHub, so of course if you know how to fix it, you can submit a pull request to fix it, and I'll merge it.

Justsnoopy30 commented 4 years ago

I don't know how to fix this anyway as this is just a Gradle script that uses ForgeGradle to decompile and recompile Minecraft, this just allows you to edit raw Minecraft code instead of making a Forge mod.

Justsnoopy30 commented 4 years ago

Matter of fact, I'll put my side project (a chat app) on GitHub soon so others can help after I figure out the license I want. Edit: Done https://github.com/hypercubemc-github/HyperChat

ahmed605 commented 4 years ago

@FTC55 try this method https://github.com/hypercubemc-github/Modern-Minecraft-Decompiler/wiki/Running-the-Client-in-the-IDE#method-3--not-recommended-

PS:if doesn't work try the method 1. Please let me know if this fixed your problem

FTC55 commented 4 years ago

@ahmed605 Unfortunately it didn't work. Is there a way for me to compile everything with the built in compiler instead of gradle? I think that could help.

ahmed605 commented 4 years ago

@FTC55 the method that I sent (method 3) uses the IntelliJ compiler and not the gradle one and it's working for me, maybe you didn't chose the new configuration and you used the old one accidentally

FTC55 commented 4 years ago

@ahmed605 Either I misunderstood the procedure or it just doesn't work. I made sure i used the new config i had created following method 3 and still it was clearly compiling using gradle as the log said :compileJava and "starting Gradle daemon"

7isenko commented 4 years ago

Did anybody fix it?

FTC55 commented 4 years ago

@7isenko i enabled gradle caching, incremental compilation and parallel execution and that seems to speed it up a bit

7isenko commented 4 years ago

I've found a solution image I also use HotSwapAgent with DCEVM in my JDK but it may not be needed image

FTC55 commented 4 years ago

@7isenko it's funny how i was just about to write that! we found it contemporarily. Gradle is such a bad idea... so slow. Although at first you need it to setup everything. I'd suggest @ahmed605 or anyone of the mantainers to add it to the wiki, at least if not as the main procedure as one intended for those who heavily rely on hotswap for debugging.