JSON parser which picks up values directly without performing tokenization in Rust
Pikkr is a JSON parser which picks up values directly without performing tokenization in Rust. This JSON parser is implemented based on Y. Li, N. R. Katsipoulakis, B. Chandramouli, J. Goldstein, and D. Kossmann. Mison: a fast JSON parser for data analytics. In VLDB, 2017.
This JSON parser extracts values from a JSON record without using finite state machines (FSMs) and performing tokenization. It parses JSON records in the following procedures:
- [Indexing] Creates an index which maps logical locations of queried fields to their physical locations by using SIMD instructions and bit manipulation.
- [Basic parsing] Finds values of queried fields by scanning a JSON record using the index created in the previous process and learns their logical locations (i.e. pattern of the JSON structure) in the early stages.
- [Speculative parsing] Speculates logical locations of queried fields by using the learned result information, jumps directly to their physical locations and extracts values in the later stages. Fallbacks to basic parsing if the speculation fails.
This JSON parser performs well when there are a limited number of different JSON structural variants in a JSON data stream or JSON collection, and that is a common case in data analytics field.
Please read the paper mentioned in the opening paragraph for the details of the JSON parsing algorithm.
- serde_json 1.0.3
- json 0.11.9
- pikkr 0.16.0
- "a JSON data set of startup company information" on JSON Data Sets | JSON Studio.
- pikkr/rust-json-parser-benchmark: Rust JSON Parser Benchmark
- pikkr - Rust
- Rust nightly channel and CPUs with AVX2 are needed to build Rust source code which depends on Pikkr and run the executable binary file because Pikkr uses AVX2 Instructions.
Any kind of contribution (e.g. comment, suggestion, question, bug report and pull request) is welcome.