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 / Dark Basic to slow?!?

Author
Message
lich
22
Years of Service
User Offline
Joined: 18th Jan 2003
Location:
Posted: 30th Jan 2003 22:18
Ok, to start i want to state that the time it takes to run a simple loop 1000000 times is less then a second, or in the ball park. Basicly its very fast same deal with c or c++. Now in that same amount of time dark basic can run only about 600, which is significantly slower. Normally i wouldnt care but im writing a 2-d fighter and the animations depend on the speed of the loop. I find that i cant get the character movement to the pspeed i want it because i have to run through an entire loop of A.I and other code before i have the chance to update the image. The more code i add the slower the animation gets. Im curious if this sort of thing has been aparrent to anyone else or has hindered them in anyway in the wrinting of their programs? Thats for any input in advance.
Dr DooMer
22
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 30th Jan 2003 23:26
There was one thing that I did that caused a slowdown:

The menu system for my latest if driven entirely by plains, and to display strings I've used a series of plains, linked together by way of limbs, which I scale and texture based on what character they are supposed to be. Anyway, for the editor, I've got a 64-character long 'stringbox', as I call them, which slowed the program down from 30fps to around 20fps when I updated it every frame. I soon switched to updating only once - whenever the displayed string changes.

Although, I don't think that the processing commands were at fault because, after refining the function as best I could, there was no improvement in speed what-so-ever. I think it was the allocation of so many image files that slowed it down so much.

"I am a living, thinking entity who was created in the sea of information."
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Jan 2003 01:32
DarkBasic Pro is similar to JavaScript in this respect, because it is an interpretive language ... which means it is converted to machine code during use rather than precompiled as such.

This does slow thing alot - also using larger than 32bit strings and variable will also cause speed problems, because darkbasic doesn't understand to chop them up efficiently - or set them to a specific type (e.g a 64bit interger or such)

this means that speed is cut again... unfortunatly you either live with it or goto DarkBasic Pro.

However there is another alternative - you ever noticed the "SYNC" command - use this when you need to update the loop, and it will make sure everything is upto date and syncronised.

for Ai and such that isn't required as you need that to act as quick as possible - however on the other hand when using a timer to update the frames, you will use a sync command then.

as pure code is faster than the rendered code, you can get considerable speed increased by rendering and updating object/media sync every 2/3 frames (e.g. frame skip)
eleviates alot of pressure on the program

Anata aru kowagaru no watashi!
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 31st Jan 2003 11:52
"DarkBasic Pro is similar to JavaScript"

I think you mean DarkBASIC. Pro is nothing like it (in compiler terms).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st Jan 2003 18:26
js is interpreted lang inside a browser application.

DBC is what i understand an abstract layer over the top of DirectX.

DBP is compiled to a very low level and I thought it was all the way down to assembly, It may be i dont know.
It may be just down to C but with assembly bits prey tell.

js isnt compiled its interpreted.

I can kinda see what u mean but only in that sense and only with DBC and on one abstract layer

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 31st Jan 2003 18:39
Core DBP functions and commands are compiled to assembler, correct. But not all of them - lots of the functions stored in the external DLLs (3d, etc) are written in C++ and called as such.

This is vastly different to DB in which the language was actually parsed and executed at run time. That is similar in a way to JS, but only just.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Jan 2003 19:12
hehee... oki oki well i was tired when i wrote it
ya i ment DarkBasic Standard

using a interpreter and abstract layers speed wise are similar - and infact even thought Java is compiled, using the Java3D (either OpenGL or DirectX) is pretty similar speed wise as DarkBasic in 3D Terms, the languages use itself however is a different story cause it runs incredibly fast (which is why i didn't use Java as the example hehee)

Anata aru kowagaru no watashi!
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Jan 2003 19:13
damn it ^JavaScript
ya know no use of an edit button is begining to get to me here

Anata aru kowagaru no watashi!

Login to post a reply

Server time is: 2025-05-13 20:24:47
Your offset time is: 2025-05-13 20:24:47