Hash Table Lookup Acceleration via Bitmask Collision Chain Filtering

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Hash tables experience significant resource consumption and slow lookup times due to linear probing of long collision chains, especially in low hit rate scenarios where misses are common, as the entire chain must be traversed to determine the absence of a key.

Innovation Solution

The use of bitmasks is introduced to accelerate lookups by storing them at the beginning of collision chains, allowing for quick determination of key presence through bitwise operations, thereby reducing the need to probe the entire chain for misses.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If linear probing is used to traverse collision chains, then all keys in the chain can be searched, but the search time and resource consumption increase significantly for long collision chains

Engineering Contradiction:
Improvecompleteness of key searchVSAvoidsearch time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

A bitmask is pre-calculated and stored at the beginning of the collision chain, representing the presence of keys in the chain. Before performing linear probing, the bitmask is used to quickly determine if the searched key exists in the chain. This preliminary action avoids the need to traverse the entire collision chain when the key is not present, significantly reducing search time while maintaining complete search capability.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If linear probing traverses the entire collision chain to determine key absence, then accurate miss detection is achieved, but excessive resources are spent on probing

Engineering Contradiction:
Improveaccuracy of miss detectionVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The bitmask is pre-computed and stored at the head of the collision chain to represent the set of keys present in the chain. When a search is performed, the bitmask is first checked against the searched key. If the key is not represented in the bitmask, the search can immediately conclude a miss without traversing the entire collision chain, thereby maintaining accurate miss detection while significantly reducing computational resource consumption.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If the entire collision chain is probed for every search, then no false misses occur, but the resource consumption increases especially in low hit rate scenarios

Engineering Contradiction:
Improveaccuracy of search resultVSAvoidsearch efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The bitmask serves as a pre-computed index that quickly indicates whether a searched key is present in the collision chain. By checking the bitmask first, the system can immediately determine misses without performing expensive linear probing, thereby maintaining search accuracy (no false misses) while dramatically improving search efficiency, particularly in low hit rate scenarios where most searches result in misses.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11403273B1Optimizing hash table searching using bitmasks and linear probing
Publication Date: 2022.08.02 AMAZON TECH INC
  • US11403273B1 patent drawing
  • US11403273B1 patent drawing
  • US11403273B1 patent drawing

AI summary

Within hash tables, bitmask(s) may be used to determine whether a given key is part of a collision chain or otherwise contained within the hash table. In some instances, using bitmask(s) may avoid linearly probing an entirety of the collision chain. For example, bitmask(s) may be used when searching low hit rate hash tables or hash tables where misses predominantly occur. Upon locating a collision chain within the hash table, or when probing the collision chain, the bitmask(s) may indicate whether subsequent keys within the collision chain correspond to the given key. The bitmask(s) may represent subsequent keys within the collision chain, and therefore, comparing the given key with the bitmask(s) may indicate similarities therebetween for use in determining whether to search a remainder of the collision chain.