> How did you come to this conclusion that vb is faster then rb?

I'm converting an application that is currently written in both VB (for
Windows) and FB (for the Mac). The RB version uses classes to store its data
instead of multi-dimensional arrays, but is otherwise pretty much a
straightforward port.

The VB and FB versions store all the data in simple multi-dimensional
integer arrays, while the RB version stores everything in classes, often
arrays of classes, with "Get" and "Set" methods to manipulate it.

I made the switch to classes because they give me a lot more flexibility in
my data management and extensibility, but the complexity seems to come with
a price.

Drawing the data onscreen is plenty fast, as are most of the interface
aspects of RB.

However, I have a sort function that does a fairly complicated multi-level
shell sort on my data, with lots of extracting bytes from integers and then
comparing the bytes. The RB version of the entire sort takes 18 seconds to
run, where the VB and FB versions take about a second. The actual data
itself isn't being moved, just index pointers to it. There is very little
string comparing going on, and no variants. But yes, there is a whole lot of
data zipping back and forth in memory.

All three code bases for this sort look virtually identical except for the
variable names. 

I've tried using #pragma to disable background tasks in both the sort and
the Get and Set routines, but it made no useful difference at all.
Unfortunately, I can't use RB's array sorts because they only work on simple
arrays, and only on one level.

Everything else about RB has been pretty terrific, and I'm definitely a
convert. Although it'd be nice if the 2006r4 IDE would stop crashing...:(

I suppose I'm trying to compare apples and oranges, but it still seems like
there shouldn't be as much of a speed penalty as I'm seeing.

This is all on a 1.25Ghz PowerBook with 1GB of RAM.

Any suggestions?

- John



_______________________________________________
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