- ADR-001: Usage of
sun.misc.Unsafefor Memory Access - ADR-002: Little-Endian Canonicalisation
- ADR-003: Abstraction via
Access<T>Strategy pattern - ADR-004: Reflective String Value Access (Compact Strings)
- ADR-005: Stateless Immutable Hash Functions
- ADR-006: Handling 128-bit Hashes via
LongTupleHashFunction
Chronicle Software
Status |
Accepted |
Date |
2025-11-01 |
Context |
To achieve the "Zero-Allocation" goal and maximise throughput, standard Java array access checks and byte-by-byte reading overhead are prohibitive. |
Decision |
Use |
Consequences |
* Positive: Maximal performance; enables "type punning" (reading bytes as longs) efficiently.
* Negative: Depends on internal JDK APIs. Requires specific |
Status |
Accepted |
Date |
2025-11-01 |
Context |
Different hardware architectures store multibyte primitives in different orders (Little-Endian vs Big-Endian). Hashing algorithms (often ported from C++) usually assume a specific order (mostly LE). |
Decision |
All implementations must normalise input to Little-Endian before processing ( |
Consequences |
* Positive: Guarantees identical hash results for the same byte sequence regardless of the hardware platform (x86 vs s390x). * Negative: Incurs a performance penalty on Big-Endian platforms due to the overhead of byte-swapping during reads. |
Status |
Accepted |
Date |
2025-11-01 |
Context |
The library needs to hash data residing in various formats: |
Decision |
Implement an |
Consequences |
* Positive: Eliminates code duplication; a single algorithm implementation supports all input types. Allows users to implement custom |
Status |
Accepted |
Date |
2025-11-01 |
Context |
Java 9 introduced "Compact Strings" (JEP 254), changing the internal representation of Strings from |
Decision |
Use reflection and |
Consequences |
* Positive: Zero-copy, zero-allocation hashing for Strings on modern JVMs.
* Negative: Extremely brittle; depends on private implementation details of |
Status |
Accepted |
Date |
2025-11-01 |
Context |
Hash functions are often used in concurrent environments (e.g., web servers, high-frequency trading). |
Decision |
|
Consequences |
* Positive: Instances are inherently thread-safe and can be stored in |
Status |
Accepted |
Date |
2025-11-01 |
Context |
Java primitives are limited to 64 bits ( |
Decision |
Introduce |
Consequences |
* Positive: Supports >64-bit hashes without allocating an Object wrapper (like |