JNA (Java Native Access) is a Java library for calling native shared libraries without writing JNI glue code. Instead of manually implementing native methods, developers declare `Library` interfaces or use `Native.register` direct mapping; the runtime proxies those calls through `NativeLibrary`, resolves symbols, and dispatches through a native JNI bridge backed by a vendored libffi copy. The core also supplies memory management (`Pointer`, `Memory`, `Structure`, `Union`), callbacks via native trampolines, string/array marshalling, custom type converters, and Windows stdcall/UNICODE mapping utilities.
hyperscan-java provides Java bindings for Vectorscan, a high-performance multiple regex matching library (fork of Intel's Hyperscan). It allows simultaneous matching of thousands of regular expressions against input streams with exceptional throughput. The library offers two usage modes: a direct Vectorscan API for maximum performance (with limited regex syntax) and a PatternFilter utility that combines Vectorscan pre-filtering with Java's full regex engine for complete PCRE support. Key features include UTF-8 handling with byte-to-character mapping, database serialization for avoiding recompilation, callback-based scanning for efficient match processing, and support for both string and byte-oriented scanning. The architecture is a clean wrapper around the native library via JavaCPP, with well-separated concerns: Expression (pattern definition), Database (compiled pattern set), Scanner (matching engine), and utility classes. The codebase demonstrates strong engineering practices with comprehensive test coverage, including regression tests for upstream bugs and a JMH benchmark. It is actively maintained with recent releases and CI across Linux and macOS (x86_64 and arm64).
This is a mature, cross-platform Java library that provides thread-to-CPU-core binding (affinity) to reduce context switching and improve cache locality for low-latency and high-performance applications. It primarily uses JNA to invoke OS-specific system calls (sched_setaffinity on Linux, SetThreadAffinityMask on Windows, etc.) and offers a fallback to a no-op implementation. The library includes CPU topology detection via /proc/cpuinfo parsing, a file-based inter-process lock mechanism (AffinityLock) to reserve cores across JVMs, a high-resolution timer based on the RDTSC instruction via JNI, and a ThreadFactory for automatic affinity assignment. The architecture is a classic Java library with a clean public API (Affinity, AffinityLock, AffinityThreadFactory) and a set of platform-specific implementations hidden behind the IAffinity interface. The codebase is well-structured, extensively tested (including multi-process and OSGi tests), and actively maintained by the OpenHFT/Chronicle Software team. It is not a data_research project.