[boskid][2.0.5] Running JSON migrations with Lua code is painfully slow
Posted: Fri Oct 18, 2024 3:52 pm
For example when I have SA with just one mods (attached) which have this migration code, which does actually no migration:
just loading of menu simulations can take anywhere from a second to 10 seconds (depends on which simulation is loading).
The issue gets worse the more mods are using the code migrations (even if they are "empty" in same way). Enabling all three attached mods can freeze loading of menu simulations for up to 30 seconds from my experience.
It gets even worse when those migration scripts are actually doing some stuff (like string.gsub) and when loading larger maps. You can easily look at 10-20 minutes of loading with 3 mods.
Code: Select all
{
"item": [
"for k, v in pairs(mapping) do end"
],
"recipe": [
"for k, v in pairs(mapping) do end"
],
"entity": [
"for k, v in pairs(mapping) do end"
]
}
The issue gets worse the more mods are using the code migrations (even if they are "empty" in same way). Enabling all three attached mods can freeze loading of menu simulations for up to 30 seconds from my experience.
It gets even worse when those migration scripts are actually doing some stuff (like string.gsub) and when loading larger maps. You can easily look at 10-20 minutes of loading with 3 mods.