Page 1 of 1

Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 12:01 pm
by veethree
So i recently upgraded my processor, And i was wondering what some processor intensive tasks löve could carry out.

I wanted to write some kind of a CPU benchmark / stress-test. I do realize there's software out there available that does just that, But i wanted to make my own just for the fuck of it.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 3:28 pm
by Eamonn
Load variables in love.update and love.draw maybe? Like a ton of them. I'd say that'd be pretty stressful. You could draw an insanely huge map using ATL and not setting the draw range. That's pretty stressful on my computer.

Also, what processor did you get and what was your old one, if you don't mind sharing? :)

EDIT: You could try spawning a lot of shapes using the love.physics module. It's meant to be a little heavier then the rest of the LÖVE module, so drawing a lot of stuff could be a good stress test. Let us know how it goes :) You could have an FPS counter at the top of the screen, so you can just watch it drop... ;)

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 3:29 pm
by arundel
From what I've noticed recently, is that when I run a love file on my laptop which uses 100% of the processor with intense calculations, does only use up 10% of the processor of a very fast pc I ran the same love file with without any difference in FPS. The fast pc even had an fps limit of 60 for some reason, while compared to my slow laptop which has no fps limit. Strange results.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 3:53 pm
by veethree
Eamonn wrote:Load variables in love.update and love.draw maybe? Like a ton of them. I'd say that'd be pretty stressful. You could draw an insanely huge map using ATL and not setting the draw range. That's pretty stressful on my computer.

Also, what processor did you get and what was your old one, if you don't mind sharing? :)

EDIT: You could try spawning a lot of shapes using the love.physics module. It's meant to be a little heavier then the rest of the LÖVE module, so drawing a lot of stuff could be a good stress test. Let us know how it goes :) You could have an FPS counter at the top of the screen, so you can just watch it drop... ;)
I had an intel core i5 3450 (3.10 GHZ, 3.50 turbo boost), Upgraded to an i7 3770 (3.40 GHZ, 3.90 turbo boost)

The physics module might be a good idea, In one of my tests i tried to just have a large amount of objects, Then update their position each frame (moving them from left to right). With that i was getting 30 fps with 60.000 objects. But that didn't seem to stress the processor too much as the heatsink fans remained at a relatively low RPM and the temperature didn't go above 40°c(It's in the 25°c area with no/little stress, And so far it hasn't gone above 54°c and i've been playing various games etc. while monitoring the temperature). Perhaps if i left that running for hours i'd see some results, But i'm looking for something a bit faster.

Might try something extremely inefficient with multiple nested loops and such.
arundel wrote:From what I've noticed recently, is that when I run a love file on my laptop which uses 100% of the processor with intense calculations, does only use up 10% of the processor of a very fast pc I ran the same love file with without any difference in FPS. The fast pc even had an fps limit of 60 for some reason, while compared to my slow laptop which has no fps limit. Strange results.
Yeah my pc has that 60fps limit as well, My old laptop didn't seem to have that.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 3:57 pm
by raidho36
That particularry depends on how you measure your FPS and on the OS. For any Windows OS, you're not gonna have any higher actual FPS than 60 if you use system "sleep" function.

As for CPU intensive tasks, I really suggest minimizing CPU load by all costs for any game. Because if your workstation quadruple-i7 or whateverthehell is running your game at 300 FPS, then some average PC only gonna have 15 FPS, all due to too slow logic.

The rule of thumb: just because PC can run it fast doesn't mean you can code it to be slow.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 4:23 pm
by veethree
raidho36 wrote:That particularry depends on how you measure your FPS and on the OS. For any Windows OS, you're not gonna have any higher actual FPS than 60 if you use system "sleep" function.

As for CPU intensive tasks, I really suggest minimizing CPU load by all costs for any game. Because if your workstation quadruple-i7 or whateverthehell is running your game at 300 FPS, then some average PC only gonna have 15 FPS, all due to too slow logic.

The rule of thumb: just because PC can run it fast doesn't mean you can code it to be slow.
I'm not looking to make an extremely inefficient game, I'm trying to deliberately stress my CPU.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 4:50 pm
by Robin
Note that vsync is enabled by default. This means that on computers that support vsync, there is probably a 60 FPS cap on your game. On computers that don't support vsync, there will not.

Re: Processor intensive tasks in löve.

Posted: Mon Aug 19, 2013 4:59 pm
by veethree
Robin wrote:Note that vsync is enabled by default. This means that on computers that support vsync, there is probably a 60 FPS cap on your game. On computers that don't support vsync, there will not.
There's one mystery solved.

Re: Processor intensive tasks in löve.

Posted: Tue Aug 20, 2013 8:39 am
by raidho36
Ah, yes. That would depend on refresh rate of the display.