spritebatch:set seems to be generating garbage

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

spritebatch:set seems to be generating garbage

Post 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.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: spritebatch:set seems to be generating garbage

Post 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.)
Whatthefuck
Party member
Posts: 106
Joined: Sat Jun 21, 2014 3:45 pm

Re: spritebatch:set seems to be generating garbage

Post by Whatthefuck »

Thanks for clearing that up. Although I have one question - does Lua store local number variables to the heap as well?
Post Reply

Who is online

Users browsing this forum: No registered users and 65 guests