From: dave@powerbasic.com (Dave Navarro)
Subject: Re: Speed, adding C or PowerBasic to VB
In article , bart.mediamind@tornado.be
says...
> dave@powerbasic.com (Dave Navarro) wrote:
>
> >> How is PowerBASIC DLL's compared to DLL's written in C when you call the
> >> functions from VB (better, easier, faster, slower) ?
> >
> >Typically faster than C and much easier to write for a Basic programmer.
>
> Easier to write, I agree. But faster? I always thought that C's
> popularity came mostly because it was, well "virtual machine code". It's
> as close to the processor as modern day (OS) programmers are willing to
> get.
That was true in the early days of C. However, today C compiler publishers
like Microsoft and Borland rely on the low-cost of faster hardware rather
han
spending any significant time hand-optimizing the compiler output (my own
observation). Our programmers spend a considerable amount of time pooring
over each line of code and checking the CPU cyle timings against a custom
chart they've made.
Typically, most C code today (C++ actually) is very bloated. Objects make it
easier to write large applications, but they weren't designed for speed or
hard drive conservation.
> Have you got any figures, comparing the spead of PB vs. C? If anybody
> can get at it, you can. Thanks.
We're not C programmers here. Most of what I know comes from C programmers
who are now using PB/DLL (sometimes as a supplement, sometimes as a
replacement) and from C code in the MS SDK I have ported to PB/DLL. As an
example, PBNOTE in PB/DLL 5.0 was ported from the NOTEPAD.C example in the
SDK. The PB/DLL version compiles to around 26k. The C version compiles to
98k. Granted the C version includes code for printing, but it isn't *that*
much code and doesn't account for the 60k difference in size.
--Dave
*** QwkNews (tm) v2.1
* [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|