Merge: Clean benches
authorJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 01:01:07 +0000 (08:01 +0700)
committerJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 01:01:07 +0000 (08:01 +0700)
Some janitoring in the benchmarks directory

Pull-Request: #1242
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

benchmarks/bench_engines.sh
benchmarks/markdown/.gitignore [new file with mode: 0644]
benchmarks/markdown/Makefile [new file with mode: 0644]
benchmarks/markdown/benches/Makefile
benchmarks/markdown/engines/nitmd/Makefile
benchmarks/strings/.gitignore [new file with mode: 0644]
benchmarks/strings/Makefile
lib/ai/examples/puzzle.nit

index 62d6a9c..ae91703 100755 (executable)
@@ -62,6 +62,7 @@ function run_compiler()
                run_command "$@" ../src/nit.nit -o "nit.$title.bin"
                bench_command "nit-queens" "nit queens.nit 8" "./nit.$title.bin" ../lib/ai/examples/queens.nit -q 8
                bench_command "nit-nitcc" "nit nitcc.nit calc.sablecc" "./nit.$title.bin" ../contrib/nitcc/src/nitcc.nit ../contrib/nitcc/examples/calc.sablecc
+               rm calc* 2> /dev/null # remove generated cruft
                run_command "$@" ../src/nitdoc.nit -o "nitdoc.$title.bin"
                rm -r out 2> /dev/null
                mkdir out 2> /dev/null
diff --git a/benchmarks/markdown/.gitignore b/benchmarks/markdown/.gitignore
new file mode 100644 (file)
index 0000000..ada48ff
--- /dev/null
@@ -0,0 +1,15 @@
+benches/gen_benches
+benches/out/
+
+engines/nitmd/nitmd
+engines/nitmd/nitmd-o
+
+engines/markdown4j/Markdown4j.class
+engines/markdown4j/markdown4j-2.2.jar
+
+engines/pandoc/pandoc
+engines/pandoc/pandoc.hi
+engines/pandoc/pandoc.o
+
+engines/txtmark/Txtmark.class
+engines/txtmark/txtmark-0.11.jar
diff --git a/benchmarks/markdown/Makefile b/benchmarks/markdown/Makefile
new file mode 100644 (file)
index 0000000..802fab6
--- /dev/null
@@ -0,0 +1,21 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+all:
+       ./bench_markdown.sh all
+
+clean:
+       $(MAKE) clean -C benches
+       $(MAKE) clean -C engines
+       rm -rf out/
index 641c47e..4cb8c36 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+NITC=../../../bin/nitc
+
 all: out
 
 gen_benches:
-       nitc gen_benches.nit
+       $(NITC) gen_benches.nit
 
 out: gen_benches
        ./gen_benches ./plain.md -o ./out
index 6424382..256ddfe 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+NITC=../../../../bin/nitc
+
 all: nitmd nitmd-o
 
 nitmd:
-       nitc nitmd.nit
+       $(NITC) nitmd.nit
 
 nitmd-o:
-       nitc --semi-global nitmd.nit -o $@
+       $(NITC) --semi-global nitmd.nit -o $@
 
 test: all
        ./nitmd ../../benches/hello.md 5
diff --git a/benchmarks/strings/.gitignore b/benchmarks/strings/.gitignore
new file mode 100644 (file)
index 0000000..0e224dc
--- /dev/null
@@ -0,0 +1,4 @@
+arraytos/
+string_concat/
+string_iter/
+string_substr/
index 82118c9..a6d89bf 100644 (file)
@@ -11,3 +11,6 @@ iter:
 
 array:
        ./bench_strings.sh array 10 10000000 10
+
+clean:
+       rm -rf arraytos/ string_concat/ string_iter/ string_substr/ 2>/dev/null
index 83c4b4c..0583035 100644 (file)
@@ -103,7 +103,7 @@ class PuzzleProblem
                if x < width-1 then res.add(1)
                if y >= 1 then res.add(-width)
                if y < width-1 then res.add(width)
-               return res.as_random.take_all
+               return res
        end
 
        # Return the state where the tile at hole+action has moved