/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Pascal Free Pascal program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500 | 0.13 | 0.14 | ? | 423 | 0% 7% 0% 100% |
| 3,000 | 4.68 | 4.68 | 8 | 423 | 0% 0% 100% 0% |
| 5,500 | 15.71 | 15.72 | 8 | 423 | 34% 0% 0% 66% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read spectral-norm benchmark to see what this program should do.
Free Pascal Compiler version 2.6.0 [2011/12/23] for x86_64
Low memory use compared to other language implementations - because Free Pascal statically links programs by default, avoiding libc.
{ The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org contributed by Ian Osgood modified by Vincent Snijders } program spectralNorm; var n,i : integer; u,v,tmp : array of double; vBv,vv : double; function A(i,j : integer): double; inline; begin A := 1 / ((i+j)*(i+j+1) div 2 + i+1); end; procedure mulAv(var v, Av : array of double); var i,j : integer; begin for i := low(Av) to high(Av) do begin Av[i] := 0.0; for j := low(v) to high(v) do Av[i] := Av[i] + A(i,j) * v[j]; end; end; procedure mulAtv(var v, Atv : array of double); var i,j : integer; begin for i := low(Atv) to high(Atv) do begin Atv[i] := 0.0; for j := low(v) to high(v) do Atv[i] := Atv[i] + A(j,i) * v[j]; end; end; procedure mulAtAv(var v, AtAv : array of double); begin mulAv(v, tmp); mulAtv(tmp, AtAv); end; begin Val(paramstr(1), n, i); SetLength(u, n); SetLength(v, n); SetLength(tmp, n); for i := low(u) to high(u) do u[i] := 1.0; for i := 1 to 10 do begin mulAtAv(u,v); mulAtAv(v,u) end; for i := low(u) to high(u) do begin vBv := vBv + u[i]*v[i]; vv := vv + v[i]*v[i]; end; writeln(sqrt(vBv/vv):0:9); end.
Sat, 02 Feb 2013 00:51:22 GMT MAKE: mv spectralnorm.fpascal spectralnorm.pas /usr/local/src/fpc-2.6.0.x86_64-linux/bin/fpc -FuInclude/fpascal -XXs -O3 -Tlinux -oFPASCAL_RUN spectralnorm.pas Free Pascal Compiler version 2.6.0 [2011/12/23] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling spectralnorm.pas spectralnorm.pas(60,12) Warning: Variable "vBv" does not seem to be initialized spectralnorm.pas(61,12) Warning: Variable "vv" does not seem to be initialized Linking FPASCAL_RUN /usr/bin/ld: warning: link.res contains output sections; did you forget -T? 65 lines compiled, 0.1 sec 2 warning(s) issued mv FPASCAL_RUN spectralnorm.fpascal_run rm spectralnorm.pas 0.10s to complete and log all make actions COMMAND LINE: ./spectralnorm.fpascal_run 5500 PROGRAM OUTPUT: 1.274224153