Commit 746a37d
committed
Added Document type
I noticed that simd-json was still incredibly fast even without simd
enabled. The Document type is my last effort at making a mostly-safe
JSON parser.
The Document type parses into a single Vec, which is advantageous for
nested payloads due to having less tiny allocations. The downside is
that it takes a little more work to traverse the parsed document than
the Value type.
I've implemented a lot of convenience methods to facilitate moving
between Documents into Values, since the Value type is the only type
that supports being transformed back to JSON currently.
The major change in this commit is moving the parsing logic into its own
module and sharing it between the Document and Value types. This also
led to me publishing that event-driven parser module.1 parent 0abc3a1 commit 746a37d
8 files changed
Lines changed: 1416 additions & 722 deletions
File tree
- benchmarks/benches
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
| |||
0 commit comments