mirror of https://github.com/status-im/NimYAML.git
Made bench great again
This commit is contained in:
parent
12960b2e31
commit
6bb110b185
|
@ -1,8 +1,8 @@
|
||||||
import "../yaml", common
|
import "../yaml", commonBench
|
||||||
|
|
||||||
from nimlets_yaml import objKind
|
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())
|
proc cmp(left, right: clock): int = cmp(left.nanoseconds(), right.nanoseconds())
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import "../yaml", common
|
import "../yaml", commonBench
|
||||||
import math, strutils, stopwatch, terminal, algorithm, random
|
import math, strutils, stopwatch, terminal, algorithm, random, streams
|
||||||
|
|
||||||
from nimlets_yaml import objKind
|
from nimlets_yaml import objKind
|
||||||
|
|
||||||
|
@ -153,10 +153,10 @@ block:
|
||||||
let res = loadDOM(yaml100k)
|
let res = loadDOM(yaml100k)
|
||||||
assert res.root.kind == yMapping
|
assert res.root.kind == yMapping
|
||||||
|
|
||||||
block:
|
#block:
|
||||||
multibench(cYaml1m, 2):
|
# multibench(cYaml1m, 2):
|
||||||
let res = loadDOM(yaml1m)
|
# let res = loadDOM(yaml1m)
|
||||||
assert res.root.kind == yMapping
|
# assert res.root.kind == yMapping
|
||||||
|
|
||||||
block:
|
block:
|
||||||
multibench(cLibYaml1k, 100):
|
multibench(cLibYaml1k, 100):
|
||||||
|
|
|
@ -67,7 +67,7 @@ type
|
||||||
## available from ``parent``.
|
## available from ``parent``.
|
||||||
|
|
||||||
proc noLastContext(s: YamlStream, line, column: var int,
|
proc noLastContext(s: YamlStream, line, column: var int,
|
||||||
lineContent: var string): bool =
|
lineContent: var string): bool {.raises: [].} =
|
||||||
(line, column, lineContent) = (-1, -1, "")
|
(line, column, lineContent) = (-1, -1, "")
|
||||||
result = false
|
result = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue