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

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

Open
FTC55 opened this issue Jan 13, 2020 · 11 comments
Open

Comments

@FTC55
Copy link

FTC55 commented Jan 13, 2020

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.

@FTC55 FTC55 changed the title HotSwap recompiles all classes every time. HotSwap recompiles all classes every time and compilation is in general slow Jan 13, 2020
@Justsnoopy30
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Justsnoopy30 commented Jan 13, 2020

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
Copy link
Contributor

@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
Copy link
Author

FTC55 commented Feb 20, 2020

@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
Copy link
Contributor

@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
Copy link
Author

FTC55 commented Feb 21, 2020

@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
Copy link

7isenko commented May 17, 2020

Did anybody fix it?

@FTC55
Copy link
Author

FTC55 commented May 17, 2020

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

@7isenko
Copy link

7isenko commented May 17, 2020

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

@FTC55
Copy link
Author

FTC55 commented May 17, 2020

@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.

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

No branches or pull requests

4 participants