该项目代码由人工智能协助创建。
一款开源模组,为你的 Minecraft 提供一系列小型优化。减少卡顿、略微加快资源加载和世界生成速度、降低内存占用。
Lomka 的主要功能是减少冗余垃圾(内存)分配并改善游戏计算。
优化项
帧时间
- 在渲染、刻和碰撞循环中减少分配(顶点写入、姿态堆栈、实体方块扫描)
- 缓存字体字形进距(已弃用)
- 更轻量的数学和颜色引擎
- 更快的纹理图集动画(惰性循环)
- 播放声音时跳过等待声音线程的时间
- 从客户端刻循环中移除
Thread.yield()
加载与内存
- 服务端的世界、玩家和结构数据的大批量 NBT 数组读取(区块、高度图和存档以块为单位加载,而非逐元素流式调用)
- 更轻量的资源扫描和缓存的包元数据读取
- 上传后释放生成的 mip 级别
- 减少原生缓冲区重新分配(音频流式传输和网格构建)
世界与网络
- 缓存体素形状框和方块面稳固性
- 更快的方块和区块遍历、世界生成的高度图映射以及原地世界生成随机数重设(此外,请先查看不兼容列表)
- 更精简的网络缓冲区和数据包压缩(不影响你的连接质量)
以及对游戏代码的一些其他小型错误修复。
实测效果
在 JDK 25 上进行的隔离微基准测试,每次操作一次。
这不是游戏内帧率基准测试:
| Patch | Measured | What you notice it in |
|---|---|---|
| Voxel shape decomposition | toAabbs(): 40 ns vs 8584 ns, 199x+ (14 ns vs 8879 ns on 368 cells) |
实体移动时接触到的每个方块 |
MixinLegacyRandomSource |
next(int): 7.1x |
客户端和专用服务器上新区块需要的所有随机抽取。 |
MixinBlockPos.betweenClosed |
one 16³: 61 ms -> 11 ms, 5.61x | /fill 和其他体积编辑、大型建筑后的光照传递、结构和特性放置、爆炸方块列表。 |
MixinBlockStateBaseCache |
isFaceSturdy: 4.1-5.8x |
如走在 slab 和楼梯上、实体与玩家之间的碰撞解决、邻居改变时的支持重新计算等检查。 |
MixinCompressionDecoder |
setupInflaterInput: 37.5 ns -> 18.1 ns and 128 B -> 0 B per packet |
每个传入的压缩数据包 |
MixinSoundEngine |
sound acquisition: 400 us -> 20 us, stall per tick 512 us -> 27 us | 客户端线程停止等待声音线程。 |
MixinAutoStorageIndexBuffer |
index buffer grows x4: 1.47-2.9x less time reallocating (85.4 ms -> 29.5 ms, 21 -> 11 reallocations; retains 40 MiB instead of 34) | 几何体尖峰(例如拉远渲染距离) |
MixinFallbackResourceManager |
metadata lookup: 5.33x (2.71 ms -> 0.51 ms for 20k files) | 启动和每次资源重载(F3+T,仍在轻微改进) |
MixinMth |
ceillog2 and log2: 3.93 ns -> 0.85 ns (4.6x), 4.83 ns -> 0.84 ns (5.7x) |
调色板大小、区块和缓冲区计数、原版所有询问位长度的地方 |
版本
1.21.11 是主版本。 它包含完整的优化集并接受最多的测试。
现代变体:
| Minecraft | Loaders |
|---|---|
| 1.16.5 | Fabric |
| 1.18.2 | Fabric, Forge |
| 1.19.2 | Fabric, Forge |
| 1.20-1.20.1 | Fabric, Forge |
| 1.21-1.21.1 | Fabric, NeoForge |
| 1.21.4 | Fabric, NeoForge |
| 1.21.6-1.21.8 | Fabric, NeoForge |
| 1.21.9-1.21.10 | Fabric, NeoForge |
| 1.21.11 | Fabric, NeoForge |
| 26.1-26.1.2 | Fabric, NeoForge |
| 26.2 | Fabric, NeoForge |
| 26.3 | Fabric, NeoForge |
旧版构建覆盖 1.7.10、1.8.9 和 1.12.2,基于 Forge 和 Ornithe。这些是独立的移植版本,补丁集更小,拥有自己的补丁列表。Forge 变体需要与 Lomka 一起安装 mixin 运行时(1.8.9 和 1.12.2 上的 MixinBooter 11.17,1.7.10 上的 UniMixins);Ornithe 变体则无需任何额外内容,因为 Ornithe 加载器自带 mixin 运行时。请参阅 Mixin Configuration (legacy)。
❗ 1.21.11 之外的所有内容都是相同或其他理念的移植版本,改进幅度较小。
常见问题
我安装了 Lomka 后看到性能下降
首先更新到你 Minecraft 版本的最新构建。
仍然糟糕?请报告它(链接在下面),并提供你的游戏版本、加载器、模组列表以及你关闭了哪些配置。
它会改变原版行为吗?
当然不会,但如果它确实导致了奇怪的游戏变化,请在 问题跟踪器 中回复。
它与服务器端兼容吗?
是的,兼容。
它需要任何依赖项吗?
不需要。唯一的外部要求是 mixin 运行时,仅适用于旧版 Forge 构建(1.7.10-1.12.2)。Ornithe 版本自带。
我可以把这个模组加入我的整合包吗?
当然可以。Lomka 是免费且开源的。建议先在您的整合包中测试一下效果。
配置
Lomka 没有游戏内图形用户界面(GUI)。相反,在首次启动时,它会创建 config/lomka-mixins.properties 文件,其中包含基本的 mixin 配置。
带有描述的完整 mixin 列表请参阅维基:
Mixin Configuration 适用于 1.16.5-26.3。
Mixin Configuration (legacy) 适用于 1.7.10-1.12.2。
兼容性
这应该能与大多数模组(如 Sodium、Lithium、Iris、FerriteCore、ModernFix、ImmediatelyFast 甚至 VulkanMod)良好配合,但无法保证完全兼容。
已知的冲突及其对应的 Lomka 版本列在 不兼容模组列表 中。
错误报告
发现了仅在安装 Lomka 时出现的问题?
- 请先尝试在不安装 Lomka 的情况下,并禁用各个补丁来复现该问题。
- 如果问题仍然存在?请将其发布到 问题追踪器,并可附上日志文件。
请不要将 Lomka 相关的崩溃报告给其他模组的作者,因为 Lomka 的 mixin 机制可能会破坏无关的系统。
致谢
Lomka 由 Starlev 及贡献者开发。
此外,感谢以下模组因其高效工作而获得的认可:
VecDeltaCodec零增量路径改编自 Misanthropy 的 Collections Of Optimizations(LGPL-3.0)。Vec3iPhiMix 哈希算法归功于 ZZZank 的 EfficientHashing(CC0-1.0)。- 遗留硬件位块传输呈现路径参考自 Tritium(MIT),但在 VulkanMod 中得到普及(仅 LGPL-3.0)。
The project code was created with help of Artificial Intelligence.
An open source mod with mix of small optimizations for your Minecraft. Less stutters, slightly faster resource loading and world generation, less memory usage.
The main thing Lomka does is reduce the number of redundant garbage (memory) allocations and improves game calcs.
Optimizations
Frame time
- Fewer allocations in the render, tick and collision loops (vertex writes, pose stacks, entity block sweeps)
- Cached font glyph advances (deprecated)
- Cheaper math and color engine
- Faster texture atlas animation (lazily cycle)
- Playing a sound skips the wait for the sound thread
- Removing
Thread.yield()from the client tick loop
Loading and memory
- Bulk NBT array reads for world, player and structure data on the server side (chunks, heightmaps and saves load in blocks instead of per-element stream calls)
- Cheaper resource scanning and cached pack metadata reads
- Generated mip levels releases after upload
- Fewer native buffer reallocations (audio streaming and mesh building)
World and network
- Cached voxel shape boxes and block face-sturdiness
- Faster block and section traversal, heightmapping for world generation, and in-place worldgen RNG reseeds (also, check the incompatibilities list first)
- Leaner network buffers and packet compression (without affecting your connection)
And some other small bugfixes in the game's code.
Measured effect
Isolated microbenchmarks on JDK 25, one operation at a time.
That's not in game frame rates benchmarks:
| Patch | Measured | What you notice it in |
|---|---|---|
| Voxel shape decomposition | toAabbs(): 40 ns vs 8584 ns, 199x+ (14 ns vs 8879 ns on 368 cells) |
Every block an entity touches while moving |
MixinLegacyRandomSource |
next(int): 7.1x |
Every random draw a new chunk needs, on the client and dedicated server. |
MixinBlockPos.betweenClosed |
one 16³: 61 ms -> 11 ms, 5.61x | /fill and other volume edits, the lighting pass after a large build, structure and feature placement, explosion block lists. |
MixinBlockStateBaseCache |
isFaceSturdy: 4.1-5.8x |
Checks such as walking on slabs and stairs, collision resolution between mobs and players, support recomputation when a neighbour changes. |
MixinCompressionDecoder |
setupInflaterInput: 37.5 ns -> 18.1 ns and 128 B -> 0 B per packet |
Every incoming compressed packet |
MixinSoundEngine |
sound acquisition: 400 us -> 20 us, stall per tick 512 us -> 27 us | Client thread stops waiting for the sound thread. |
MixinAutoStorageIndexBuffer |
index buffer grows x4: 1.47-2.9x less time reallocating (85.4 ms -> 29.5 ms, 21 -> 11 reallocations; retains 40 MiB instead of 34) | Geometry spikes (for example, pulling the render distance) |
MixinFallbackResourceManager |
metadata lookup: 5.33x (2.71 ms -> 0.51 ms for 20k files) | Startup and every resource reload (F3+T, still slightly improving) |
MixinMth |
ceillog2 and log2: 3.93 ns -> 0.85 ns (4.6x), 4.83 ns -> 0.84 ns (5.7x) |
Palette sizes, section and buffer counts, every place vanilla asks for a bit length |
Versions
1.21.11 is the main version. It carries the full set of optimizations and gets the most testing.
Modern variants:
| Minecraft | Loaders |
|---|---|
| 1.16.5 | Fabric |
| 1.18.2 | Fabric, Forge |
| 1.19.2 | Fabric, Forge |
| 1.20-1.20.1 | Fabric, Forge |
| 1.21-1.21.1 | Fabric, NeoForge |
| 1.21.4 | Fabric, NeoForge |
| 1.21.6-1.21.8 | Fabric, NeoForge |
| 1.21.9-1.21.10 | Fabric, NeoForge |
| 1.21.11 | Fabric, NeoForge |
| 26.1-26.1.2 | Fabric, NeoForge |
| 26.2 | Fabric, NeoForge |
| 26.3 | Fabric, NeoForge |
Legacy builds cover 1.7.10, 1.8.9 and 1.12.2, on Forge and on Ornithe. These are a separate port with a much smaller patch set and their own patch list. The Forge variants need a mixin runtime installed alongside Lomka (MixinBooter 11.17 on 1.8.9 and 1.12.2, UniMixins on 1.7.10); the Ornithe variants need nothing, because the Ornithe loader ships the mixin runtime itself. See Mixin Configuration (legacy).
❗ Everything outside 1.21.11 is a port of the same or other ideas with a smaller improvement.
FAQ
I see performance drops with Lomka installed
Update to the latest build for your Minecraft version first.
Still bad? Report it (link below) with your game version, loader, mod list, and which config you had turned off.
Does it change vanilla behaviour?
Nope, of course, but if it does weird game changes reply in the issue tracker.
Is it server-side compatible?
Yes, it is.
Does it need any dependencies?
No. The only external requirement is the mixin runtime, and only on the legacy Forge builds (1.7.10-1.12.2). The Ornithe ones ship their own.
Can I add this mod in my modpack?
Sure. Lomka is free and open source. Check out how it goes on your modpack first.
Configuration
Lomka has no in-game GUI. Instead, on first launch it creates config/lomka-mixins.properties with basic mixin configuration.
The full list of mixins with descriptions lives in the wiki:
Mixin Configuration for 1.16.5-26.3.
Mixin Configuration (legacy) for 1.7.10-1.12.2.
Compatibility
This should work fine with most mods (like Sodium, Lithium, Iris, FerriteCore, ModernFix, ImmediatelyFast and even VulkanMod) but no guarantees at all.
Known conflicts are listed with Lomka versions in the incompatibilities list.
Bug reports
Found something that only happens with Lomka?
- Try reproducing it without Lomka first, and with the individual patches disabled.
- Still there? Post it on the issue tracker with an optional log attached.
Please don't report Lomka-related crashes to other mod authors, because Lomka's mixins are cruel that could break unrelated systems.
Credits
Lomka was created by Starlev and contributors.
Also, other mods credits for their's effecient work!
VecDeltaCodeczero-delta path adapted from Collections Of Optimizations by Misanthropy (LGPL-3.0).Vec3iPhiMix hashing credits EfficientHashing by ZZZank (CC0-1.0).- The legacy hardware-blit presentation path references from Tritium (MIT), but popularized in VulkanMod (LGPL-3.0-only).
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lomka
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧