OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
200 stars 109 forks source link

Optimize `new /icon(icon)` #1859

Closed wixoaGit closed 3 months ago

wixoaGit commented 3 months ago

In the following code:

var/icon/I1 = new /icon('icons.dmi')
I1.DrawBox("#ff0000", 0, 0, 16, 16)
var/icon/I2 = new /icon(I1)

new /icon(I1) would generate I1's entire DMI and use that to create I2. Now it instead only copies the queued operations. This massively improves its performance and memory usage (several GBs over /tg/ init, and more over the round).