Skip to content

Commit 9825eb4

Browse files
committed
refactor: fork and drop everything that uses reflection
Signed-off-by: Christian Stewart <[email protected]>
1 parent 71ac162 commit 9825eb4

File tree

124 files changed

+59
-15140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+59
-15140
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
/bug_test.go
33
/coverage.txt
44
/.idea
5+
.#*
6+
debug.test*

Gopkg.lock

Lines changed: 0 additions & 21 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
MIT License
22

3+
Copyright (c) 2024 Christian Stewart <[email protected]>
34
Copyright (c) 2016 json-iterator
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

Lines changed: 14 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,19 @@
1-
[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge)
2-
[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go)
3-
[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go)
4-
[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go)
5-
[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go)
6-
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE)
7-
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
1+
# json-iterator-lite
82

9-
A high-performance 100% compatible drop-in replacement of "encoding/json"
3+
[![GoDoc Widget]][GoDoc] [![Go Report Card Widget]][Go Report Card]
104

11-
# Benchmark
5+
[GoDoc]: https://godoc.org/github.com/aperturerobotics/json-iterator-lite
6+
[GoDoc Widget]: https://godoc.org/github.com/aperturerobotics/json-iterator-lite?status.svg
7+
[Go Report Card Widget]: https://goreportcard.com/badge/github.com/aperturerobotics/json-iterator-lite
8+
[Go Report Card]: https://goreportcard.com/report/github.com/aperturerobotics/json-iterator-lite
129

13-
![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png)
10+
**json-iterator** is an alternative to **encoding/json** which does not use reflection.
1411

15-
Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go
12+
**This is a fork of the [upstream project] with everything that depends on reflection removed**
1613

17-
Raw Result (easyjson requires static code generation)
14+
[upstream project]: https://github.com/json-iterator/go
1815

19-
| | ns/op | allocation bytes | allocation times |
20-
| --------------- | ----------- | ---------------- | ---------------- |
21-
| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
22-
| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
23-
| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
24-
| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
25-
| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
26-
| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
27-
28-
Always benchmark with your own workload.
29-
The result depends heavily on the data input.
30-
31-
# Usage
32-
33-
100% compatibility with standard lib
34-
35-
Replace
36-
37-
```go
38-
import "encoding/json"
39-
json.Marshal(&data)
40-
```
41-
42-
with
43-
44-
```go
45-
import jsoniter "github.com/json-iterator/go"
46-
47-
var json = jsoniter.ConfigCompatibleWithStandardLibrary
48-
json.Marshal(&data)
49-
```
50-
51-
Replace
52-
53-
```go
54-
import "encoding/json"
55-
json.Unmarshal(input, &data)
56-
```
57-
58-
with
59-
60-
```go
61-
import jsoniter "github.com/json-iterator/go"
62-
63-
var json = jsoniter.ConfigCompatibleWithStandardLibrary
64-
json.Unmarshal(input, &data)
65-
```
66-
67-
[More documentation](http://jsoniter.com/migrate-from-go-std.html)
68-
69-
# How to get
70-
71-
```
72-
go get github.com/json-iterator/go
73-
```
74-
75-
# Contribution Welcomed !
16+
# Attribution
7617

7718
Contributors
7819

@@ -83,3 +24,7 @@ Contributors
8324
- [Jason Toffaletti](https://github.com/toffaletti)
8425

8526
Report issue or pull request, or email [email protected], or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
27+
28+
# License
29+
30+
MIT

adapter.go

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)