Re: String functions benchmarks



> But, using the bechmarking tool they have supplied, their results
> are quite impressive. And, if their code can be improved upon, well
> that would be fantastic.
>
> You can see a screenshot of that in attachments where I have done
> 15-cycle benchmark.

It looks impressive, but leaves some questions:

- Since when does the Delphi RTL have a case insensitive Pos function?
Just calling Uppercase/Lowercase and then Pos is no fair comparison

- What is the Count function? The Delphi RTL doens't have one.

- The function results for Count and replace are different between the
Delphi RTL and cxpos. Doesn't this mean the cxpos function are broken?

- What does 'in file' mean here? Using a memory mapped file to search
in?

- Obviously every function has strong points and weak points. Were the
test samples chosen in a neutral and realistic way?

> > You might be better off coding these things in Pascal (leaving you
> > with more readable code that is only slightly less, if at all,
> > slower) or using more optimized assembly (you can suggest them
> > as Fastcode challenges, though it might take some time before
> > the implementations arrive).
>
> Fastcode is really deperately needed for these (and more) string
> functions.
>
> > In any case i find myself coding this function often as well, so it
> > might be a potential Fastcode candidate.
>
> Would be great --including others.
>
> Incidentally, I seem to like the way they presented the results;
> I might want to write something like that (may be a little
> more generic). Would that be useful?

Currently Fastcode only compares with the Delphi RTL. Comparing with
other implementations would be possible, but allowing them to enter the
competition is even better.

--
The Fastcode Project: http://www.fastcodeproject.org/
.