一句话:提出位并行快速前进的 JSON 流式处理框架,跳过无关子结构,显著加速流式分析。
流式分析半结构化数据(如 JSON)将解析与查询求值合并为单遍处理,以避免生成解析树,但传统设计需逐字符详细解析,限制了效率。本文发现可快速跳过与查询无关的子结构,但识别这些子结构本身可能需详细解析。为此,作者设计了一种高度位并行的方案,利用位运算和 SIMD 操作在流式过程中识别无关子结构。具体包括:新的递归下降流式模型、用于划分数据流的结构区间概念,以及实现多种快速前进情形的位并行算法。该方案实现为 JSON 流式框架 JSONSki,提供可在流式过程中调用的 API,动态快速前进跳过不同情形。在真实数据集和标准路径查询上的评估表明,JSONSki 相比最先进的 JSON 处理工具取得显著加速,且内存占用极小。
Semi-structured data, such as JSON, are fundamental to the Web and document data stores. Streaming analytics on semi-structured data combines parsing and query evaluation into one pass to avoid generating parse trees. Though promising, its conventional design requires to parse the data stream in detail character by character, which limits the efficiency of streaming analytics. This work reveals a wide range of opportunities to fast-forward the streaming over certain data substructures irrelevant to the query evaluation. However, identifying these substructures itself may need detailed parsing. To resolve this dilemma, this work designs a highly bit-parallel solution that intensively utilizes bitwise and SIMD operations to identify the irrelevant substructures during the streaming. It includes a new streaming model—recursive-descent streaming, for an easy adoption of fast-forward optimizations, a concept—structural intervals, for partitioning the data stream, and a group of bit-parallel algorithms implementing various fast-forward cases. The solution is implemented as a JSON streaming framework, called JSONSki. It offers a set of APIs that can be invoked during the streaming to dynamically fast-forward over different cases of irrelevant substructures. Evaluation using real-world datasets and standard path queries shows that JSONSki can achieve significant speedups over the state-of-the-art JSON processing tools while taking a minimum memory footprint.