Re: Sorting a TOrdCollection...

Jacek M. Holeczek (holeczek@clri6g.gsi.de)
Fri, 30 May 1997 16:02:27 +0200 (EET)


> ( ... )
> On my PPro 200 Linux box I was able to sort 1.000.000
^^^^^^^^
^^^^^^^^
> ( ... )
> After some profiling I got it down to 79 seconds making
> one trivial change. Of the 79 seconds most is spent
> in memcmp. About 130 MB was used for this test and
^^^^^^
^^^^^^
> ( ... )
> > used the Sort() method in the TOrdCollection class but it seems VERY
> > slow. It took about 400 CPU second on a Dec Alpha to sort a
^^^^^^^^^
^^^^^^^^^
I'm not an expert in Dec Alphas, but I thing this machine cannot access
bytes in memory ( ram ) directly, as can Intel processors. Thus all
string/bytes/bits manipulation functions are slower then one might expect,
because it reads long words ( or even 128-bits ), then does "masking" to
get the proper byte, then maybe shifts bits, then does the "cmp", ... .
If you try "profiling" ... maybe you'll find that the memcmp takes most of
the time ... .
Jacek.