You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Captain Dero 9687ad9cb4 Derosuite Status Update Release 2 6 years ago
..
testdata Derosuite Status Update Release 2 6 years ago
LICENSE Derosuite Status Update Release 2 6 years ago
README.md Derosuite Status Update Release 2 6 years ago
bench_test.go Derosuite Status Update Release 2 6 years ago
decode.go Derosuite Status Update Release 2 6 years ago
decode_test.go Derosuite Status Update Release 2 6 years ago
encode.go Derosuite Status Update Release 2 6 years ago
encode_test.go Derosuite Status Update Release 2 6 years ago
example_test.go Derosuite Status Update Release 2 6 years ago
fold.go Derosuite Status Update Release 2 6 years ago
fold_test.go Derosuite Status Update Release 2 6 years ago
indent.go Derosuite Status Update Release 2 6 years ago
number_test.go Derosuite Status Update Release 2 6 years ago
scanner.go Derosuite Status Update Release 2 6 years ago
scanner_test.go Derosuite Status Update Release 2 6 years ago
stream.go Derosuite Status Update Release 2 6 years ago
stream_test.go Derosuite Status Update Release 2 6 years ago
tagkey_test.go Derosuite Status Update Release 2 6 years ago
tags.go Derosuite Status Update Release 2 6 years ago
tags_test.go Derosuite Status Update Release 2 6 years ago

README.md

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