-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Summary
DataTransformer.applyTransformsIfPossible is appearing in Spark profiler samples during normal gameplay, called from Cobblemon's PokemonEntity and Pokemon class on what appears to be every entity tick. With 100+ Pokémon entities loaded on a multiplayer server this generates significant and continuous CPU overhead. DataTransformer is described as a mapping migration utility and should not be running per-entity-tick.
Steps to reproduce
- Install Platform alongside Cobblemon 1.7.3 and Vanilla Backport on a Fabric server
- Run a Spark profiler with 15+ players and wild Pokemon loaded
- Filter the flame graph for "DataTransformer"
What is the current bug behavior?
com.blackgear.platform.common.data.DataTransformer.applyTransformsIfPossible appears in Spark samples (127 samples in a 140,000 sample profile) called from:
- com.cobblemon.mod.common.entity.pokemon.PokemonEntity
- com.cobblemon.mod.common.pokemon.Pokemon
It is calling into the Mojang serialization codec pipeline and MoLang on each invocation, making each call non-trivial. It appears to be triggered by entity tick events rather than just on load/world join.
DataTransformer is described as a mapping migration utility. It should only run during data loading/migration, not on every entity tick. If it needs to run at entity creation time, results should be cached so subsequent ticks do not re-invoke the transformation.
Environment
- Platform version: 1.2.11.5 (Fabric 1.21.1)
- Cobblemon: 1.7.3+1.21.1
- Vanilla Backport: 1.1.5.4.2 (also by BlackGear — likely the reason Platform is loaded)
- Fabric Loader: 0.18.4
- Minecraft: 1.21.1
- Java: 21.0.2+13-LTS (Eclipse Adoptium OpenJDK)
Now honestly, I have no idea if this is just an issue on cobblemons side of things, but the Cobbleverse modpack has included your mods and thought it would be of use to let you know about this!