Branch: Tag:

2002-12-06

2002-12-06 17:23:27 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

Pike performance tests

Rev: lib/modules/Tools.pmod/Shoot.pmod/Ackermann.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/ArrayStuff.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/Compile.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/CompileExec.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/MatrixMult.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/NestedLoops.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/Overhead.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/RecursiveLoops.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/Test.pike:1.1
Rev: lib/modules/Tools.pmod/Shoot.pmod/module.pmod:1.1

1: + inherit Tools.Shoot.Test;    -  + constant name="Matrix multiplication"; +  + int size = 100; +  + array(array(int)) mkmatrix(int rows, int cols) + { +  return map(enumerate(rows*cols,1,1), +  lambda(int f) +  { +  return ((float)f)/(rows*cols); +  })/cols; + } +  + void test(int n) + { +  Math.Matrix m1 = Math.Matrix(mkmatrix(size, size)); +  Math.Matrix m2 = Math.Matrix(mkmatrix(size, size)); +  while (n--) m1=m1*m2; +  array q = (array(array(int)))(array)m1; + } +  + void perform() + { +  test(100); + }   Newline at end of file added.