Page 1 of 1

really newbie question : does PB functions faster than API ?

Posted: Wed Aug 27, 2003 1:56 am
by newbie
I'm in front of a choice :

i have already converted a Visual Basic code into PureBasic code, before asking my question, for whose interested, i show you my results :

VB app :
* size = 27Ko (+ DLLs = 2.87MB)
* RAM = 2 396Ko
* Virtual Memory = 1 496 Ko
-> total = 3.8MB

PB app :
* size = 46Ko
* RAM = 612 Ko
* Virtual Memory = 876 Ko
-> total = 1.4MB

Am I happy with PB ? yes of course :D

I very like optimization, even when the advantages are small, and i would want to know if the fact of replacing the existing API to write/read "ini" files with PB integrated function would be faster or not ?

I'm using "WritePrivateProfileString_" and "GetPrivateProfileString_" and i saw that PB offers "ReadPreferenceString" and "WritePreferenceString" but need to open/close the file, is it better ?

P.S : sorry for the title, i don't know if it is "are PB functions faster" or "does PB functions faster" :roll:

Posted: Wed Aug 27, 2003 8:54 am
by Fred
In fact, for this case PB functions doesn't use the API, so you will have to do some benchmarks to see. But in most of the case, the API is used in every functions, so you will probably have exactly the same timing.

What does What?

Posted: Wed Aug 27, 2003 5:56 pm
by D'Oldefoxx
I think that if you look at the Help file, you can get some idea of which commands rely on either Windows API or DirectX calls, because those commands will indicate that they are only available under Windows. For
commands that span more than one operating system, either Fred did a roll-your-own approach, or found comparable capabilities in each of the systems involved. That is just a logical assumption that would seem reasonable at the onset.