Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ Benchmark below serializes and deserializes a 11125 node tree.
### Serialize speed
```
name ............................... min time avg time std dv runs
treeform/flatty .................... 2.157 ms 2.319 ms +/-0.147 x100
bingo/planetis-m ................... 2.527 ms 2.599 ms +/-0.055 x100
disruptek/frosty ................... 5.779 ms 5.942 ms +/-0.101 x100
treeform/jsony ..................... 9.147 ms 9.361 ms +/-0.165 x100
treeform/flatty .................... 2.265 ms 2.413 ms +/-0.114 x100
bingo/planetis-m ................... 2.632 ms 2.705 ms +/-0.056 x100
disruptek/frosty ................... 6.280 ms 6.532 ms +/-0.142 x100
std/marshal ....................... 85.178 ms 93.228 ms +/-9.956 x100
treeform/jsony ..................... 9.618 ms 10.835 ms +/-1.276 x100
```
### Deserialize speed
```
treeform/flatty .................... 2.625 ms 3.503 ms +/-0.206 x100
bingo/planetis-m binTo ............. 4.796 ms 6.300 ms +/-1.463 x100
disruptek/frosty ................... 8.879 ms 11.549 ms +/-2.227 x100
treeform/jsony .................... 11.199 ms 14.036 ms +/-1.773 x100
treeform/flatty .................... 2.643 ms 4.285 ms +/-0.597 x100
bingo/planetis-m binTo ............. 5.735 ms 5.969 ms +/-0.132 x100
disruptek/frosty ................... 9.529 ms 9.959 ms +/-0.290 x100
std/marshal ...................... 148.723 ms 155.663 ms +/-4.763 x100
treeform/jsony .................... 12.023 ms 13.514 ms +/-1.143 x100
```

## JavaScript
Expand Down
16 changes: 8 additions & 8 deletions tests/bench.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import benchy, bingo, flatty, frosty/streams, jsony, random, streams
import benchy, bingo, flatty, frosty/streams, jsony, marshal, random, streams

type Node = ref object
active: bool
Expand Down Expand Up @@ -56,9 +56,9 @@ timeIt "disruptek/frosty", 100:
stringSink = tree.freeze()
intSink += stringSink.len

# super slow
# timeIt "std/marshal", 100:
# keep marshal.`$$`(tree)
timeIt "std/marshal", 100:
stringSink = marshal.`$$`(tree)
intSink += stringSink.len

timeIt "treeform/jsony", 100:
stringSink = tree.toJson()
Expand All @@ -84,10 +84,10 @@ timeIt "disruptek/frosty", 100:
nodeSink = thaw[Node](treeFrosityBin)
intSink += nodeSink.kids.len + nodeSink.payload.len + int(nodeSink.u16s[0])

# super slow
# var treeMarshalBin = $$tree
# timeIt "std/marshal", 100:
# keep marshal.to[Node](treeMarshalBin)
var treeMarshalBin = marshal.`$$`(tree)
timeIt "std/marshal", 100:
nodeSink = marshal.to[Node](treeMarshalBin)
intSink += nodeSink.kids.len + nodeSink.payload.len + int(nodeSink.u16s[0])

var treeJsanyBin = tree.toJson()
timeIt "treeform/jsony", 100:
Expand Down
Loading