From: Alexandre Terrasa Date: Mon, 26 Jan 2015 17:49:20 +0000 (+0100) Subject: benches/markdown: introduces engine txtmark X-Git-Tag: v0.7.1~8^2~2 X-Git-Url: http://nitlanguage.org benches/markdown: introduces engine txtmark Signed-off-by: Alexandre Terrasa --- diff --git a/benchmarks/markdown/bench_markdown.sh b/benchmarks/markdown/bench_markdown.sh index cc128a1..c95ce55 100755 --- a/benchmarks/markdown/bench_markdown.sh +++ b/benchmarks/markdown/bench_markdown.sh @@ -88,6 +88,18 @@ function bench_nitmd() } bench_nitmd +function bench_txtmark() +{ + name="$FUNCNAME" + skip_test "$name" && return + prepare_res $outdir/txtmark.dat "txtmark" "txtmark" + for file in $bncdir/*.md; do + bench=`basename $file .md` + bench_command "$bench" "" "java" "-cp" "$engdir/txtmark/.:$engdir/txtmark/txtmark-0.11.jar" "Txtmark" "$file" "$s" + done +} +bench_txtmark + if test "$#" -gt 0; then plot $outdir/bench_markdown.gnu fi diff --git a/benchmarks/markdown/engines/Makefile b/benchmarks/markdown/engines/Makefile index 96c791a..a3932f8 100644 --- a/benchmarks/markdown/engines/Makefile +++ b/benchmarks/markdown/engines/Makefile @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: nitmd/nitmd +all: nitmd/nitmd txtmark/Txtmark.class nitmd/nitmd: make -C nitmd +txtmark/Txtmark.class: + make -C txtmark + clean: make -C nitmd clean + make -C txtmark clean diff --git a/benchmarks/markdown/engines/txtmark/Makefile b/benchmarks/markdown/engines/txtmark/Makefile new file mode 100644 index 0000000..0c119d0f --- /dev/null +++ b/benchmarks/markdown/engines/txtmark/Makefile @@ -0,0 +1,27 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Copyright 2015 Alexandre Terrasa +# +# 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. + +Txtmark.class: txtmark-0.11.jar + javac -cp txtmark-0.11.jar Txtmark.java + +txtmark-0.11.jar: + wget -O txtmark-0.11.jar http://search.maven.org/remotecontent?filepath=com/github/rjeschke/txtmark/0.11/txtmark-0.11.jar + +test: Txtmark.class + java -cp .:txtmark-0.11.jar Txtmark ../../benches/hello.md 5 + +clean: + rm -rf txtmark-0.11.jar Txtmark.class diff --git a/benchmarks/markdown/engines/txtmark/Txtmark.java b/benchmarks/markdown/engines/txtmark/Txtmark.java new file mode 100644 index 0000000..dfca8c6 --- /dev/null +++ b/benchmarks/markdown/engines/txtmark/Txtmark.java @@ -0,0 +1,12 @@ +import com.github.rjeschke.txtmark.Processor; +import java.io.File; +import java.io.IOException; + +public class Txtmark { + public static void main(String[] args) throws IOException { + int n = Integer.parseInt(args[1]); + for(int i = 0; i < n; i++) { + System.out.println(Processor.process(new File(args[0]))); + } + } +}