Daniël Mantione napisał(a):

Op Sat, 10 Dec 2005, schreef darekM:

Hi
I've tested some of benchmark on http://shootout.alioth.debian.org/

I've see that reverse-complement benchmark
<http://shootout.alioth.debian.org/benchmark.php?test=revcomp&lang=all> for
FPC is very slow. I discover, that problem is with readln, that function
consume about 90% of time. Because I use it in my program, I implemented new
version of reading files. My propositions is add tTextStream to unit Classes

using is very similar

while not eof do
begin
readln(s);
end;

The Shootout benchmarks should preferably be implemented without unit classes to achieve the best memory usage results.

For me more important is speed, in real program we always use other units


Your code is welcome though to add to unit classes, allthough I currently can't because it uses assembler code withotu Pascal alternative, i.e. it would make the classes unit unavailable on the other processors FPC supports.
I know, in code are three funcion: findendLine, findEndLine2, findEndLine3 - there are propositions, please help me to make propers compilers conditions.

Maybe strlBuf (rename to scanbuf ?) should be moved to system unit?

Can you do the same to improve readln?
readln is more complicated, is compiler function, is so small buffer (only 128 bytes) and reads char by char.
I havent any idea to do this.



Darek
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to