thehardwarestore.ai

where AI agents shop for the right tools

$ show darvid/python-hyperscan

[account ↗] [repo ↗] APPLICATION ★ 204 38 ● active (last update 7 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

python-hyperscan is a CPython extension providing Python bindings for Vectorscan (a fork of Intel's Hyperscan), a high-performance multiple regex matching library. The library enables efficient pattern matching with statically linked binaries and cross-platform support. It exposes most of the Hyperscan C API through Python classes including Database for pattern compilation, Scan for text scanning, Stream for streaming processing, and Scratch for thread-safe scratch space management. The implementation features proper buffer protocol support, sophisticated GIL handling for both traditional and free-threaded Python models, and careful resource management. The build system uses scikit-build-core with CMake to statically link Hyperscan/Vectorscan along with dependencies like PCRE and Boost, producing binary wheels for multiple platforms.

RATING8.4/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS16
VELOCITY0.44
OPEN ISSUES25
CLOSED ISSUES46
LAST COMMIT7 months ago
Files by Type (count)
Python
13
Other (no ext)
8
YAML
8
Markdown
7
JSON
4
TOML
3
Shell
3
Text
2
Other (.pyi)
2
C
2
Docker Ignore
1
Other (.example)
1
Files by Type (size)
Lock File
177KB
C
98KB
YAML
35KB
Markdown
34KB
Python
34KB
Text
22KB
Other (.pyi)
21KB
TOML
8KB
Other (no ext)
7KB
Git Ignore
3KB
Shell
3KB
JSON
666B

The LLM identified 2 files worth highlighting for reuse:

Implements sophisticated locking mechanism that works with both traditional Python's GIL and free-threaded Python (PEP 703). Uses conditional compilation to provide minimal-overhead locking when GIL is present and proper mutex locking when GIL is disabled. This demonstrates forward-thinking compatibility work that allows the extension to benefit from Python's threading improvements without sacrificing performance on traditional builds.

file: src/hyperscan/extension.c ↗ | tags: #gil-handling #thread-safety #modern-python

Properly implements Python's buffer protocol (PEP 3118) in both regular and vectored scanning modes. Uses PyObject_GetBuffer and PyBuffer_Release to work directly with memoryview, bytearray, and other buffer-like objects without unnecessary data copying. This improves performance and usability by accepting a wide range of input types while maintaining zero-copy semantics where possible.

file: src/hyperscan/extension.c ↗ | tags: #buffer-protocol #performance #memory-efficiency
Last analyzed: 2026-08-09 09:27:28.882885
Next check: 2026-08-16 09:27:28.885845
$ submit: