- Notifications
You must be signed in to change notification settings - Fork329
Commitd34e5d4
committed
wsjson: Add json.Encoder vs json.Marshal benchmark
json.Encoder is 42% faster than json.Marshal thanks to the memory reuse.goos: linuxgoarch: amd64pkg: nhooyr.io/websocket/wsjsoncpu: 12th Gen Intel(R) Core(TM) i5-1235UBenchmarkJSON/json.Encoder-12 3517579 340.2 ns/op 24 B/op 1 allocs/opBenchmarkJSON/json.Marshal-12 2374086 484.3 ns/op 728 B/op 2 allocs/opCloses#4091 parentecf7dec commitd34e5d4
1 file changed
+24
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + |
0 commit comments
Comments
(0)