Kelp is quite expensive #3395
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#3395
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MineClone2 version: master
What happened?
When flying over ocean profiling, kelp code is very expensive.
While mapgen is complex, heavy and does a lot of work (19.15%), mcl_ocean/kelp is hogging some resources on 6.6%. See attached profiling visualisation.
kelp.surface_on_timer(pos) is the function in question. Looks like each kelp on place has a 0.2s step timer set to process growing etc.
Alongside all our surface floating kelp, this is not idea and does need a rework. Considering it's also the best way of creating water source blocks for bubble columns, kelp really needs some love.
What should happen:
Profile on load and just sitting over water. Investigate and see if this can be reworked. Could be part of a larger kelp rework.
Kelp shouldn't use on_timer for growth. That's insane. When I tested using node timers for bamboo, it broke often (was really unreliable) and was not performant at all.
Plant growth should be in an ABM, and it should be done intelligently. While I have seen kelp floating items in Minecraft in my expeditions, it's not been as many as what MCL2 has. Node timers have their uses, but there's a LOT of maintenance to have them and making sure that they shut off properly. And, as I said, they aren't guaranteed to run. Making a performant abm for kelp should be a (as noted) priority. And, that .2 second timer is most likely why we have a ton of kelp, and why it lags and causes holy flying kelp issues.
#3061 (kelp item entities caused during mapgen) and #3071 & #1565
#3104
Look at the Nodestep stuff in this issue: #2564
"The biggest expense remaining is the ABM that removes unsubmerged. This makes farms work, and really needs improvement functionality wise. The only reason I can see for the kelp farm working is because of the piston removing the water source block and the kelp being unsubmerged and dropping.
There are further issues such as broken kelp in flowing should replace it with a source block. This is a way to create a bubble column. I will create a ticket to pull all this information together, but in terms of hammering performance, this is greatly improved and more maintainable."
I have lowered the priority of this part as it could need some piston work and more kelp work but it's no longer massively impacting performance as it was before.