FPC now 3rd in shootout

classic Classic list List threaded Threaded
38 messages Options
12
Reply | Threaded
Open this post in threaded view
|

FPC now 3rd in shootout

S. Fisher
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
that could happen.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Marco van de Voort
> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>
> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
> that could happen.

They change often. Clean is also quite variable. I assume the differences
are simply in the magnitude of the uncertainty of the measuring.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Bee-6
> They change often. Clean is also quite variable. I assume the differences
> are simply in the magnitude of the uncertainty of the measuring.

No, I don't think so. I think it depends on weight you give to each
benchmark. I always set all weight to 1 and consistently I got fpc
always on the first place, gcc on the second. ;)

-Bee-

has Bee.ography at:
http://beeography.wordpress.com
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Vincent Snijders
In reply to this post by Marco van de Voort
Marco van de Voort schreef:
>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>
>> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>> that could happen.
>
> They change often. Clean is also quite variable. I assume the differences
> are simply in the magnitude of the uncertainty of the measuring.
>


I don't knwo what triggered the re-run of D. Bit recurisve and regexdna have become
significantly slower, the rest has slightly improved:
http://alioth.debian.org/plugins/scmcvs/cvsweb.php/shootout/website/websites/gp4/data/ndata.csv.diff?r1=1.911;r2=1.912;cvsroot=shootout


Vincent
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher
In reply to this post by Marco van de Voort

--- Marco van de Voort <[hidden email]> wrote:

> > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
> >
> > The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
> > that could happen.
>
> They change often. Clean is also quite variable. I assume the differences
> are simply in the magnitude of the uncertainty of the measuring.

I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
neither accepted nor rejected.

{ The Computer Language Benchmarks Game
  http://shootout.alioth.debian.org

  contributed by Steve Fisher

  compile with
  fpc -O3 regex-dna.pp
}

uses regexpr, strutils;

function replace_matches( const target: pchar;  const repl: pchar;
                const str: ansistring;  var dest: ansistring ): longint;
var
  engine : tRegexprEngine;
  substr : ansistring;
  count, index, size : longint;
begin
  if not GenerateRegExprEngine( target, [], engine) then
  begin
    writeln( 'Failed to generate regex. engine for "',target,'".' );
    halt(1)
  end;
  count := 0;
  dest := '';
  substr := str;
  while length(substr) > 0 do
  begin
    if RegExprPos(engine, pchar(substr), index, size ) then
    begin
      count += 1;
      dest += ansiLeftStr( substr, index) + repl;
      substr := ansiRightStr(substr,length(substr)-index-size);
    end
    else
      break
  end;
  DestroyRegExprEngine( engine );
  dest += substr;
  exit(count)
end;

function count_matches( target: pchar; const str: ansistring ): longint;
var
  engine : tRegexprEngine;
  substr : ansistring;
  count, index, size : longint;
begin
  if not GenerateRegExprEngine( target, [ref_caseinsensitive], engine) then
  begin
    writeln( 'Failed to generate regex. engine for "',target,'".' );
    halt(1)
  end;
  count := 0;
  substr := str;
  while length(substr) > 0 do
  begin
    if RegExprPos(engine, pchar(substr), index, size ) then
    begin
      count += 1;
      substr := ansiRightStr(substr,length(substr)-index-size);
    end
    else
      break
  end;
  DestroyRegExprEngine( engine );
  exit(count)
end;

const
  patterns : array[1..9] of pchar =
    (
      '(agggtaaa)|(tttaccct)',
      '([cgt]gggtaaa)|(tttaccc[acg])',
      '(a[act]ggtaaa)|(tttacc[agt]t)',
      '(ag[act]gtaaa)|(tttac[agt]ct)',
      '(agg[act]taaa)|(ttta[agt]cct)',
      '(aggg[acg]aaa)|(ttt[cgt]ccct)',
      '(agggt[cgt]aa)|(tt[acg]accct)',
      '(agggta[cgt]a)|(t[acg]taccct)',
      '(agggtaa[cgt])|([acg]ttaccct)'
    );
  replacements : array[1..11,1..2] of pchar =
  (  
    ('B', '(c|g|t)'), ('D', '(a|g|t)'), ('H', '(a|c|t)'), ('K', '(g|t)'),
    ('M', '(a|c)'), ('N', '(a|c|g|t)'), ('R', '(a|g)'), ('S', '(c|t)'),
    ('V', '(a|c|g)'), ('W', '(a|t)'), ('Y', '(c|t)')
  );


var
  pattern : pchar;
  sequence, new_seq : ansiString;
  line, tmp: string[255];
  letter, repl : pchar;
  i, count, init_length, clean_length, reps : longint;

begin
  sequence := '';
  init_length := 0;
  while not eof do
  begin
    readln( line );
    init_length += length( line ) + 1;
    if line[1] <> '>' then
      sequence := sequence + line;
  end;
  clean_length := length(sequence);

  for i := low(patterns) to high(patterns) do
  begin
    pattern := patterns[i];
    count := count_matches( pattern, sequence );
    tmp := delChars( delChars(pattern,'('), ')' );
    writeln( tmp, ' ', count);
  end;

 
  //  Replace.
  for i := low(replacements) to high(replacements) do
  begin
    letter := replacements[i][1];  repl := replacements[i][2];
    reps := replace_matches(letter,repl,sequence,new_seq);
    sequence := new_seq;
  end;


  writeln;
  writeln( init_length );
  writeln( clean_length );
  writeln( length(sequence) );
end.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Florian Klämpfl
S. Fisher schrieb:

> --- Marco van de Voort <[hidden email]> wrote:
>
>>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>>
>>> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>>> that could happen.
>> They change often. Clean is also quite variable. I assume the differences
>> are simply in the magnitude of the uncertainty of the measuring.
>
> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> neither accepted nor rejected.

Did you do any benchmarking so far?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher

--- Florian Klaempfl <[hidden email]> wrote:

> S. Fisher schrieb:
> > --- Marco van de Voort <[hidden email]> wrote:
> >
> >>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
> >>>
> >>> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
> >>> that could happen.
> >> They change often. Clean is also quite variable. I assume the
> differences
> >> are simply in the magnitude of the uncertainty of the measuring.
> >
> > I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> > neither accepted nor rejected.
>
> Did you do any benchmarking so far?

It runs in about 0.25 seconds on a 3GHz machine using the
101,745 byte data file (the larger file doesn't seem to be
available).  I wasn't concerned about optimizing for speed;
it just seemed essential to supply the last missing program.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Vincent Snijders
S. Fisher schreef:

> --- Florian Klaempfl <[hidden email]> wrote:
>
>> S. Fisher schrieb:
>>> --- Marco van de Voort <[hidden email]> wrote:
>>>
>>>>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>>>>
>>>>> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>>>>> that could happen.
>>>> They change often. Clean is also quite variable. I assume the
>> differences
>>>> are simply in the magnitude of the uncertainty of the measuring.
>>> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
>>> neither accepted nor rejected.
>> Did you do any benchmarking so far?
>
> It runs in about 0.25 seconds on a 3GHz machine using the
> 101,745 byte data file (the larger file doesn't seem to be
> available).  

You can generate the test file yourself using the fasta program, IIRC.


I wasn't concerned about optimizing for speed;
> it just seemed essential to supply the last missing program.

Well, it depends on you point of view.

It looks good to have all programs available.

If you want the improve the score, than the program should be not more
than 1.4 times slower than the fastest program.

Vincent
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Peter Vreman
In reply to this post by S. Fisher
>
> --- Marco van de Voort <[hidden email]> wrote:
>
>> > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>> >
>> > The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>> > that could happen.
>>
>> They change often. Clean is also quite variable. I assume the differences
>> are simply in the magnitude of the uncertainty of the measuring.
>
> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> neither accepted nor rejected.

Thanks, I've added it to the fpc repository so the source will not be lost



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Peter Vreman
In reply to this post by S. Fisher
>>
>> --- Marco van de Voort <[hidden email]> wrote:
>>
>>> > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>> >
>>> > The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>>> > that could happen.
>>>
>>> They change often. Clean is also quite variable. I assume the differences
>>> are simply in the magnitude of the uncertainty of the measuring.
>>
>> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
>> neither accepted nor rejected.
>
> Thanks, I've added it to the fpc repository so the source will not be lost

For me the code didn't finish in a reasonable time. It spend too much time in moving ansistrings
around. I have update the program to use a pchar instead of an ansistring so it finishes within
reasonable time. The updated source can be found in:

http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp

But the code is a lot slower than gcc so there is still a lot of performance tuning to do:

               100000  300000  500000
fpascal          1.169   4.581  11.754
gcc-2            1.033   3.078   5.111


Peter


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher

--- Peter Vreman <[hidden email]> wrote:

> >>
> >> --- Marco van de Voort <[hidden email]> wrote:
> >>
> >>> > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
> >>> >
> >>> > The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
> >>> > that could happen.
> >>>
> >>> They change often. Clean is also quite variable. I assume the
> differences
> >>> are simply in the magnitude of the uncertainty of the measuring.
> >>
> >> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> >> neither accepted nor rejected.
> >
> > Thanks, I've added it to the fpc repository so the source will not be
> lost
>
> For me the code didn't finish in a reasonable time. It spend too much time
> in moving ansistrings
> around. I have update the program to use a pchar instead of an ansistring
> so it finishes within
> reasonable time. The updated source can be found in:
>
>
http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
>
> But the code is a lot slower than gcc so there is still a lot of
> performance tuning to do:
>
>                100000  300000  500000
> fpascal          1.169   4.581  11.754
> gcc-2            1.033   3.078   5.111

Much, much faster than the original.  There was an off-by-one error
that made the last line of the output incorrect.
 
{ The Computer Language Benchmarks Game
  http://shootout.alioth.debian.org

  contributed by Steve Fisher
  modified by Peter Vreman

  compile with
  fpc -O3 regex-dna.pp
}

uses regexpr,strutils;

function replace_matches( const target: pchar;  const repl: ansistring;
                const str: ansistring;  var dest: ansistring ): longint;
var
  engine : tRegexprEngine;
  count, index, size : longint;
  pstart : pchar;
  starti : longint;
begin
  if not GenerateRegExprEngine( target, [], engine) then
  begin
    writeln( 'Failed to generate regex. engine for "',target,'".' );
    halt(1)
  end;
  count := 0;
  dest := '';
  starti := 1;
  pstart := pchar(str);
  while starti <= length(str) do
  begin
    if RegExprPos(engine, pstart, index, size ) then
    begin
      inc(count);
      dest := dest + Copy( str, starti, index) + repl;
      inc(pstart,index+size);
      inc(starti,index+size);
    end
    else
      break
  end;
  DestroyRegExprEngine( engine );
  dest:=dest+Copy( str, starti, length(str)-starti+1);
  exit(count);
end;


function count_matches( target: pchar; const str: ansistring ): longint;
var
  engine : tRegexprEngine;
  pstart : pchar;
  starti,
  count, index, size : longint;
begin
  if not GenerateRegExprEngine( target, [ref_caseinsensitive], engine) then
  begin
    writeln( 'Failed to generate regex. engine for "',target,'".' );
    halt(1)
  end;
  count := 0;
  pstart := pchar(str);
  starti := 1;
  while starti <= length(str) do
  begin
    if RegExprPos(engine, pstart, index, size ) then
    begin
      inc(count);
      inc(pstart,index+size);
      inc(starti,index+size);
    end
    else
      break
  end;
  DestroyRegExprEngine( engine );
  exit(count)
end;

const
  patterns : array[1..9] of pchar =
    (
      '(agggtaaa)|(tttaccct)',
      '([cgt]gggtaaa)|(tttaccc[acg])',
      '(a[act]ggtaaa)|(tttacc[agt]t)',
      '(ag[act]gtaaa)|(tttac[agt]ct)',
      '(agg[act]taaa)|(ttta[agt]cct)',
      '(aggg[acg]aaa)|(ttt[cgt]ccct)',
      '(agggt[cgt]aa)|(tt[acg]accct)',
      '(agggta[cgt]a)|(t[acg]taccct)',
      '(agggtaa[cgt])|([acg]ttaccct)'
    );
  replacements : array[1..11,1..2] of pchar =
  (
    ('B', '(c|g|t)'), ('D', '(a|g|t)'), ('H', '(a|c|t)'), ('K', '(g|t)'),
    ('M', '(a|c)'), ('N', '(a|c|g|t)'), ('R', '(a|g)'), ('S', '(c|t)'),
    ('V', '(a|c|g)'), ('W', '(a|t)'), ('Y', '(c|t)')
  );


var
  pattern : pchar;
  sequence, new_seq : ansiString;
  line, tmp: string[255];
  letter, repl : pchar;
  i, count, init_length, clean_length, reps : longint;
  inbuf : array[0..64*1024] of char;
begin
  settextbuf(input,inbuf);
  sequence := '';
  init_length := 0;
  while not eof do
  begin
    readln( line );
    init_length += length( line ) + 1;
    if line[1] <> '>' then
      sequence := sequence + line;
  end;
  clean_length := length(sequence);

  for i := low(patterns) to high(patterns) do
  begin
    pattern := patterns[i];
    count := count_matches( pattern, sequence );
    tmp := delChars( delChars(pattern,'('), ')' );
    writeln( tmp, ' ', count);
  end;


  //  Replace.
  for i := low(replacements) to high(replacements) do
  begin
    letter := replacements[i][1];  repl := replacements[i][2];
    reps := replace_matches(letter,repl,sequence,new_seq);
    sequence := new_seq;
  end;


  writeln;
  writeln( init_length );
  writeln( clean_length );
  writeln( length(sequence) );
end.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Peter Vreman
In reply to this post by S. Fisher
>> >> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
>> >> neither accepted nor rejected.
>> >
>> > Thanks, I've added it to the fpc repository so the source will not be
>> lost
>>
>> For me the code didn't finish in a reasonable time. It spend too much time
>> in moving ansistrings
>> around. I have update the program to use a pchar instead of an ansistring
>> so it finishes within
>> reasonable time. The updated source can be found in:
>>
>>
> http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
>>
>> But the code is a lot slower than gcc so there is still a lot of
>> performance tuning to do:
>>
>>                100000  300000  500000
>> fpascal          1.169   4.581  11.754
>> gcc-2            1.033   3.078   5.111
>
> Much, much faster than the original.  There was an off-by-one error
> that made the last line of the output incorrect.

Thanks, fix applied.

Peter


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Florian Klämpfl
Peter Vreman schrieb:

>>>>> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
>>>>> neither accepted nor rejected.
>>>> Thanks, I've added it to the fpc repository so the source will not be
>>> lost
>>>
>>> For me the code didn't finish in a reasonable time. It spend too much time
>>> in moving ansistrings
>>> around. I have update the program to use a pchar instead of an ansistring
>>> so it finishes within
>>> reasonable time. The updated source can be found in:
>>>
>>>
>> http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
>>> But the code is a lot slower than gcc so there is still a lot of
>>> performance tuning to do:
>>>
>>>                100000  300000  500000
>>> fpascal          1.169   4.581  11.754
>>> gcc-2            1.033   3.078   5.111
>> Much, much faster than the original.  There was an off-by-one error
>> that made the last line of the output incorrect.
>
> Thanks, fix applied.

Ok, now somebody has to fix the regexpr unit and accelerate it *g*
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Michael Van Canneyt


On Mon, 5 Nov 2007, Florian Klaempfl wrote:

> Peter Vreman schrieb:
> >>>>> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> >>>>> neither accepted nor rejected.
> >>>> Thanks, I've added it to the fpc repository so the source will not be
> >>> lost
> >>>
> >>> For me the code didn't finish in a reasonable time. It spend too much time
> >>> in moving ansistrings
> >>> around. I have update the program to use a pchar instead of an ansistring
> >>> so it finishes within
> >>> reasonable time. The updated source can be found in:
> >>>
> >>>
> >> http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
> >>> But the code is a lot slower than gcc so there is still a lot of
> >>> performance tuning to do:
> >>>
> >>>                100000  300000  500000
> >>> fpascal          1.169   4.581  11.754
> >>> gcc-2            1.033   3.078   5.111
> >> Much, much faster than the original.  There was an off-by-one error
> >> that made the last line of the output incorrect.
> >
> > Thanks, fix applied.
>
> Ok, now somebody has to fix the regexpr unit and accelerate it *g*

Can't we contact the author ? ;-)

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher
In reply to this post by Peter Vreman

--- Peter Vreman <[hidden email]> wrote:


> around. I have update the program to use a pchar instead of an ansistring
> so it finishes within
> reasonable time. The updated source can be found in:
>
>
http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
>
> But the code is a lot slower than gcc so there is still a lot of
> performance tuning to do:
>
>                100000  300000  500000
> fpascal          1.169   4.581  11.754
> gcc-2            1.033   3.078   5.111

Is it true that a slow program has a worse effect on the shootout
results than a missing program?  That seems wrong to me.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Bugzilla from daniel.mantione@freepascal.org


Op Mon, 5 Nov 2007, schreef S. Fisher:

>
> --- Peter Vreman <[hidden email]> wrote:
>
>
> > around. I have update the program to use a pchar instead of an ansistring
> > so it finishes within
> > reasonable time. The updated source can be found in:
> >
> >
> http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
> >
> > But the code is a lot slower than gcc so there is still a lot of
> > performance tuning to do:
> >
> >                100000  300000  500000
> > fpascal          1.169   4.581  11.754
> > gcc-2            1.033   3.078   5.111
>
> Is it true that a slow program has a worse effect on the shootout
> results than a missing program?  That seems wrong to me.
There has been a long discussion on the Shootout forums about it. Isaac
believes that it is more fair this way for languages that don't have all
benchmarks implemented. Now we simply have to make him retract all our
poor performing programs :)

Daniël
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Vincent Snijders
In reply to this post by S. Fisher
S. Fisher schreef:
>
> Is it true that a slow program has a worse effect on the shootout
> results than a missing program?  That seems wrong to me.

To me is seems wrong too, but is nevertheless the case. Look carefully
at the scoring rules at
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all#about

See http://alioth.debian.org/forum/forum.php?thread_id=2671&forum_id=999 
  for the discussion. Maybe as an indirect result result, two of the
worst scoring benchmarks (both threading related) were removed from the
default scoring set, the one you get when you choose "reset".

Vincent

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

Marc Weustink
In reply to this post by S. Fisher
S. Fisher wrote:

> --- Marco van de Voort <[hidden email]> wrote:
>
>>> http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
>>>
>>> The reason is that D's mean degraded from 1.40 to 1.43.  I wonder how
>>> that could happen.
>> They change often. Clean is also quite variable. I assume the differences
>> are simply in the magnitude of the uncertainty of the measuring.
>
> I submitted this regex-dna program on 2007-10-31.  It's still in limbo:
> neither accepted nor rejected.
>
> { The Computer Language Benchmarks Game
>   http://shootout.alioth.debian.org
>
>   contributed by Steve Fisher
>
>   compile with
>   fpc -O3 regex-dna.pp
> }
>
> uses regexpr, strutils;
>
> function replace_matches( const target: pchar;  const repl: pchar;
>                 const str: ansistring;  var dest: ansistring ): longint;
> var
>   engine : tRegexprEngine;
>   substr : ansistring;
>   count, index, size : longint;
> begin
>   if not GenerateRegExprEngine( target, [], engine) then
>   begin
>     writeln( 'Failed to generate regex. engine for "',target,'".' );
>     halt(1)
>   end;
>   count := 0;
>   dest := '';
>   substr := str;
>   while length(substr) > 0 do
>   begin
>     if RegExprPos(engine, pchar(substr), index, size ) then
>     begin
>       count += 1;
>       dest += ansiLeftStr( substr, index) + repl;
>       substr := ansiRightStr(substr,length(substr)-index-size);
>     end
>     else
>       break
>   end;
>   DestroyRegExprEngine( engine );
>   dest += substr;
>   exit(count)
> end;
>
> function count_matches( target: pchar; const str: ansistring ): longint;
> var
>   engine : tRegexprEngine;
>   substr : ansistring;
>   count, index, size : longint;
> begin
>   if not GenerateRegExprEngine( target, [ref_caseinsensitive], engine) then
>   begin
>     writeln( 'Failed to generate regex. engine for "',target,'".' );
>     halt(1)
>   end;

For this benchmark you don't need extra unneeded code for checking
conditions. If the test fails it fails, so don't worry on errors

Marc



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher
In reply to this post by Vincent Snijders

--- Vincent Snijders <[hidden email]> wrote:

> S. Fisher schreef:
> >
> > Is it true that a slow program has a worse effect on the shootout
> > results than a missing program?  That seems wrong to me.
>
> To me is seems wrong too, but is nevertheless the case.

Right.  A missing program should be equal in its effect to
a program that runs as slowly as the slowest program.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC now 3rd in shootout

S. Fisher
In reply to this post by Marc Weustink

--- Marc Weustink <[hidden email]> wrote:


> >   if not GenerateRegExprEngine( target, [ref_caseinsensitive], engine)
> then
> >   begin
> >     writeln( 'Failed to generate regex. engine for "',target,'".' );
> >     halt(1)
> >   end;
>
> For this benchmark you don't need extra unneeded code for checking
> conditions. If the test fails it fails, so don't worry on errors

Good point.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
12