소스 검색

* improved recursive benchmark

git-svn-id: trunk@8592 -
Vincent Snijders 18 년 전
부모
커밋
956d5e1c91
3개의 변경된 파일66개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 63 0
      tests/bench/shootout/src/recursive.lpi
  3. 2 2
      tests/bench/shootout/src/recursive.pp

+ 1 - 0
.gitattributes

@@ -5640,6 +5640,7 @@ tests/bench/shootout/src/mandelbrot.pp svneol=native#text/plain
 tests/bench/shootout/src/meteorshower.pp svneol=native#text/x-pascal
 tests/bench/shootout/src/meteorshower.pp svneol=native#text/x-pascal
 tests/bench/shootout/src/nsieve.pp svneol=native#text/plain
 tests/bench/shootout/src/nsieve.pp svneol=native#text/plain
 tests/bench/shootout/src/partialsums.pp svneol=native#text/plain
 tests/bench/shootout/src/partialsums.pp svneol=native#text/plain
+tests/bench/shootout/src/recursive.lpi svneol=native#text/plain
 tests/bench/shootout/src/recursive.pp svneol=native#text/plain
 tests/bench/shootout/src/recursive.pp svneol=native#text/plain
 tests/bench/shootout/src/regexdna.pp svneol=native#text/plain
 tests/bench/shootout/src/regexdna.pp svneol=native#text/plain
 tests/bench/shootout/src/simple_hash.pp svneol=native#text/plain
 tests/bench/shootout/src/simple_hash.pp svneol=native#text/plain

+ 63 - 0
tests/bench/shootout/src/recursive.lpi

@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="\"/>
+    <Version Value="5"/>
+    <General>
+      <Flags>
+        <MainUnitHasUsesSectionForAllUnits Value="False"/>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InIDEConfig"/>
+      <MainUnit Value="0"/>
+      <TargetFileExt Value=".exe"/>
+    </General>
+    <VersionInfo>
+      <ProjectVersion Value=""/>
+    </VersionInfo>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IgnoreBinaries Value="False"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="recursive.pp"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="recursive"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="run.bat"/>
+        <IsPartOfProject Value="True"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <PathDelim Value="\"/>
+    <CodeGeneration>
+      <Generate Value="Faster"/>
+      <Optimizations>
+        <OptimizationLevel Value="3"/>
+      </Optimizations>
+    </CodeGeneration>
+    <Linking>
+      <Debugging>
+        <UseLineInfoUnit Value="False"/>
+      </Debugging>
+      <LinkSmart Value="True"/>
+    </Linking>
+    <Other>
+      <CustomOptions Value="-Cppentium4"/>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+</CONFIG>

+ 2 - 2
tests/bench/shootout/src/recursive.pp

@@ -7,7 +7,7 @@
 
 
 program recursive;
 program recursive;
 
 
-{$I-}
+{$I-}{$OPTIMIZATION TAILREC}
 
 
 var
 var
    n : integer;
    n : integer;
@@ -28,7 +28,7 @@ begin
    else Fib := Fib(n - 2) + Fib(n - 1)
    else Fib := Fib(n - 2) + Fib(n - 1)
 end; { Fib }
 end; { Fib }
 
 
-function FibFP(n : double): double;
+function FibFP(n : double): double; inline;
 begin
 begin
    if n < 2 then
    if n < 2 then
       FibFP := 1
       FibFP := 1