From 6bb110b185c27a4e00e7c486de27626cf1418c62 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Wed, 21 Sep 2016 10:44:40 +0200 Subject: [PATCH] Made bench great again --- bench/{common.nim => commonBench.nim} | 0 bench/jsonBench.nim | 4 ++-- bench/yamlBench.nim | 14 +++++++------- yaml/stream.nim | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) rename bench/{common.nim => commonBench.nim} (100%) diff --git a/bench/common.nim b/bench/commonBench.nim similarity index 100% rename from bench/common.nim rename to bench/commonBench.nim diff --git a/bench/jsonBench.nim b/bench/jsonBench.nim index 05de3b9..ecf61e8 100644 --- a/bench/jsonBench.nim +++ b/bench/jsonBench.nim @@ -1,8 +1,8 @@ -import "../yaml", common +import "../yaml", commonBench from nimlets_yaml import objKind -import math, strutils, stopwatch, terminal, algorithm, random +import math, strutils, stopwatch, terminal, algorithm, random, json proc cmp(left, right: clock): int = cmp(left.nanoseconds(), right.nanoseconds()) diff --git a/bench/yamlBench.nim b/bench/yamlBench.nim index 4539986..b5cf9d2 100644 --- a/bench/yamlBench.nim +++ b/bench/yamlBench.nim @@ -1,5 +1,5 @@ -import "../yaml", common -import math, strutils, stopwatch, terminal, algorithm, random +import "../yaml", commonBench +import math, strutils, stopwatch, terminal, algorithm, random, streams from nimlets_yaml import objKind @@ -153,10 +153,10 @@ block: let res = loadDOM(yaml100k) assert res.root.kind == yMapping -block: - multibench(cYaml1m, 2): - let res = loadDOM(yaml1m) - assert res.root.kind == yMapping +#block: +# multibench(cYaml1m, 2): +# let res = loadDOM(yaml1m) +# assert res.root.kind == yMapping block: multibench(cLibYaml1k, 100): @@ -199,4 +199,4 @@ writeResult "LibYAML: ", cLibYaml100k div 1000 setForegroundColor(fgWhite) writeStyled "1m input\n---------\n" writeResult "NimYAML: ", cYaml1m div 1000 -writeResult "LibYAML: ", cLibYaml1m div 1000 \ No newline at end of file +writeResult "LibYAML: ", cLibYaml1m div 1000 diff --git a/yaml/stream.nim b/yaml/stream.nim index d9f5335..bc9ed26 100644 --- a/yaml/stream.nim +++ b/yaml/stream.nim @@ -67,7 +67,7 @@ type ## available from ``parent``. proc noLastContext(s: YamlStream, line, column: var int, - lineContent: var string): bool = + lineContent: var string): bool {.raises: [].} = (line, column, lineContent) = (-1, -1, "") result = false