Commit dc92d69
authored
Merge pull request #228 from jonomacd/null-handling
**Description**: This adds a bespoke null error to the typed Get functions
**Benchmark before change**:
```
BenchmarkJsonParserLarge
BenchmarkJsonParserLarge-4 101186 59316 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserMedium
BenchmarkJsonParserMedium-4 664688 9127 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserDeleteMedium
BenchmarkJsonParserDeleteMedium-4 584113 16541 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserEachKeyManualMedium
BenchmarkJsonParserEachKeyManualMedium-4 697446 7584 ns/op 112 B/op 2 allocs/op
BenchmarkJsonParserEachKeyStructMedium
BenchmarkJsonParserEachKeyStructMedium-4 718255 9049 ns/op 544 B/op 12 allocs/op
BenchmarkJsonParserObjectEachStructMedium
BenchmarkJsonParserObjectEachStructMedium-4 598053 14774 ns/op 496 B/op 11 allocs/op
BenchmarkJsonParserSmall
BenchmarkJsonParserSmall-4 5438990 1097 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserEachKeyManualSmall
BenchmarkJsonParserEachKeyManualSmall-4 8123079 726.3 ns/op 80 B/op 2 allocs/op
BenchmarkJsonParserEachKeyStructSmall
BenchmarkJsonParserEachKeyStructSmall-4 5914904 1101 ns/op 184 B/op 7 allocs/op
BenchmarkJsonParserObjectEachStructSmall
BenchmarkJsonParserObjectEachStructSmall-4 3735968 1712 ns/op 168 B/op 6 allocs/op
BenchmarkJsonParserSetSmall
BenchmarkJsonParserSetSmall-4 2382969 3151 ns/op 768 B/op 4 allocs/op
BenchmarkJsonParserDelSmall
BenchmarkJsonParserDelSmall-4 1917996 4370 ns/op 0 B/op 0 allocs/op
PASS
ok benchmarks 104.655s
```
**Benchmark after change**:
```
BenchmarkJsonParserLarge
BenchmarkJsonParserLarge-4 98062 63203 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserMedium
BenchmarkJsonParserMedium-4 570456 9970 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserDeleteMedium
BenchmarkJsonParserDeleteMedium-4 603286 13375 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserEachKeyManualMedium
BenchmarkJsonParserEachKeyManualMedium-4 780256 9199 ns/op 112 B/op 2 allocs/op
BenchmarkJsonParserEachKeyStructMedium
BenchmarkJsonParserEachKeyStructMedium-4 419198 15755 ns/op 544 B/op 12 allocs/op
BenchmarkJsonParserObjectEachStructMedium
BenchmarkJsonParserObjectEachStructMedium-4 362432 16357 ns/op 496 B/op 11 allocs/op
BenchmarkJsonParserSmall
BenchmarkJsonParserSmall-4 3645873 1711 ns/op 0 B/op 0 allocs/op
BenchmarkJsonParserEachKeyManualSmall
BenchmarkJsonParserEachKeyManualSmall-4 5796182 1012 ns/op 80 B/op 2 allocs/op
BenchmarkJsonParserEachKeyStructSmall
BenchmarkJsonParserEachKeyStructSmall-4 5057808 1171 ns/op 184 B/op 7 allocs/op
BenchmarkJsonParserObjectEachStructSmall
BenchmarkJsonParserObjectEachStructSmall-4 5825636 1145 ns/op 168 B/op 6 allocs/op
BenchmarkJsonParserSetSmall
BenchmarkJsonParserSetSmall-4 3933043 2098 ns/op 768 B/op 4 allocs/op
BenchmarkJsonParserDelSmall
BenchmarkJsonParserDelSmall-4 2888763 1989 ns/op 0 B/op 0 allocs/op
PASS
ok benchmarks 93.459s
```2 files changed
+41
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
325 | | - | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| |||
1191 | 1192 | | |
1192 | 1193 | | |
1193 | 1194 | | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1194 | 1198 | | |
1195 | 1199 | | |
1196 | 1200 | | |
| |||
1213 | 1217 | | |
1214 | 1218 | | |
1215 | 1219 | | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1216 | 1223 | | |
1217 | 1224 | | |
1218 | 1225 | | |
| |||
1229 | 1236 | | |
1230 | 1237 | | |
1231 | 1238 | | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1232 | 1242 | | |
1233 | 1243 | | |
1234 | 1244 | | |
| |||
1246 | 1256 | | |
1247 | 1257 | | |
1248 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1249 | 1262 | | |
1250 | 1263 | | |
1251 | 1264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
916 | 922 | | |
917 | 923 | | |
918 | 924 | | |
| |||
936 | 942 | | |
937 | 943 | | |
938 | 944 | | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
939 | 951 | | |
940 | 952 | | |
941 | 953 | | |
| |||
1006 | 1018 | | |
1007 | 1019 | | |
1008 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1009 | 1027 | | |
1010 | 1028 | | |
1011 | 1029 | | |
| |||
1087 | 1105 | | |
1088 | 1106 | | |
1089 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1090 | 1115 | | |
1091 | 1116 | | |
1092 | 1117 | | |
| |||
1408 | 1433 | | |
1409 | 1434 | | |
1410 | 1435 | | |
1411 | | - | |
| 1436 | + | |
1412 | 1437 | | |
1413 | 1438 | | |
1414 | 1439 | | |
| |||
0 commit comments