Guns create every bullet inside them before they are used.
Estimated Cost
/obj/item/gun/ballistic/automatic/wt550/Initialize is 54.22ms. This is from 11 creations in CentCom.
/obj/item/gun/energy/Initialize, with 48 calls, is 35.27ms.
Solutions
The obvious solution is only creating bullets when they are necessary. Gun code is extremely old and so this may not be super trivial.
Some interim solutions could be to just put the guns inside lockers, which lazily create their contents, but this conflicts with our goal for efforts of this project to be invisible to players, and could present real balance implications.
Guns create every bullet inside them before they are used.
Estimated Cost
/obj/item/gun/ballistic/automatic/wt550/Initialize
is 54.22ms. This is from 11 creations in CentCom./obj/item/gun/energy/Initialize
, with 48 calls, is 35.27ms.Solutions
The obvious solution is only creating bullets when they are necessary. Gun code is extremely old and so this may not be super trivial.
Some interim solutions could be to just put the guns inside lockers, which lazily create their contents, but this conflicts with our goal for efforts of this project to be invisible to players, and could present real balance implications.