fastjson

by intel-go

intel-go / fastjson
131 Stars 14 Forks Last release: Not found BSD 3-Clause "New" or "Revised" License 9 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

fastjson: optimized standard library JSON for Go

fastjson
has the same API as json from standard library
encoding/json
. The
Unmarshal
and
Decode
functions are faster, but everything else is the same as
encoding/json

Getting Started

$go get github.com/intel-go/fastjson

Perfomance

The performance depends on the content of your json structures, not the structure you parse to. If

.json
has a lot of strings or numbers, fastjson is significantly faster than
encoding/json

Example

import (
    "github.com/intel-go/fastjson"
    "fmt"
)

func main() { var jsonBlob = []byte([ {"Name": "Platypus", "Order": "Monotremata"}, {"Name": "Quoll", "Order": "Dasyuromorphia"} ]) type Animal struct { Name string Order string } var animals []Animal err := fastjson.Unmarshal(jsonBlob, &animals) if err != nil { fmt.Println("error:", err) } fmt.Printf("%+v", animals) // Output: // [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}] }

API

API is the same as encoding/json GoDoc

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.