mirror of
https://github.com/status-im/NimYAML.git
synced 2025-02-04 15:33:56 +00:00
Fixed bench compatibility with upcoming Nim
This commit is contained in:
parent
b6f730c459
commit
404aece2fd
@ -2,7 +2,7 @@ import "../yaml", common
|
||||
|
||||
from nimlets_yaml import objKind
|
||||
|
||||
import math, strutils, stopwatch, terminal, algorithm
|
||||
import math, strutils, stopwatch, terminal, algorithm, random
|
||||
|
||||
proc cmp(left, right: clock): int = cmp(left.nanoseconds(), right.nanoseconds())
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import "../yaml", common
|
||||
import math, strutils, stopwatch, terminal, algorithm
|
||||
import math, strutils, stopwatch, terminal, algorithm, random
|
||||
|
||||
from nimlets_yaml import objKind
|
||||
|
||||
@ -41,7 +41,6 @@ proc genYamlString(size: int, maxStringLen: int,
|
||||
## size is in KiB, mayStringLen in characters.
|
||||
|
||||
randomize(size * maxStringLen * ord(style))
|
||||
result = "{"
|
||||
|
||||
let targetSize = size * 1024
|
||||
var
|
||||
@ -145,8 +144,7 @@ block:
|
||||
|
||||
block:
|
||||
multibench(cYaml10k, 100):
|
||||
var
|
||||
s = newStringStream(yaml10k)
|
||||
var s = newStringStream(yaml10k)
|
||||
let res = loadDOM(s)
|
||||
assert res.root.kind == yMapping
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user