love.graphics.print causing large performance hit
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
love.graphics.print causing large performance hit
I have five love.graphics.print calls in my code currently, and the one with the most text is "Health: 2000/2000" (they're all at default font/size too), so it's not like I'm printing whole paragraphs, however when I comment these calls out my FPS jumps drastically, from 390fps to 560fps. Is this normal? Is it a problem with the code, or something on my end, or is it unfixable?
Re: love.graphics.print causing large performance hit
love.graphics.print is not very fast. This is because fonts are not very fast. 0.8.0 should bring a new font engine with much improved speed and memory consumption, among other things.
On the other hand, it doesn't sound like it's posing much of a problem for your game at the moment, unless you really need people to play it at 500fps. So I wouldn't worry about it for now.
On the other hand, it doesn't sound like it's posing much of a problem for your game at the moment, unless you really need people to play it at 500fps. So I wouldn't worry about it for now.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: love.graphics.print causing large performance hit
Well, yeah, but in a more "live" situation with my background and NPCs enabled it goes from 250fps to 320fps, plus I was planning on having more things printed onscreen than I currently am.
Oh well, good thing it's being redone soon™ at least.
Oh well, good thing it's being redone soon™ at least.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: love.graphics.print causing large performance hit
Also, make sure that you are not creating a new font on every frame (for example, invoking love.graphics.setFont(number) inside love.draw)
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 6 guests