Stack-based unmarshaler (#546)
* Benchmark script * Rewrite unmarshaler using the stack Instead of tracking the build chain using `target`s, use the stack instead. Working and most benchmarks look good, but regression on structs unmarshalling. ~60% slower on ReferenceFile/struct. * Shortcut to check if last node of iterator * Remove unecessary pointer allocation * Skip over unused keys without marking them as seen * Add some tests * Fix mktemp on macos
This commit is contained in:
+2
-4
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
//nolint:funlen
|
||||
func TestParser_AST_Numbers(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
examples := []struct {
|
||||
desc string
|
||||
@@ -137,7 +136,7 @@ func TestParser_AST_Numbers(t *testing.T) {
|
||||
for _, e := range examples {
|
||||
e := e
|
||||
t.Run(e.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
p := parser{}
|
||||
p.Reset([]byte(`A = ` + e.input))
|
||||
p.NextExpression()
|
||||
@@ -200,7 +199,6 @@ func compareIterator(t *testing.T, expected []astNode, actual ast.Iterator) {
|
||||
|
||||
//nolint:funlen
|
||||
func TestParser_AST(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
examples := []struct {
|
||||
desc string
|
||||
@@ -340,7 +338,7 @@ func TestParser_AST(t *testing.T) {
|
||||
for _, e := range examples {
|
||||
e := e
|
||||
t.Run(e.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
p := parser{}
|
||||
p.Reset([]byte(e.input))
|
||||
p.NextExpression()
|
||||
|
||||
Reference in New Issue
Block a user