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 Discussion / Why is DB so slow for me?

Author
Message
Fuzzie
21
Years of Service
User Offline
Joined: 15th Feb 2003
Location: Sweden
Posted: 15th Feb 2003 14:21
I just downloaded the trial-version of DB from the website and tried it out. I master many programminglanguages and when I saw DB I thought -"Wow, what a cool looking environment". It surely looks a lot like AMOS from the Amiga.

However, when I was fiddling around with DB it quickly came to me how slow it was, and I thought it couldnt be the case, as even QBasic is faster.

The problem was this simple codesnippet I tried out:

set display mode 800,600,16
ink rgb(255,255,255),1
for x=0 to 800
dot x, 300
next x

This simple code should only draw a line across the screen, but to the horror it did so VERY VERY slowly. I even tried to finalize the compilation, but still it was very slow.

So my question is simply... Why? And more importantly, how do I make it faster?

I cant beleive you need more hardware than I already have(Pentium 4 1.6GHz, 512Mb PC2700, GF4 Ti4200).

Please help!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Feb 2003 14:41
How about using 'line' instead

Try putting this at the top of your code:

sync on : sync rate 0

and then putting this after the loop:
sync

Whats happening is that directx is being synced for every dot.

Bear in mind also that DB is a virtual-machine system, not native machine code. My advice is to get to grips with DB, then move onto the DBPro trial.
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 15th Feb 2003 16:20
hehe even i tried it withought and with using the sync command and it was exactly the same speed??, it wasn't really slow though, it's what i'd expect from incrementing by 1 every loop

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
lich
21
Years of Service
User Offline
Joined: 18th Jan 2003
Location:
Posted: 16th Feb 2003 01:08
ive had similar slow down problems where the fastest i can get it to refresh a simple 2d animation sequence is around 1 frame per second. Ive been trying to speed up the code but its been to no avail. lol i also have a P4 so maybe intel jsut has something against the Darkbasic programers.

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 16th Feb 2003 05:09
the first version was slow, took around a min to do the line.



simply added a sync on : sync rate 0 and it became instant, that was on a Pentium2, Pentium3, Althon, Duron and even a Cyrix 200mx

so i'd say yeah thats a P4 issue if even with the sync it doesn't do it instantly.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Jadelion
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 16th Feb 2003 05:41
There was a post a week or so ago saying that the DOT command itself is exceptionaly slow and that making BOX's of a very small size was far more efficient didn't actually pay to much attention to it as I don't draw an exceptional amount of DOT's.
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 16th Feb 2003 12:46
P4 here, 2 GHZ . Raven's code compiles instantly for me. Without the sync command takes a pretty long amount of time though

"A true warrior fights with skill, not anger..."

Gif edited by Kangaroo2
freak
21
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 16th Feb 2003 13:40
you have to place a sync command in that for-next loop:



without sync, every loop is played 30x/sec
when you manually set your sync rate you have to place a sync when you want to update the screen, and loops wil be updated 30x per second (or another amount, depending on the sync rate you have set; when the sync rate is zero, the pc will try to do it as fast as possible

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 16th Feb 2003 16:13
i'm gonna run a compile time table on my laptop see what the results are

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
xmen
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 16th Feb 2003 20:10
Try this out
code 1



Code 2



hope this help
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 16th Feb 2003 21:39
ran a few tests... the findings were interesting

this took 253minutes


whilst this took 12-14seconds


this took 25seconds


and finally this took 175mins


although the third took twice as long as the second, it was far better smooth wise - but interesting results non the less... be interesting to see what other get, and those who use pro

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2024-05-19 19:18:33
Your offset time is: 2024-05-19 19:18:33