diff --git a/README.md b/README.md index 2bab679f..8a226f87 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ ImmediatelyFast is an open source Fabric mod which improves the immediate mode r ## Installation -The mod is requires the Fabric loader and is compatible with Minecraft 1.19 and higher.\ +The mod is requires the Fabric loader and is compatible with Minecraft 1.19 and higher. + You can download the mod from [Modrinth](https://modrinth.com/mod/immediatelyfast) -or [Github Releases](https://github.com/RaphiMC/ImmediatelyFast/releases/latest). +or [Curseforge](https://www.curseforge.com/minecraft/mc-mods/immediatelyfast) or [Github Releases](https://github.com/RaphiMC/ImmediatelyFast/releases/latest). ## Optimizations @@ -21,10 +22,10 @@ The following parts of the immediate mode rendering code are optimized: ### Performance Generally FPS should be 2x higher on busy servers and might also be up to 4x higher in cases where there are many -entities.\ -\ -The following table shows the performance improvements of the mod.\ -Tested on a server with 1000 entities in the visible view distance.\ +entities. + +The following table shows the performance improvements of the mod. +Tested on a server with 1000 entities in the visible view distance. Test Hardware: Ryzen 5 1600, 32GB DDR4, GTX 1060 | Other mods | Without ImmediatelyFast | With ImmediatelyFast | @@ -34,12 +35,13 @@ Test Hardware: Ryzen 5 1600, 32GB DDR4, GTX 1060 ## Compatibility -The mod should work fine with almost all mods.\ +The mod should work fine with almost all mods. Known incompatibilities: - Optifabric -Iris is supported but defeats some of the mods optimizations, as it replaces the Entity rendering engine with its own one.\ +Iris is supported but defeats some of the mods optimizations, as it replaces the Entity rendering engine with its own one. + If you encounter any issues, please report them on the [issue tracker](https://github.com/RaphiMC/ImmediatelyFast/issues) or feel free to join -my [Discord](https://discord.gg/dCzT9XHEWu). +my [Discord](https://discord.gg/dCzT9XHEWu). \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d2ab2133..1814c7cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,10 +5,10 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties | check these on https://fabricmc.net/versions.html minecraft_version=1.19.2 -yarn_mappings=1.19.2+build.18 +yarn_mappings=1.19.2+build.20 loader_version=0.14.9 # Mod Properties -mod_version = 1.0.1 +mod_version = 1.0.2 maven_group = net.raphimc archives_base_name = ImmediatelyFast diff --git a/src/main/java/net/raphimc/immediatelyfast/util/BufferBuilderPool.java b/src/main/java/net/raphimc/immediatelyfast/util/BufferBuilderPool.java index 4a6789fc..6bf0257a 100644 --- a/src/main/java/net/raphimc/immediatelyfast/util/BufferBuilderPool.java +++ b/src/main/java/net/raphimc/immediatelyfast/util/BufferBuilderPool.java @@ -11,18 +11,22 @@ public class BufferBuilderPool { public static final int MAX_SIZE = 4096; - private static final Set> POOL = new HashSet<>(); + private static long lastCleanup = 0; + private BufferBuilderPool() { } public static BufferBuilder get() { - cleanup(); + if (lastCleanup < System.currentTimeMillis() - 5_000) { + lastCleanup = System.currentTimeMillis(); + cleanup(); + } for (Pair entry : POOL) { final BufferBuilder bufferBuilder = entry.getKey(); - if (!bufferBuilder.isBuilding()) { + if (!bufferBuilder.isBuilding() && !((IBufferBuilder) bufferBuilder).isReleased()) { entry.setValue(System.currentTimeMillis()); return bufferBuilder; }