Page 1 of 1

spritebatch:set seems to be generating garbage

Posted: Sun Jul 19, 2015 11:22 am
by Whatthefuck
Like the title says, it seems to be generating a decent amount of garbage. Filling as much as 512 sprites on average generates 0.01-0.02 megabytes of garbage. Is there a reason for that.

Edit: just tried checking how much garbage is generated by :add calls - none at all.

Re: spritebatch:set seems to be generating garbage

Posted: Sun Jul 19, 2015 1:07 pm
by slime
SpriteBatch:add and SpriteBatch:set are effectively the same code. The only difference (internally and externally) is that add returns an id, and set takes the id as an extra argument (but doesn't return anything.)

Re: spritebatch:set seems to be generating garbage

Posted: Wed Jul 22, 2015 11:10 am
by Whatthefuck
Thanks for clearing that up. Although I have one question - does Lua store local number variables to the heap as well?