跳到正文

Anacondy

作者:Paint_Ninja

A low-level optimisation mod that allows Java to perform deeper optimisations throughout the game by giving it stronger guarantees about effective constants

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Straighten those snakes!

Anacondy is an optimisation mod that rewrites accesses of effectively immutable fields in various parts of the game to use ‘CONDY’ (CONSTANT_Dynamic) instructions, allowing Java to more confidently perform constant folding optimisations.

In other words, Anacondy gives Java stronger guarantees that certain things never change after the game has started, allowing the Java runtime to better optimise everything that touches those things and to do it sooner, which improves
performance.

Where will I see the benefits? What’s the catch?

Those that have a slow CPU, using integrated graphics and/or are memory bandwidth constrained should see the most benefit from this mod.

This mod is still a work in progress so it doesn’t optimise as deeply as it theoretically could. Performance and stability should improve overtime in future releases as I figure out how to constant fold more complicated cases in a somewhat generic fashion.

Nevertheless, over a thousand different code paths in the game are at least partially optimised with this mod, where ordinarily Java would either never optimise, or at least not be able to until the game has been running for long enough for it to be confident enough to try.

Unlike some other performance mods, I deliberately don’t change any of the game’s existing logic to achieve these optimisations, so mod compatibility should theoretically be pretty decent. That also means it should also be acceptable for use in speedruns where game accuracy is important (check with the moderators first, of course).

Versions and other loaders

The initial release is for Forge 1.21.11. I plan on supporting other versions and loaders once I’ve added more optimisations and cleaned up the internal workings. Let me know in the comments which version and loader you’d like me to port to first when the time comes.

Why the name?

It’s a play on words of anaconda and condy – the latter of which is shorthand for the key Java runtime feature this mod uses to achieve its optimisations.

The snake-like name came to me while watching Indiana Jones recently and how the way snakes move are a somewhat good representation of the indirection this mod tries to fix… without this mod, lots of the game’s code paths have to wind through different places left and right checking things just in case they might change (even though they never will), but with the mod it knows these things won’t change and can take straighter, more direct routes.

Disclaimer

This is an early alpha version. A lot of the changes made to the game are done by hand to help improve mod compatibility and stability, however it lacks real-world testing. Please report any issues you find on the issue tracker.

常见问题

Anacondy 支持哪些 Minecraft 版本?

Anacondy 支持 Minecraft Java 版 1.21.11,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

Anacondy 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Paint_Ninja 的其他作品

查看全部 →