Page 1 of 2
What is the real PureBasic speed ?
Posted: Fri Oct 29, 2010 4:59 pm
by marc_256
Hi all,
If I use a PC and Win XP pro (sp3)
If I put assembler on 100% on the CPU/GPU speed scale
and I put C++ on 75%
where can I put PB on this scale ?
This is all about 3D gaming speed.
I know there is also the quality of writing programs !!
Thanks,
Marc
Re: What is the real PureBasic speed ?
Posted: Fri Oct 29, 2010 7:13 pm
by luis
Probably there is no valuable speed gain in writing a graphical (DirectX/OpenGL) game in asm vs C/C++ or PB.
In many games, if you take the Render() function and substitute it to an empty function the FPS count will jump at least tenfold. Textures swapping in/out from physical memory and to/from GPU memory and the actual drawing is where time is spent. So the efficiency of the language is quite irrelevant.
Different is if you have complex physics, sound processing and the like, running on your CPU.
Or if you want (and can!) write a Quake 1 clone with a software renderer.
I would say you can reach the same performance level in PB as in any other comparable language.
So if your question is: using a BASIC language, and PB in particular can act as a drag on performance ?
The answer is no.
Anyway, quality of code is what make the difference (as you said).
Many commercial games exhibiting the A.I. of disturbed amoeba could be written in Visual Basic with a powerful GPU.
Nice site btw! I envy you the possibility (and the ability) to do all that mechanical stuff.
Re: What is the real PureBasic speed ?
Posted: Fri Oct 29, 2010 9:46 pm
by Thorium
marc_256 wrote:
If I put assembler on 100% on the CPU/GPU speed scale
and I put C++ on 75%
where can I put PB on this scale ?
You just cant scale it as simple as that.
In some cases it's slower than C++ in some it's even faster. Actualy you cant even compare it to C++, because C++ is just the language. You would need to compare it to a C++ compiler. There are differences between different C++ compilers.
If we talk about GPU, there is probably no difference as the code that runs on the GPU isnt compiled by PureBasic.
Re: What is the real PureBasic speed ?
Posted: Mon Nov 01, 2010 6:04 pm
by blueznl
For PRACTICAL purposes I wonder if it does matter...

Re: What is the real PureBasic speed ?
Posted: Mon Nov 01, 2010 6:06 pm
by netmaestro
I got it up to 270 km/h on the 401 yesterday..

Re: What is the real PureBasic speed ?
Posted: Mon Nov 01, 2010 6:09 pm
by blueznl
Well, my girlfriend says it's over in 1:05. Just don't tell my wife.
Re: What is the real PureBasic speed ?
Posted: Mon Nov 01, 2010 7:28 pm
by marc_256
hello,
For PRACTICAL purposes I wonder if it does matter...

Well, if I start to write my own 3D engine/renderer it does matter.
The nice thing in PB is that I can write the most important parts in asm.
I got it up to 270 km/h on the 401 yesterday..

WAW... thats what I need...
my girlfriend says it's over in 1:05.
Marc
Re: What is the real PureBasic speed ?
Posted: Wed Nov 03, 2010 6:07 pm
by Marco2007
Re: What is the real PureBasic speed ?
Posted: Wed Nov 03, 2010 6:48 pm
by Thorium
marc_256 wrote:
Well, if I start to write my own 3D engine/renderer it does matter.
The nice thing in PB is that I can write the most important parts in asm.
Actualy, no.
If it isnt a software renderer it doesnt matters as the performance critical stuff is executed on the GPU anyway.
Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 10:09 am
by ultralazor
I get about the same benchmark with 4.51 as I do with mingwC/OpenGL and NASM/OpenGL loading collada models, processing input and doing some shader and bone animation stuff. They all generate about the same PE, you can mess with alignments and IAT+reloc data in all of them to save some memory, as well as stripping some stuff in code section.
Most times I see someone try to use the low-level language theory they either end up with vaporware, or poorly managed code that is worse than all the alternatives..Assembly coding is an art when you're talking about complex code algo..same with inline assembler.
Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 11:09 am
by DarkDragon
marc_256 wrote:For PRACTICAL purposes I wonder if it does matter...

Well, if I start to write my own 3D engine/renderer it does matter.

You didn't ever hear of asymptotical runtime analysis, did you? Because then you would know that you don't need this constant time optimization at the beginning. And beside this .. the bottleneck to the gpu is the bigger problem.
Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 12:30 pm
by blueznl
asymptotical
Oi! Good word to impress my friends

... well, the few that are left
(Edit) It doesn't mean anything dirty, does it?

Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 3:43 pm
by ultralazor
A tool exists that shows dissasembly that is colored based on it's efficiency. I forget the name of it though. I just used kernel stats.
Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 4:33 pm
by DarkDragon
blueznl wrote:
asymptotical
Oi! Good word to impress my friends

... well, the few that are left
(Edit) It doesn't mean anything dirty, does it?


You may also have a look at
amortized analysis and
master-theorem. More interesting words, huh?
Re: What is the real PureBasic speed ?
Posted: Fri Nov 19, 2010 6:02 pm
by Thorium
ultralazor wrote:
Most times I see someone try to use the low-level language theory they either end up with vaporware, or poorly managed code that is worse than all the alternatives..Assembly coding is an art when you're talking about complex code algo..same with inline assembler.
There are some very cool assembly projects like MenuetOS and a lot of games for old computer and console systems.
Inline assembler is very usefull because PB does not optimize and does not use any SIMD instructions. It's very easy to beat PB code if you know some basic assembly optimization technics.