Link to test case, https://discord.com/channels/725444629172060262/ 725458744711839873/1139258609239347300
Lummox JR — Today at 13:16
Okay, I see the issue here. The icon code is actually not being very smart about keeping loaded icons in memory when it means to simply extract a single state. This isn't great. I'm working on some options.
Lummox JR — Today at 13:42
The short version of what's happening is that it looks like your source icon is getting loaded a lot more often than it needs to. I need to make major changes to the icon operation logic to cut down on that.
Numbered Steps to Reproduce Problem:
1. Try to move icon states from one DMI to another, for instance to write all of the icons of a given type tree to one DMI file
2. observe slow
Code Snippet (if applicable) to Reproduce Problem:
/datum/asset/spritesheet_svg/proc/Insert(sprite_name, icon/I, icon_state="", dir=SOUTH, frame=1, moving=FALSE)
I = create_icon_state(I, icon_state, dir, frame, moving)
if (!I) // that direction or state doesn't exist
return
var/size_id = get_size_id(I)
var/size = get_size_by_id(size_id)
if (size)
var/icon/sheet = get_sprsz_icon(size)
put_in_sheet(sheet, I, sprite_name)
else
sizes[size_id] = size = create_new_sizemap(I, icon_state, sprite_name)
Expected Results:
Insert would perform not terrible
Actual Results:
1 full second of pure icon operations overrunning the tick
Does the problem occur:
Every time? Or how often? Always
In other games? Yes
In other user accounts? ?
On other computers? Yes
When does the problem NOT occur?
Dunno
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Dunno
Workarounds:
Dunno