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 / Another commands to avoid.

Author
Message
Viktor
17
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 01:31
DO ... LOOP is one thing, but GOTO is also much slower than in Dark Basic. GOSUB probaly too, but not tested it.
WRITE BYTE and READ BYTE from/to files is a pain, do allways load Files to memblock with READ FLOAT and WRITE MEMBLOCK FLOAT, then you can read out bytes thousand times faster from memblock. Do not use READ LONG and WRITE MEMBLOCK DWORD, it is equal fast (four times faster than using BYTE), but strangely WRITE MEMBLOCK DWORD cannot use DWORDS because only 31 bits and not 32 bits are allowed (Don´t ask me, ask Lee!). It looks not like a bug, because the online help mentions it too, but it is very very strange.
Viktor
17
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 31st Oct 2002 11:23
Very strange: GOSUB is sometimes fast, sometimes extremly slow.
LDIR coded a error diffusion color reduction, which jumps to different subs, depending on the method (Floyd-Steinberg, Stucki, Jarvis or the other 3), and there was no slowdown.
I coded a small subroutine which does ordered dither, and it was slow.
LDIR recoded it by pulling out the GOSUB and RETURN, and put this subroutine inside the main loop, and it was 1000x faster.
Or it´s just me who´s a lame coder?

Shadow Robert
17
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Oct 2002 12:35
is that rehtorical or can i actually answer?
DB is very tempermental because it is all built into a single string program - like earli C games

so what you have to remember is something you use alot place at the begining of the code and such, once you have code working reorganise it to get more speed ... when you get used to it you'll be able to focuse on making it faster from the get go

not many of even the older coders seem'd to have caught on to that fact thou

Anata aru kowagaru no watashi!
Hubdule
17
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 31st Oct 2002 13:50
The speed problems/questions and answers with all the different loop types could be found here !!!

http://www.realgametools.net/forums/index.php?board=14;action=display;threadid=8444

Hubdule
17
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 31st Oct 2002 13:51
forgot: ... read Lee's comment on that at page 2

Viktor
17
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 31st Oct 2002 21:54
Well, I hope, the bugs will be sorted out, to reach optimization phase. I hope, Lee will give us a option to compile "hard code", or "Error trapped code" to choose.
We coded out the most of GOTOs and GOSUBs now in order to save time.

Login to post a reply

Server time is: 2020-07-14 22:07:19
Your offset time is: 2020-07-14 22:07:19