mojira.dev
MC-229631

Client-side lag spike while growing a tree using bone meal with Chunk Builder set to "Fully Blocking"

The bug

Using bone meal on saplings to grow a tree causes a big lag spike. This is most notable with 2x2 trees such as spruce and dark oak.

As of 1.18 Pre-release 5, this is only noticeable with "Chunk Builder" settings set to Fully Blocking.

To reproduce

1. Open the debug screen with Alt + F3.
2. Plant some saplings.
3. Bone meal the saplings until the tree grows.
4. ❌ A client-side lag spike occurs.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media]
ampolive

This could have something to do with MC-123584.

migrated

This doesn't seem like a purely client-side issue; the lag spike occurs globally for all players across a server.

Furthermore, the lag spike appears present even when the tree grows naturally without bonemeal.

Brevort

Well it has been confirmed by a moderator.

ampolive

This issue is about the client-side lag spike. If this also happens server-side on multiplayer, then probably a new ticket should be opened for that.

migrated

There's a good chance the client lag spike is being hidden from me due to a large disparity in system specs. I was searching for a bug behind the issue in HC and thought this was it, but you're right. Your original videos only show a client side spike. The other issue is likely datapack or mod related. Sorry to bother. 🙂 I'm going to delete my original comments.

migrated

It's difficult to say, because based on Hermitcraft video examples, although the lag that is manifested is server-wide, it also seems often exhibited client-side by what appears to be a drop in the frame rate.

I attempted to do some server-side tests by running ilmango's double 2x2 spruce tree farm in both 1.16.5 and 1.17. I picked this farm because it uses a 2x2 tree and also because nearly all of its redstone runs regardless of whether the tree grows or not, allowing us to isolate those effects. I ran both with only Carpet mod installed for performance gathering.

I used Carpet's server-side autoclicking (/player <playername> use continuous) in conjunction with a three-minute tick warp (/tick warp 3600).

In 1.16.5 I got the following numbers:

Farm on but bonemeal circuit off and no saplings placed: 1.52 mspt
Farm on but no saplings placed: 1.63 mspt
Farm on and saplings placed: 2.46 mspt

In 1.17 I got the following numbers:

Farm on but bonemeal circuit off and no saplings placed: 1.74 mspt
Farm on but no saplings placed: 2.13 mspt
Farm on and saplings placed: 3.40 mspt

In 1.16 there is a 50.9% increase in server lag for growing trees, whereas for 1.17 it is 59.6%. If we factor in both bonemealing and growing, it is a 61.8% increase in 1.16.5 compared to a 95.4% increase in 1.17. For a server under high load, this might be a significant enough difference to cause noticeable server lag.

I also tested using ilmango's fast 4-type tree farm. Using the same methods as earlier to run the farm, I got 6.95 mspt in 1.16.5 vs 7.26 mspt in 1.17. Unfortunately, most of the redstone in this farm runs in response to a tree growing, so I couldn't isolate the effects of different factors.

However, the simpler setup of running this farm meant that I could try to simulate a situation of entirely server-side interaction. I spawned a Carpet bot to place saplings and teleported to 1000, 1000 before running the tick warp. I didn't experience any lag; the server reached 11.00 mspt in 1.16.5 and 10.35 mspt in 1.17. It is certainly possible that for a server running at higher load, this may lead to server-side lag, though if so this wouldn't be new since 1.17 seems consistently more performant in this area. However, considering that Carpet bots are entirely server-side, this may not be an accurate simulation; it's certainly possible that something in the communication between client and server that is connected to the known client-side lag may lead to further server-side lag when it comes to this tree growing thing (which might help explain why when a player is present, the server does lag more in 1.17). And that combined with a server at high load may cause issues. But that is just speculation.

Anecdotally, 1.17 just felt laggier in general, especially client side (freezing for far longer and/or crashing despite the relatively low mspt values, especially when saplings were grown). However, it must be stressed that these results are very inconclusive and I don't know if they're reproducible.

I conclude that there is likely an increase in both client and server side lag for both bonemealing and sapling growth in 1.17, and speculate that the two may likely be connected. But this is not conclusive and warrants further investigation.

ampolive

Seems to be better in 1.17.1 Pre-release 2 for some reason, but it still happens.

TheTamedWolf

There is a bonemeal lag in Bedrock(mcpe) as well. It happens with saplings and sugarcane. 

ampolive

Please create a new ticket in the MCPE tracker for this issue.

ampolive

I cannot reproduce this issue in 21w38a.

wobst.michael

Did you test it with the various Priority updates settings? It could be very well depend on what this option is set to.

ampolive

Thanks for the advice. It only seems to happen when Priority updates is set to nearby.

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.19.

Avoma

Can confirm in 1.19.2.

[Mod] Jingy

Can confirm in 1.20.3

[media]

rkullenius

I am unable to reproduce, can you confirm that are you still able to reproduce this issue on the newest version?

ampolive

I'm not able to reproduce this issue in 1.21.3 either.

ampolive

(Unassigned)

Confirmed

Platform

Important

Performance

bone_meal, freeze, lag, lag-spike, tree-generation

1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, ..., 1.19.1, 1.19.2, 22w44a, 1.19.4, 23w14a

Retrieved