glass: ordered set data structure for client-side order books

AI-generated keywords: Computer Science

AI-generated Key Points

  • The "ordered set" abstract data type in computer science includes operations such as "insert", "erase", "find", "min", "max", "next" and "prev"
  • Traditional implementations of the ordered set use red-black trees, $B$-trees, or $B^+$-trees
  • A novel approach has been introduced with an ordered set based on a trie specifically designed for integer keys and optimized for market data applications
  • Features of the trie-based ordered set include leveraging a cached path for rapid truncation during erase operations, utilizing a hash table for O(1) time complexity key lookup up to a pre-leaf node, and hardware-accelerated operations using BMI2 instruction set extension on x86-64
  • Order book-specific functionalities like the preemption principle and tree restructure operation are incorporated to prevent excessive memory consumption
  • Performance benchmarks show significant speedups compared to C++'s standard std::map container across various operations: 6x-20x improvement on modifying operations, 30x faster lookup operations, 9x-15x enhancement on real market data scenarios, and 2x-3x boost in iteration speed
Also access our AI generated: Comprehensive summary, Lay summary, Blog-like article; or ask questions about this paper to our AI assistant.

Authors: Viktor Krapivensky

License: CC BY 4.0

Abstract: The "ordered set" abstract data type with operations "insert", "erase", "find", "min", "max", "next" and "prev" is ubiquitous in computer science. It is usually implemented with red-black trees, $B$-trees, or $B^+$-trees. We present our implementation of ordered set based on a trie. It only supports integer keys (as opposed to keys of any strict weakly ordered type) and is optimized for market data, namely for what we call sequential locality. The following is the list of what we believe to be novelties: * Cached path to exploit sequential locality, and fast truncation thereof on erase operation; * A hash table (or, rather, a cache table) with hard O(1) time guarantees on any operation to speed up key lookup (up to a pre-leaf node); * Hardware-accelerated "find next/previous set bit" operations with BMI2 instruction set extension on x86-64; * Order book-specific features: the preemption principle and the tree restructure operation that prevent the tree from consuming too much memory. We achieve the following speedups over C++'s standard std::map container: 6x-20x on modifying operations, 30x on lookup operations, 9x-15x on real market data, and a more modest 2x-3x speedup on iteration. In this paper, we discuss our implementation.

Submitted to arXiv on 16 Jun. 2025

Ask questions about this paper to our AI assistant

You can also chat with multiple papers at once here.

AI assistant instructions?

Results of the summarizing process for the arXiv paper: 2506.13991v1

, , , , In the realm of computer science, the "ordered set" abstract data type is a fundamental concept with operations such as "insert", "erase", "find", "min", "max", "next" and "prev". Traditionally, this data structure is implemented using red-black trees, $B$-trees, or $B^+$-trees. However, a novel approach has been introduced in the form of an ordered set based on a trie. This implementation specifically caters to integer keys and is finely tuned for market data applications, focusing on what is known as sequential locality. Several innovative features distinguish this trie-based ordered set from traditional implementations. Firstly, it leverages a cached path to exploit sequential locality and enables rapid truncation during erase operations. Additionally, a hash table (or cache table) guarantees O(1) time complexity for key lookup operations up to a pre-leaf node. Furthermore, hardware-accelerated operations utilizing the BMI2 instruction set extension on x86-64 enhance performance in finding next/previous set bits. Moreover, this ordered set incorporates order book-specific functionalities such as the preemption principle and tree restructure operation to prevent excessive memory consumption. The performance benchmarks showcase significant speedups compared to C++'s standard std::map container across various operations – 6x-20x improvement on modifying operations, 30x faster lookup operations, 9x-15x enhancement on real market data scenarios, and a more modest 2x-3x boost in iteration speed. The detailed analysis presented in this paper delves into the intricacies of the trie-based ordered set implementation and highlights its efficiency in handling market data workloads. By combining cutting-edge techniques with tailored optimizations for specific use cases, this innovative approach sets a new benchmark for performance in managing ordered sets within computer science applications.
Created on 10 May. 2026

Assess the quality of the AI-generated content by voting

Score: 0

Why do we need votes?

Votes are used to determine whether we need to re-run our summarizing tools. If the count reaches -10, our tools can be restarted.

Similar papers summarized with our AI tools

Navigate through even more similar papers through a

tree representation

Look for similar papers (in beta version)

By clicking on the button above, our algorithm will scan all papers in our database to find the closest based on the contents of the full papers and not just on metadata. Please note that it only works for papers that we have generated summaries for and you can rerun it from time to time to get a more accurate result while our database grows.

Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.