summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-13 21:20:41 +1000
committerAdam Scarr <adam@vektah.net>2017-08-13 21:20:41 +1000
commit139e7606f4ab68b469438956c378745f51f7b65b (patch)
tree2eaa9cb87e008ecaffefc01c5da933f1ea9852dd /readme.md
parent1c37779bd46d988c9e7b4bdb846b9daa89856b7c (diff)
Update benchmarks
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index ba35397..853dd6b 100644
--- a/readme.md
+++ b/readme.md
@@ -9,16 +9,18 @@ Run(parser, input, ASCIIWhitespace)
```
### benchmarks
-I dont have many benchmarks set up yet, but the json parser keeps up with the stdlib for raw speed:
+I dont have many benchmarks set up yet, but the json parser is 50% faster than the stdlib.
```
-$ go test -bench=. -benchtime=2s -benchmem ./json
-BenchmarkUnmarshalParsec-8 50000 66012 ns/op 50462 B/op 1318 allocs/op
-BenchmarkUnmarshalParsify-8 100000 46713 ns/op 44543 B/op 332 allocs/op
-BenchmarkUnmarshalStdlib-8 100000 46967 ns/op 13952 B/op 262 allocs/op
+$ go test -bench=. -benchmem -benchtime=5s ./json -run=none
+BenchmarkUnmarshalParsec-8 100000 65682 ns/op 50464 B/op 1318 allocs/op
+BenchmarkUnmarshalParsify-8 200000 32656 ns/op 42094 B/op 220 allocs/op
+BenchmarkUnmarshalStdlib-8 200000 48023 ns/op 13952 B/op 262 allocs/op
PASS
-ok github.com/vektah/goparsify/json 14.424s
+ok github.com/vektah/goparsify/json 24.314s
```
+Most of the remaining small allocs are from putting things in `interface{}` and are pretty unavoidable. https://www.darkcoding.net/software/go-the-price-of-interface/ is a good read.
+
### debugging parsers
When a parser isnt working as you intended you can build with debugging and enable logging to get a detailed log of exactly what the parser is doing.