Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Loop size Affect Speed?

Author
Message
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 7th Dec 2010 00:30
How many lines of code need to be in a loop to notice a slow down on most computers? Like if there were 1000 lines in a do loop, would that slow down?? Ive always been curious about that.

Behold the new marble game coming soon: [href"http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0"]Marbsticle Course[/href]
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th Dec 2010 01:11
Try it, lol. 1000 lines shouldn't be a problem for most machines these days. Obviously the tighter the loop or loops in your game, the better.

http://s6.bitefight.org/c.php?uid=103081
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 7th Dec 2010 01:21
Really depends on what the code is doing in the loop. For instance, chucking a single Set Text Font in a loop will destroy your fps. You'd be absolutely insane to do this. This is where experimentation (like this) comes into play so we can optimize stuff.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 7th Dec 2010 01:26
thanks guys! I was always worried thinking i didnt want to much in a loop. I feel free now!!!! xD Yah i actually felt trapped thinking to much would slow the world down if ya know what i mean.

Behold the new marble game coming soon: [href"http://forum.thegamecreators.com/?m=forum_view&t=178472&b=8&p=0"]Marbsticle Course [/href]

Login to post a reply

Server time is: 2026-07-21 19:18:41
Your offset time is: 2026-07-21 19:18:41