hammertater / treechop

MIT License
16 stars 6 forks source link

Huge FPS drop when looking at the logs of a giant tree, TPS increase when breaking said logs. #244

Closed Infestidos closed 6 months ago

Infestidos commented 6 months ago

Forge 1.19.2 v0.18.4 & v0.18.5. Giant tree (A) vs Regions Unexplored Redwood (B) for spark profiling.

Trees.

Breaking a SINGLE block in creative in the giant tree produces this spark profile: Tree A. Breaking an ENTIRE Redwood tree produces this spark profile Tree B. A shows noticeably larger numbers under the mods section.

Simply walking around inside the tree drops my FPS to as low as 3 if I'm looking at logs. The second I look at any other type of block the issue stops. Doesn't matter if I'm looking at the tip of a root, the middle of the tree, or a branch in the canopy.

Both trees using tool tip mods show a max log count of the default ~320. Disabling Chopping or removing this mod fixes the issue.

hammertater commented 6 months ago

Thanks for all the info! Treechop’s definitely misbehaving. I’ll get it fixed.

hammertater commented 6 months ago

Yikes, some optimization code was actually running backwards, so tree detection (checking for leaves connected to the tree) was always giving worst-case performance (scan all the tree's logs) instead of best-case (scan just enough logs to find leaves). Even worse, this step wasn't respecting the max tree size setting. I'll try to get the patch up tonight, it should improve performance significantly.

hammertater commented 6 months ago

It should be fixed in 0.18.6

Infestidos commented 6 months ago

Thanks that fixed it