I must confess that I don't understand why certain things are sooo much
faster in C than in RB. C will clobber RB in a simple loop even with all
the
Pragmas. The difference is huge!

That's not true, in general.  A while back we took a simple but
non-contrived Mandlebrot generator, and wrote it in both C and
REALbasic using the same algorithm.  The RB code was slightly faster
than the unoptimized C code, and slightly slower than the C code with
optimizations on.

That may be, but in regards to a simple loop, I get about a 78x speed
difference between a CodeWarrior generated library and RB with Pragma
DisableBackgroundTasks on a P4 1.8 GHz. Granted, you have to throw
10,000,000 iterations at it for the difference to be significant in real
world terms. But it's just one example of a few areas (not a lot) where I
see a large disparity between the C version of some code and the RB version
for no apparent reason. Accessing memory and bit shifting is another area
where I, by default, drop into C if I need the speed.

Having said that, I do not think RB deserves the reputation of a "slow"
system. Skimming the list over the years, I get the impression people will
throw huge tasks at the framework controls, be disappointed in their
performance, then give up or turn to C not realizing that the prefab
controls in Toolbox, Carbon, Cocoa, Win32, MFC, and .NET *also* would have
(generally) failed their needs.

RB's string operations are also, in many cases, faster than what
you'd probably have in C for the same functionality, unless you went
to a lot of work -- there is a lot of sophisticated code behind them
(especially in making them encoding-savvy).

They're not bad at all, though in the underlying framework I imagine they
were written in C, correct?

Daniel L. Taylor
Taylor Design
Computer Consulting & Software Development
[EMAIL PROTECTED]
www.taylor-design.com



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to