Skip to content

Sync chunk loading in cloudnet-modules/cloudnet-signs causes low TPS #381

@TnTGamesTV

Description

@TnTGamesTV

Description of the bug
Component: cloudnet-modules/cloudnet-signs

When checking if a specific location is a sign and the chunk is not loaded, the loading is synchronous.

In my case, the TPS dropped to 5 while CPU utilization rose to 80-90% across all cores.

The root cause of the low performance was the synchronous call Location#getBlock in BukkitSignManagment.

I would be able to provide a matching PR if there is interest in fixing this.
The fix does require the 'Paper' API. Only loading chunks async when the required method is available could also be engineered (might be a bit more 'hacky').

My fix improves global performance by 1000% and plugin performance by about 950% (see 'Timings' Reports).

Steps to reproduce this bug
I was not able to reproduce the bug on other Worlds apart from where it first occurred.

It seems like a lot of entities or strain in general needs to exist in unloaded chunks.

My Fix
Wrapping the Location#getBlock call with World#getChunkAtAsync.

Expected behavior
In general the usage of Paper async chunk loading.
For this case, no game-breaking performance.

'Timings' Reports
Befor My Fix
After My Mix

Environment and used hardware
System specifications: VPS, 6 cores, Intel® Xeon® E5-2620v3 / E5-2630v4 / 4114 / AMD EPYC™ 7282 (one of these)
OS: Ubuntu 18.04 LTS
Version: CloudNet 3.3.0

Metadata

Metadata

Assignees

Labels

t: bugSomething isn't working as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions