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

Performance doubts #26

Open
01XUAN opened this issue Feb 5, 2025 · 6 comments
Open

Performance doubts #26

01XUAN opened this issue Feb 5, 2025 · 6 comments
Labels
enhancement New feature or request

Comments

@01XUAN
Copy link

01XUAN commented Feb 5, 2025

1.21.1 - 0.9版本
在加载的时候(如刚进游戏,加载短时间内没有加载过的区块),区块越多,卡顿越明显。刚进游戏会持续这样卡顿十几秒,仅一个模组时也是如此

Image

@joe-vettek joe-vettek changed the title 性能问题 Performance doubts Feb 5, 2025
@joe-vettek
Copy link
Owner

tps? 那需要看spark日志

tps? which needs the spark profiler log

@joe-vettek
Copy link
Owner

哦,我大概知道了,这个其实是一个优化,主要是在区块首次加载并发送给玩家的时候影响。后续我看能不能优化吧。不过目前的话,其实也不必过度担忧,对于老区块而言就会优化模组逻辑了。

Oh, I roughly understand. This is actually an optimization, which mainly affects the first time a chunk is loaded. I will see if it can be optimized later. But for now, there is actually no need to worry too much, as the impact on old blocks is very small.

@joe-vettek joe-vettek added the enhancement New feature or request label Feb 5, 2025
@01XUAN
Copy link
Author

01XUAN commented Feb 5, 2025

我的问题(优化模组不禁用完就下结论了),c^2m干的,前者有c^2m,后者没有
https://spark.lucko.me/yt6VQV8lzQ
https://spark.lucko.me/dyiQeWB5BN

@joe-vettek
Copy link
Owner

简单来说,就是节气首次加载区块时,会预先计算和缓存群系信息,因为Minecraft查询速度非常慢,做了这一步优化的话,群系查询速度可以提高20倍,也就是减少了95%的耗时。一般来说,正常跑图速度的话,其实不必担心。

In simple terms, when a chunk is loaded for the first time, biome information will be pre-calculated and cached. Since Minecraft query speed is very slow, this optimization can increase biome query speed by 20 times, which means 95% of the time consumption is reduced. Generally speaking, if the map runs at normal speed, there is no need to worry.

@01XUAN
Copy link
Author

01XUAN commented Feb 5, 2025

好的

@joe-vettek
Copy link
Owner

C^2M 似乎利用了多核性能来加载,这放大了这个工作的影响,一下子太多了应该是,发送数据的这个步骤应该还是单线程的。

C^2M seems to take advantage of multi-core performance to load, which amplifies the impact of this work. There is probably too much at once. The step of sending data should still be single-threaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants