Skip to content

Tachyon JSON v6: The World's Fastest JSON Library. 5.5 GB/s throughput via AVX2 ASM kernels & Lazy Indexing. C++20 header-only, nlohmann-like syntax, 160x faster than standard DOM parsers.

License

Notifications You must be signed in to change notification settings

wilkolbrzym-coder/Tachyon.JSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tachyon JSON v6.0.1: "The Glaze-Killer"

The Undisputed Fastest JSON Library in Existence.

License Standard Speed

🚀 Overview

Tachyon v6.0 is a high-performance, single-header C++20 JSON library designed to obliterate existing benchmarks. Engineered with heavy AVX2 assembly optimizations and a novel "Dual-Engine" architecture, Tachyon achieves parsing speeds exceeding 4500 MB/s on standard hardware, outperforming simdjson by ~2.4x and nlohmann::json by ~200x.

⚡ Scientific Benchmarks

Benchmarks were conducted on an Intel Xeon (Haswell) environment with CPU Pinning, 64-byte Alignment, and Statistical Rigor (Median of 1000 iterations).

Dataset Library Throughput (MB/s) Median Latency P99 Latency Stdev
Large Array (25MB) Tachyon v6.0 4,577 MB/s 5.46 ms 6.89 ms 9.2%
Simdjson (OnDemand) 1,886 MB/s 13.25 ms 13.67 ms 0.9%
Glaze (Generic) 139 MB/s 179.05 ms 185.72 ms 1.1%
Nlohmann JSON 25 MB/s 1013 ms 1015 ms 0.3%
Canada.json (Floats) Tachyon v6.0 5,585 MB/s 0.38 ms 0.46 ms 5.2%
Simdjson 3,541 MB/s 0.61 ms 0.69 ms 4.6%
Glaze 372 MB/s 5.76 ms 5.97 ms 1.1%
Nlohmann 31 MB/s 69.3 ms 70.1 ms 0.5%

Note: Tachyon outperforms Simdjson by ~2.4x on Large Arrays. Glaze generic parsing is significantly slower than typed parsing (which requires schemas).

ASCII Performance Chart (Large Array)

MB/s
5000 |  [TACHYON] 4577
4500 |  |||||||||||||||||||||||||||||
4000 |  |||||||||||||||||||||||||||||
3500 |  |||||||||||||||||||||||||||||
3000 |  |||||||||||||||||||||||||||||
2500 |  |||||||||||||||||||||||||||||
2000 |  ||||||||||||| [Simdjson] 1886
1500 |  |||||||||||||
1000 |  ||||||
 500 |  ||
   0 |  [Glaze] 139  [Nlohmann] 25

🏗 Architecture Deep-Dive

1. The "Hyperspeed" Core (AVX2 Intrinsics)

At the heart of Tachyon lies a handcrafted AVX2 structural indexer. Unlike traditional state machines, Tachyon uses a 2-pass SIMD approach:

  1. Classification Pass:

    • Loads 32 bytes into YMM registers.
    • Uses a highly optimized PSHUFB (Packed Shuffle Bytes) lookup table to classify characters into Quote, Backslash, and Structural (Commas, Colons, Brackets) in a single step.
  2. Bitmask Generation:

    • _mm256_movemask_epi8 extracts significant bits to form a 32-bit structural mask.
    • A Branchless State Machine manages string parsing (handling escaped quotes) using PCLMUL-style XOR prefix sums.
  3. Lazy Indexing (Zero-Copy):

    • The parser produces a "Bitmask Index" rather than a full DOM tree.
    • Data is accessed via a Cursor that navigates this bitmask.
    • No memory is allocated for JSON nodes until you ask for them (Lazy Materialization).

2. Dual-Engine API

  • Lazy View: json::parse_view(ptr, len) creates a read-only view over the buffer. Accessing j["key"] scans the bitmask at lightning speed (Zero-Copy).
  • Materialized DOM: Accessing j["key"] on a mutable object automatically promotes the view to a standard std::map/std::vector representation (Owned), ensuring ease of use for modification.

🛠 Features

Supported Formats

  • JSON (RFC 8259)
  • JSONC (Comments // and /* */)
  • Binary Placeholders: API stubs for CBOR, MessagePack (throws runtime_error currently).

Modern C++20 API

  • Zero-Boilerplate Reflection:
    struct User { std::string name; int age; };
    TACHYON_DEFINE_TYPE_NON_INTRUSIVE(User, name, age)
    
    // Auto-Serialization
    User u = j.get<User>();
    json j2 = u;
  • Type Safety: strict checks for types, std::variant backend.
  • STL Compatibility: Works with std::string, std::vector, std::map.

📜 License

TACHYON PROPRIETARY SOURCE LICENSE v1.0

Copyright (c) 2026 (BosyjJakub). All Rights Reserved.

  1. No Redistribution: This source code may not be distributed, sub-licensed, or shared without explicit permission.
  2. No Modification: Modification of the core ASM/SIMD algorithms is strictly prohibited to maintain performance integrity.
  3. No Theft: Extraction of ASM kernels or "Look-Up Table" logic for use in other libraries is forbidden.

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.

About

Tachyon JSON v6: The World's Fastest JSON Library. 5.5 GB/s throughput via AVX2 ASM kernels & Lazy Indexing. C++20 header-only, nlohmann-like syntax, 160x faster than standard DOM parsers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •