data: data/yaml (YAML 1.2 core schema read / write: block + flow, compact collections, plain / quoted / literal / folded scalars, anchors + aliases as shared refs with an expansion limit, tags incl. !!binary / !!timestamp, %TAG, multi-document, explicit keys; writer with anchors for shared tables); yaml-test-suite + PyYAML fixtures; bench lines
tools/bench.sh: also generates the yaml fixtures.
This commit is contained in:
1 parent
eeb62192b5
commit
5811e3a4eb
9 files changed
+2111
-1
No files matched your search
@@ -86,3 +86,15 @@ do
|
||||
Xml.encode(doc)
|
||||
end)
|
||||
end
|
||||
do
|
||||
local Yaml = require("@formats/data/yaml")
|
||||
local YB = require("@tests/gen/yaml_bench")
|
||||
local yb = buffer.fromstring(YB.text)
|
||||
local v = assert(Yaml.decode(Bytes.reader(yb)))
|
||||
bench("yaml decode (block)", 3, #YB.text, function()
|
||||
Yaml.decode(Bytes.reader(yb))
|
||||
end)
|
||||
bench("yaml encode", 3, #YB.text, function()
|
||||
Yaml.encode(v)
|
||||
end)
|
||||
end
|
||||
Reference in new issue
Block a user