-
Notifications
You must be signed in to change notification settings - Fork 439
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
Drasticly improve zoom tile calculation for larger maps when using MySQL/MariaDB storage Engine #4011
Drasticly improve zoom tile calculation for larger maps when using MySQL/MariaDB storage Engine #4011
Conversation
…SQL storage engine. For Larger Tables doing Limit and Offset can have a big Impact on Statement execution because it is an IO heavy task. This fixes the issue by not doing any limit / offset on the SQL statement but instead query for all the data at once, and let the JDBC handler do the resultset handling. This can probably be adapted for MSSQL, PostgreSQL and SQLLite.
I did some further digging and found out that we are able to improve overall render performance drasticly for multicore rendering. in ImageIOManager we can remove all synchronized(imageioLock) {
...
} Statements. So far simple tests work on my machine, but I am unsure to make the change within this PR, let me know how to procede further. |
Fix https://bugs.openjdk.org/browse/JDK-6986863 is only indicated as fixed as of JDK 17 - and only then as of 17.0.8 (build 8), which is as of July, 2023. This code is common across a bunch of versions still only supported on JDK8 and JDK16, and no doubt a bunch of even current server are not running a July 2023 patched JDK, besides needing to see if this fix is also in Oracle JDK. |
Yes, I gues you are right on that one. |
Yeah - I'm gonna look into it separately: the ImageIO thing is a 'day zero' problem in the JDK, and while it's great to see that someone actually got around to fixing it, I just want to be sure to not do something that will break servers and/or result in broken tile renders without really confirming that the JDK being run on is REALLY fixed But, thanks for finding it! :) |
…t be needed anymore and improves render time by 8-10%
I think this should improve the overall performance.
For test Results see This is a test for improved render speed overall AND better render speed for MySQL/MariDB storage engine. Test was done on purpose with 2 old JDK17 versions, to avoid conflict if users are not using up to date versions
Test was done on a LXC Container
Explanation of the Changes:
Compare Oracle JDK 17 improvements |
In past VMs, ImageIO.write was just as thread unsafe - the changes, as is, remove the thread safety on writing unconditionally while adding the safety check back in only on ImageIO.read. Also, testing on 17 is all good, but the real tests are on JDK8 versions (which is basically anything before MC 1.17), since those are the versions that the change would break if done incorrectly. |
Are we still compiling for JDK8? When I download the latest version from https://legacy.curseforge.com/minecraft/bukkit-plugins/dynmap/files/4632182 it will not work with JDK8 and paper-1.16.5-794 telling me that it was compiled by a later version.
So the latest version can not be used anyway by pre 17 JDK. btw I am also unable to start using JDK 16 Additional Info: The last version that I am able to run with JDK8 is Dynmap v3.5-873 from https://legacy.curseforge.com/minecraft/bukkit-plugins/dynmap/files/4512871 |
Reason for the problem is that this line sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
is missing in DynmapCoreAPI/build.gradle I build a local version that works with JDK8 and paper-1.16.5-794. I verified that the version check I have implemented works - therefore on older JDK Versions we still use synchronisation. Do you want me to include the change to the DynmapCoreAPI/build.gradle with this PR? |
Yep - everything in the core is jdk8 (language level 8, more accurately) - platform specific components are built with language level appropriate to them. It's all built using JDK17, but the language level controls the op code generation. See https://github.com/webbukkit/dynmap/blob/v3.0/DynmapCore/build.gradle#L11 and the like for how this is done in each gradle component |
Yep - the level missing in the API module is incorrect, and should be 8. |
It seems that this is missing from latest release and causes incompatiblity with older versions. This should resolve this
Ok, have added this change to the PR as well. |
Thanks - had to recently make some other changes to accomodate those paper builds (didn't see problem on spigot...): suspect particular to some custom loader stuff - but oddly enough didn't see that problem when I tested current builds with 1.16.5 and openjdk8. |
Cool - I'll give PR a proper review tonight, and get it pulled - thanks for the effort! |
Thanks! |
…SQL storage engine. For Larger Tables doing Limit and Offset can have a big Impact on Statement execution because it is an IO heavy task.
This fixes the issue by not doing any limit / offset on the SQL statement but instead query for all the data at once, and let the JDBC handler do the resultset handling. This can probably be adapted for MSSQL, PostgreSQL and SQLLite.