Closed Mothblocks closed 1 year ago
I think some of this came from removing overlay queueing.
CC @Kapu1178.
Also, ideally the /species
subtypes of human shouldn't be creating a human with human limbs updating with human limb code on initialize. species/Initialize
is 326ms over 5 calls, and most of that is just wasted work.
maybe the cache broke at some point, as limb icons are cached. Well, the icons that are applied during update_body_parts()
.
i looked into this for 2 seconds, only because if the cache is broken that'd piss me off.
its not broken, its just species retardation.
because monkeys spawn with randomized dna, it needs to first draw and cache the human bodyparts. Because you can't spawn as a species, you spawn as a human and get set_species()
'd into it. This is most impacted by skintones, as if that skintone hasn't been generated prior in the round, it will have to generate each limb for the skin tone. And due to the nature of heads, every monkey is a new head icon, because heads have so many variables its unlikely for the same one to generate twice during mob spawning.
My last post still has relevance then, /species
should avoid doing all of that until we know it's necessary (which it wouldn't be for monkeys, but would be for felinids)
Good luck doing that while maintaining what little readability exists of species and bodypart code, and without introducing new footguns.
My last post still has relevance then,
/species
should avoid doing all of that until we know it's necessary (which it wouldn't be for monkeys, but would be for felinids)
Done
species/proc/on_species_gain
is 358ms over 26 calls (config'd, more without because of prefs menu). Median time per call is 13.8ms.The cost of this is 80% from
species/proc/replace_body
, and 19% fromspecies/proc/regenerate_organs
.74% of
species/proc/replace_body
is/obj/item/bodypart/proc/replace_limb
(182ms over 156 calls). Of this, 53% istry_attach_limb
, 46% isdrop_limb
.The cost for both eventually ends up being mostly in
carbon/update_body
->carbon/proc/update_body_parts
-> getting icons, updating overlays, removing overlays, etc etc etc. It's an enormous waste of processing power.Savings amount (.182) is based off of replace_limb.