jscan provides a high-performance zero-allocation JSON iterator for Go

GitHub Actions: CI Coverage Status GoReportCard Go Reference

jscan

jscan provides a high-performance zero-allocation JSON iterator for Go. It's not compatible with encoding/json and doesn't provide the usual Marshal/Unmarshal capabilities, instead it focuses on fast and efficient scanning over JSON strings with on-the-fly validation.

Example

https://go.dev/play/p/v-VeiMO2fsJ

package main

import (
	"fmt"

	"github.com/romshark/jscan"
)

func main() {
	j := `{
		"s": "value",
		"t": true,
		"f": false,
		"0": null,
		"n": -9.123e3,
		"o0": {},
		"a0": [],
		"o": {
			"k": "\"v\"",
			"a": [
				true,
				null,
				"item",
				-67.02e9,
				["foo"]
			]
		},
		"a3": [
			0,
			{
				"a3.a3":8
			}
		]
	}`

	err := jscan.Scan(jscan.Options{
		CachePath:  true,
		EscapePath: true,
	}, j, func(i *jscan.Iterator) (err bool) {
		fmt.Printf("| value:\n")
		fmt.Printf("|  level:      %d\n", i.Level)
		if k := i.Key(); k != "" {
			fmt.Printf("|  key:        %q\n", i.Key())
		}
		fmt.Printf("|  valueType:  %s\n", i.ValueType)
		if v := i.Value(); v != "" {
			fmt.Printf("|  value:      %q\n", i.Value())
		}
		fmt.Printf("|  arrayIndex: %d\n", i.ArrayIndex)
		fmt.Printf("|  path:       '%s'\n", i.Path())
		return false // No Error, resume scanning
	})

	if err.IsErr() {
		fmt.Printf("ERR: %s\n", err)
		return
	}

}

Benchmark Results

The following results were recorded on an Apple M1 Max MBP running macOS 12.1

goos: darwin
goarch: arm64

Tiny JSON document ({"x":0}):

BenchmarkCalcStats/jscan/tiny-10    	17281384	        61.52 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/tiny-10 	12591319	        93.49 ns/op	     160 B/op	       2 allocs/op
BenchmarkCalcStats/gofaster-jx/tiny-10         	15380218	        76.69 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson/tiny-10             	14686556	        81.48 ns/op	       0 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/tiny-10      	14819349	        80.68 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/tiny-10   	11339800	       105.5 ns/op	     160 B/op	       2 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/tiny-10         	13993488	        84.37 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/tiny-10    	11028562	       107.5 ns/op	       8 B/op	       1 allocs/op

Small JSON document (335 bytes):

BenchmarkCalcStats/jscan/small-10   	 2055507	       572.7 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/small-10         	 1465920	       818.2 ns/op	     224 B/op	      12 allocs/op
BenchmarkCalcStats/gofaster-jx/small-10      	 1301629	       921.0 ns/op	      16 B/op	       2 allocs/op
BenchmarkCalcStats/valyala-fastjson/small-10          	 1667216	       719.2 ns/op	       0 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/small-10   	 1593405	       747.5 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/small-10         	  974680	      1211 ns/op	     288 B/op	      21 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/small-10      	  909572	      1296 ns/op	      80 B/op	      13 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/small-10 	 1222809	       981.1 ns/op	      88 B/op	      10 allocs/op

Large JSON document (26.1 MB):

BenchmarkCalcStats
BenchmarkCalcStats/jscan/large-10   	      30	  39817379 ns/op	     271 B/op	       2 allocs/op
BenchmarkCalcStats/jsoniter/large-10         	      19	  59779695 ns/op	33060224 B/op	 1108611 allocs/op
BenchmarkCalcStats/gofaster-jx/large-10      	      22	  50123860 ns/op	      58 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson/large-10          	      30	  40858881 ns/op	11381580 B/op	   11033 allocs/op

BenchmarkCalcStats/jscan_withpath/large-10   	      26	  44913019 ns/op	     322 B/op	       2 allocs/op
BenchmarkCalcStats/jsoniter_withpath/large-10         	      13	  85893750 ns/op	55805724 B/op	 1757457 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/large-10      	      12	  95080243 ns/op	52296336 B/op	 1544965 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/large-10 	      21	  52270306 ns/op	29394618 B/op	  340766 allocs/op

Array of 1024 integers:

BenchmarkCalcStats/jscan/array_int_1024-10         	   49778	     23505 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/array_int_1024-10      	   29674	     40478 ns/op	   16528 B/op	    1025 allocs/op
BenchmarkCalcStats/gofaster-jx/array_int_1024-10   	   36080	     33218 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson/array_int_1024-10       	   46993	     25360 ns/op	       5 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/array_int_1024-10         	   33222	     36090 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/array_int_1024-10      	   13416	     89293 ns/op	   24496 B/op	    2973 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/array_int_1024-10   	   14683	     81523 ns/op	    7970 B/op	    1948 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/array_int_1024-10         	   24570	     48887 ns/op	    8194 B/op	    1024 allocs/op

Array of 1024 floating point numbers:

BenchmarkCalcStats/jscan/array_dec_1024-10         	   43645	     25321 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/array_dec_1024-10      	   27168	     44132 ns/op	   16528 B/op	    1025 allocs/op
BenchmarkCalcStats/gofaster-jx/array_dec_1024-10   	   13220	     90298 ns/op	    6498 B/op	     547 allocs/op
BenchmarkCalcStats/valyala-fastjson/array_dec_1024-10       	   42273	     27560 ns/op	       0 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/array_dec_1024-10         	   28917	     40965 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/array_dec_1024-10      	   12783	     94376 ns/op	   24496 B/op	    2973 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/array_dec_1024-10   	   13364	     90193 ns/op	    7970 B/op	    1948 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/array_dec_1024-10         	   23299	     50773 ns/op	    8204 B/op	    1024 allocs/op

Array of 1024 strings:

BenchmarkCalcStats/jscan/array_str_1024-10         	   36171	     32719 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/array_str_1024-10      	    1909	    611724 ns/op	  670313 B/op	    1019 allocs/op
BenchmarkCalcStats/gofaster-jx/array_str_1024-10   	    2246	    520334 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson/array_str_1024-10       	   15608	     77085 ns/op	      55 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/array_str_1024-10         	   26394	     45593 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/array_str_1024-10      	    1767	    667022 ns/op	  678284 B/op	    2967 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/array_str_1024-10   	    1773	    684708 ns/op	  677621 B/op	    2927 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/array_str_1024-10         	   12117	     98868 ns/op	    8195 B/op	    1024 allocs/op

Array of 1024 nullable booleans:

BenchmarkCalcStats/jscan/array_nullbool_1024-10         	   78883	     14034 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter/array_nullbool_1024-10      	   44224	     26998 ns/op	     144 B/op	       1 allocs/op
BenchmarkCalcStats/gofaster-jx/array_nullbool_1024-10   	   35641	     33411 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/valyala-fastjson/array_nullbool_1024-10       	   73539	     16104 ns/op	       0 B/op	       0 allocs/op

BenchmarkCalcStats/jscan_withpath/array_nullbool_1024-10         	   43722	     27344 ns/op	       0 B/op	       0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/array_nullbool_1024-10      	   15586	     76804 ns/op	    8112 B/op	    1949 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/array_nullbool_1024-10   	   14474	     83515 ns/op	    7970 B/op	    1948 allocs/op
BenchmarkCalcStats/valyala-fastjson_withpath/array_nullbool_1024-10         	   30286	     39500 ns/op	    8194 B/op	    1024 allocs/op

Get by path:

BenchmarkGet/jscan-10         	 3957463	       288.8 ns/op	      16 B/op	       2 allocs/op
BenchmarkGet/jsoniter-10      	 1272576	       941.7 ns/op	     496 B/op	      19 allocs/op
BenchmarkGet/tidwallgjson-10  	 6308622	       190.5 ns/op	      16 B/op	       2 allocs/op
BenchmarkGet/valyalafastjson-10         	 6188893	       193.9 ns/op	       0 B/op	       0 allocs/op

Validation:

BenchmarkValid/tiny/jscan-10   	19409760	        61.44 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/tiny/jsoniter-10         	20232646	        59.52 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/tiny/gofaster-jx-10      	15790867	        75.55 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/tiny/encoding-json-10    	27169221	        43.90 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/tiny/tidwallgjson-10     	72519966	        16.46 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/tiny/valyala-fastjson-10 	41914624	        28.70 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/small/jscan-10           	 2263227	       530.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/small/jsoniter-10        	 1482616	       809.6 ns/op	      56 B/op	       7 allocs/op
BenchmarkValid/small/gofaster-jx-10     	 1414510	       846.3 ns/op	      16 B/op	       2 allocs/op
BenchmarkValid/small/encoding-json-10   	 1206177	       993.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/small/tidwallgjson-10    	 3561247	       337.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/small/valyala-fastjson-10         	 2633577	       452.2 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/large/jscan-10                    	      30	  39348897 ns/op	     271 B/op	       2 allocs/op
BenchmarkValid/large/jsoniter-10                 	      24	  47381846 ns/op	13792181 B/op	  644454 allocs/op
BenchmarkValid/large/gofaster-jx-10              	      26	  44456761 ns/op	      52 B/op	       0 allocs/op
BenchmarkValid/large/encoding-json-10            	      16	  70171828 ns/op	      80 B/op	       0 allocs/op
BenchmarkValid/large/tidwallgjson-10             	      40	  28859103 ns/op	       2 B/op	       0 allocs/op
BenchmarkValid/large/valyala-fastjson-10         	      40	  28703367 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/unwind_stack/jscan-10             	  457160	      2624 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/unwind_stack/jsoniter-10          	   15862	     75624 ns/op	   33145 B/op	    1033 allocs/op
BenchmarkValid/unwind_stack/gofaster-jx-10       	    1560	    763111 ns/op	  131117 B/op	    2048 allocs/op
BenchmarkValid/unwind_stack/encoding-json-10     	  212856	      5536 ns/op	      24 B/op	       1 allocs/op
BenchmarkValid/unwind_stack/tidwallgjson-10      	   80488	     14748 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/unwind_stack/valyala-fastjson-10  	     222	   5544191 ns/op	52472494 B/op	    4133 allocs/op

BenchmarkValid/array_int_1024/jscan-10           	   66847	     17774 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_int_1024/jsoniter-10        	   51276	     23477 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_int_1024/gofaster-jx-10     	   44049	     26980 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_int_1024/encoding-json-10   	   34149	     35169 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_int_1024/tidwallgjson-10    	   77713	     15338 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_int_1024/valyala-fastjson-10         	   65236	     18438 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/array_dec_1024/jscan-10                    	   70789	     15665 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_dec_1024/jsoniter-10                 	   15679	     76847 ns/op	    8754 B/op	     547 allocs/op
BenchmarkValid/array_dec_1024/gofaster-jx-10              	   14700	     81322 ns/op	    6498 B/op	     547 allocs/op
BenchmarkValid/array_dec_1024/encoding-json-10            	   32197	     36578 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_dec_1024/tidwallgjson-10             	   84492	     12129 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_dec_1024/valyala-fastjson-10         	   51250	     19518 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/array_nullbool_1024/jscan-10               	  226735	      5242 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_nullbool_1024/jsoniter-10            	   59954	     20019 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_nullbool_1024/gofaster-jx-10         	   44670	     26863 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_nullbool_1024/encoding-json-10       	   56584	     21165 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_nullbool_1024/tidwallgjson-10        	  212652	      5307 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_nullbool_1024/valyala-fastjson-10    	  130365	      9181 ns/op	       0 B/op	       0 allocs/op

BenchmarkValid/array_str_1024/jscan-10                    	   35758	     33207 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_str_1024/jsoniter-10                 	    2346	    509377 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_str_1024/gofaster-jx-10              	    2325	    513011 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_str_1024/encoding-json-10            	     858	   1392125 ns/op	       1 B/op	       0 allocs/op
BenchmarkValid/array_str_1024/tidwallgjson-10             	    2370	    503992 ns/op	       0 B/op	       0 allocs/op
BenchmarkValid/array_str_1024/valyala-fastjson-10         	    4519	    260450 ns/op	       0 B/op	       0 allocs/op
Owner
Roman Sharkov
Backend Engineer
Roman Sharkov
Similar Resources

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection

fastjson - fast JSON parser and validator for Go Features Fast. As usual, up to 15x faster than the standard encoding/json. See benchmarks. Parses arb

Jan 5, 2023

Small utility to create JSON objects

Small utility to create JSON objects

gjo Small utility to create JSON objects. This was inspired by jpmens/jo. Support OS Mac Linux Windows Requirements Go 1.1.14~ Git Installtion Build $

Dec 8, 2022

A Go package for handling common HTTP JSON responses.

go-respond A Go package for handling common HTTP JSON responses. Installation go get github.com/nicklaw5/go-respond Usage The goal of go-respond is to

Sep 26, 2022

JSON query in Golang

gojq JSON query in Golang. Install go get -u github.com/elgs/gojq This library serves three purposes: makes parsing JSON configuration file much easie

Dec 28, 2022

Automatically generate Go (golang) struct definitions from example JSON

gojson gojson generates go struct definitions from json or yaml documents. Example $ curl -s https://api.github.com/repos/chimeracoder/gojson | gojson

Jan 1, 2023

A JSON diff utility

JayDiff A JSON diff utility. Install Downloading the compiled binary Download the latest version of the binary: releases extract the archive and place

Dec 11, 2022

Fast and flexible JSON encoder for Go

Fast and flexible JSON encoder for Go

Jettison Jettison is a fast and flexible JSON encoder for the Go programming language, inspired by bet365/jingo, with a richer features set, aiming at

Dec 21, 2022

Create go type representation from json

json2go Package json2go provides utilities for creating go type representation from json inputs. Json2go can be used in various ways: CLI tool Web pag

Dec 26, 2022

Console JSON formatter with query feature

Console JSON formatter with query feature

Console JSON formatter with query feature. Install: $ go get github.com/miolini/jsonf Usage: Usage of jsonf: -c=true: colorize output -d=false: de

Dec 4, 2022
Comments
  • feat: update go-faster/jx

    feat: update go-faster/jx

    name                                     old time/op    new time/op    delta
    Valid/tiny/gofaster-jx-32                  60.0ns ± 2%    44.1ns ± 2%   -26.57%  (p=0.008 n=5+5)
    Valid/small/gofaster-jx-32                  815ns ± 7%     433ns ± 3%   -46.79%  (p=0.008 n=5+5)
    Valid/large/gofaster-jx-32                 38.6ms ± 1%    28.3ms ± 2%   -26.56%  (p=0.008 n=5+5)
    Valid/unwind_stack/gofaster-jx-32          1.29ms ± 2%    0.71ms ± 5%   -44.38%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/tiny-32              57.6ns ± 3%    51.7ns ± 2%   -10.25%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/small-32              895ns ± 5%     612ns ± 6%   -31.68%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32             40.9ms ± 1%    35.6ms ± 1%   -13.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/tiny-32     69.8ns ± 2%    56.2ns ± 2%   -19.49%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/small-32    1.53µs ± 2%    0.65µs ± 2%   -57.34%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32     168ms ± 4%      35ms ± 2%   -79.10%  (p=0.008 n=5+5)
    
    name                                     old alloc/op   new alloc/op   delta
    Valid/tiny/gofaster-jx-32                   0.00B          0.00B           ~     (all equal)
    Valid/small/gofaster-jx-32                  16.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)
    Valid/large/gofaster-jx-32                   137B ± 2%       99B ± 7%   -27.34%  (p=0.008 n=5+5)
    Valid/unwind_stack/gofaster-jx-32           131kB ± 0%      66kB ± 0%   -49.90%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/tiny-32               0.00B          0.00B           ~     (all equal)
    CalcStats/gofaster-jx/small-32              16.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32               144B ± 4%      128B ± 3%   -11.11%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/tiny-32      0.00B          0.00B           ~     (all equal)
    CalcStats/gofaster-jx_withpath/small-32     80.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32    52.3MB ± 0%     0.0MB ± 2%  -100.00%  (p=0.008 n=5+5)
    
    name                                     old allocs/op  new allocs/op  delta
    Valid/tiny/gofaster-jx-32                    0.00           0.00           ~     (all equal)
    Valid/small/gofaster-jx-32                   2.00 ± 0%      0.00       -100.00%  (p=0.008 n=5+5)
    Valid/large/gofaster-jx-32                   0.00           0.00           ~     (all equal)
    Valid/unwind_stack/gofaster-jx-32           2.05k ± 0%     1.03k ± 0%   -49.90%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/tiny-32                0.00           0.00           ~     (all equal)
    CalcStats/gofaster-jx/small-32               2.00 ± 0%      0.00       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32               0.00           0.00           ~     (all equal)
    CalcStats/gofaster-jx_withpath/tiny-32       0.00           0.00           ~     (all equal)
    CalcStats/gofaster-jx_withpath/small-32      13.0 ± 0%       0.0       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32     1.54M ± 0%     0.00M       -100.00%  (p=0.008 n=5+5)
    

    Please also update benchmarks in readme when you have time for it :heart:

  • Valid: another validation errors

    Valid: another validation errors

    package jscan
    
    import (
    	"encoding/json"
    	"testing"
    )
    
    func TestValid(t *testing.T) {
    	for _, v := range []string{
    		" ",
    		"0 0",
    	} {
    		if json.Valid([]byte(v)) != Valid(v) {
    			t.Errorf("%#v", v)
    		}
    	}
    }
    
    === RUN   TestValid
        valid_test.go:14: " "
        valid_test.go:14: "0 0"
    --- FAIL: TestValid (0.00s)
    === RUN   TestValid
    --- PASS: TestValid (0.00s)
    
    FAIL
    
  • Valid: improper string validation

    Valid: improper string validation

    package jscan
    
    import (
    	"encoding/json"
    	"testing"
    )
    
    func TestValid(t *testing.T) {
    	for _, v := range []string{
    		"\"\x01\"",
    	} {
    		if json.Valid([]byte(v)) != Valid(v) {
    			t.Errorf("%#v", v)
    		}
    	}
    }
    
    === RUN   TestValid
        valid_test.go:13: "\"\x01\""
    --- FAIL: TestValid (0.00s)
    === RUN   TestValid
    --- PASS: TestValid (0.00s)
    
    FAIL
    
  • test(bench): improve go-faster/jx benchmark

    test(bench): improve go-faster/jx benchmark

    • Use ObjBytes to avoid key allocations
    • Use Skip instead of parsing
    • Avoid unrelated allocation (add strToBytes)
    name                                     old time/op    new time/op    delta
    CalcStats/gofaster-jx/tiny-32               237ns ± 2%      60ns ± 1%   -74.77%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/small-32             1.28µs ± 9%    0.88µs ± 4%   -30.85%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32              151ms ± 1%      41ms ± 1%   -72.85%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/tiny-32      296ns ± 3%      74ns ± 2%   -75.08%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/small-32    2.10µs ± 6%    1.53µs ± 6%   -26.91%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32     199ms ± 1%     164ms ± 2%   -17.66%  (p=0.008 n=5+5)
    
    name                                     old alloc/op   new alloc/op   delta
    CalcStats/gofaster-jx/tiny-32               40.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/small-32              80.0B ± 0%     16.0B ± 0%   -80.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32             35.2MB ± 0%     0.0MB ± 7%  -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/tiny-32      40.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/small-32      144B ± 0%       80B ± 0%   -44.44%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32    57.9MB ± 0%    52.3MB ± 0%    -9.67%  (p=0.008 n=5+5)
    
    name                                     old allocs/op  new allocs/op  delta
    CalcStats/gofaster-jx/tiny-32                2.00 ± 0%      0.00       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/small-32               8.00 ± 0%      2.00 ± 0%   -75.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx/large-32              1.12M ± 0%     0.00M       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/tiny-32       2.00 ± 0%      0.00       -100.00%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/small-32      17.0 ± 0%      13.0 ± 0%   -23.53%  (p=0.008 n=5+5)
    CalcStats/gofaster-jx_withpath/large-32     1.77M ± 0%     1.54M ± 0%   -12.53%  (p=0.008 n=5+5)
    
Related tags
A high-performance 100% compatible drop-in replacement of "encoding/json"
A high-performance 100% compatible drop-in replacement of

A high-performance 100% compatible drop-in replacement of "encoding/json" You can also use thrift like JSON using thrift-iterator Benchmark Source cod

Jan 8, 2023
JSON Spanner - A Go package that provides a fast and simple way to filter or transform a json document

JSON SPANNER JSON Spanner is a Go package that provides a fast and simple way to

Sep 14, 2022
Get JSON values quickly - JSON parser for Go
Get JSON values quickly - JSON parser for Go

get json values quickly GJSON is a Go package that provides a fast and simple way to get values from a json document. It has features such as one line

Dec 28, 2022
JSON diff library for Go based on RFC6902 (JSON Patch)

jsondiff jsondiff is a Go package for computing the diff between two JSON documents as a series of RFC6902 (JSON Patch) operations, which is particula

Dec 4, 2022
Fast JSON encoder/decoder compatible with encoding/json for Go
Fast JSON encoder/decoder compatible with encoding/json for Go

Fast JSON encoder/decoder compatible with encoding/json for Go

Jan 6, 2023
Package json implements encoding and decoding of JSON as defined in RFC 7159

Package json implements encoding and decoding of JSON as defined in RFC 7159. The mapping between JSON and Go values is described in the documentation for the Marshal and Unmarshal functions

Jun 26, 2022
Json-go - CLI to convert JSON to go and vice versa
Json-go - CLI to convert JSON to go and vice versa

Json To Go Struct CLI Install Go version 1.17 go install github.com/samit22/js

Jul 29, 2022
A Small tool for SDWAN performance test and policy validation

sdwan-perf Sdwan-perf is based on golang and could support almost platform for performance and policy validation. SDWAN Performance Test Report +--

Sep 3, 2022
Example to validate performance using append or not in golang

benchtest-arr-go This code is a example to validate performance using append or not in golang result benchtests go test -benchmem -bench . goos: darwi

Jan 10, 2022
Abstract JSON for golang with JSONPath support

Abstract JSON Abstract JSON is a small golang package provides a parser for JSON with support of JSONPath, in case when you are not sure in its struct

Jan 5, 2023