While investigating some performance issues in the Handyhands mod (https://mods.factorio.com/mod/HandyHand ... 000c4ed671), I discovered that the player.get_craftable_count API seems to be taking a lot of time to run when mods with lots of recipes are installed, but it doesn't make a lot of sense as to why. Specifically, this code:
Code: Select all
script.on_event(
defines.events.on_tick,
function(event)
local p = game.players[1]
local craftableCount = p.get_craftable_count("pipe")
end
)
So a couple things:
1. Is the get_craftable_count API call looking through un-hand-craftable recipes? Can it not do that?
2. Presumably the inventory does things a bit differently, since it doesn't take several seconds to load. Can we get access to whatever it's doing to get recipe counts in a mod?