{"id":50776927,"url":"https://github.com/tiw302/cjsonx","last_synced_at":"2026-06-12T00:30:21.598Z","repository":{"id":362183551,"uuid":"1254396369","full_name":"tiw302/cjsonx","owner":"tiw302","description":"High-performance C11 JSON parser with a 16-byte Flat-DOM, SIMD acceleration","archived":false,"fork":false,"pushed_at":"2026-06-10T12:30:16.000Z","size":998,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-10T14:09:01.584Z","etag":null,"topics":["avx2","c","c11","embedded","header-only","high-performance","json","json-parser","memory-efficient","neon","parser","simd","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://tiw302.github.io/cjsonx/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiw302.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T14:08:52.000Z","updated_at":"2026-06-10T12:30:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tiw302/cjsonx","commit_stats":null,"previous_names":["tiw302/cjsonx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tiw302/cjsonx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiw302%2Fcjsonx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiw302%2Fcjsonx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiw302%2Fcjsonx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiw302%2Fcjsonx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiw302","download_url":"https://codeload.github.com/tiw302/cjsonx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiw302%2Fcjsonx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34224103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avx2","c","c11","embedded","header-only","high-performance","json","json-parser","memory-efficient","neon","parser","simd","wasm","webassembly"],"created_at":"2026-06-12T00:30:19.501Z","updated_at":"2026-06-12T00:30:21.181Z","avatar_url":"https://github.com/tiw302.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/tiw302/cjsonx/master/assets/images/logo.png\" width=\"355\" alt=\"cjsonx Logo\"\u003e\n  \u003cbr\u003e\n  \u003cb\u003eExtreme-performance JSON parser for C11/C++ featuring a 16-byte ultra-compact DOM.\u003c/b\u003e\n\u003c/p\u003e\n\n# cjsonx\n\n[![Linux](https://github.com/tiw302/cjsonx/actions/workflows/linux.yml/badge.svg)](https://github.com/tiw302/cjsonx/actions)\n[![macOS](https://github.com/tiw302/cjsonx/actions/workflows/macos.yml/badge.svg)](https://github.com/tiw302/cjsonx/actions)\n[![Windows](https://github.com/tiw302/cjsonx/actions/workflows/windows.yml/badge.svg)](https://github.com/tiw302/cjsonx/actions)\n[![WASM](https://github.com/tiw302/cjsonx/actions/workflows/wasm.yml/badge.svg)](https://github.com/tiw302/cjsonx/actions)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Language](https://img.shields.io/badge/Language-C11-00599C.svg)](https://en.wikipedia.org/wiki/C11_(C_standard_revision))\n[![Header-Only](https://img.shields.io/badge/Library-Header--Only-brightgreen.svg)](#installation)\n[![Dependencies](https://img.shields.io/badge/Dependencies-None-blueviolet.svg)](#introduction)\n\n**[Read the Official Documentation: docs/index.md](https://tiw302.github.io/cjsonx/)**\u003cbr\u003e\n**[Try the Live WebAssembly Demo: https://tiw302.github.io/cjsonx/demo/](https://tiw302.github.io/cjsonx/demo/)**\n\n\u003e **Verified Compatibility — Cross-Platform Passing**\n\n| Architecture | Platform | Verified Backend |\n| :--- | :--- | :--- |\n| **x86_64 (Modern)** | Linux / Windows | **AVX2** (Vectorized) |\n| **ARM64 (Apple)** | macOS (M1/M2/M3) | **NEON** (Vectorized) |\n| **WebAssembly** | Chrome / Node.js | **WASM-SIMD128** |\n| **RISC-V64** | Linux (QEMU) | **Scalar** C11 |\n| **General Desktop** | Linux / Windows | **Scalar** C11 Fallback |\n\n---\n\n## Table of Contents\n\n| Introduction | Setup \u0026 Build | Docs \u0026 Metrics |\n|---|---|---|\n| [Overview](#introduction) | [Requirements](#requirements) | [API Reference](#api-reference) |\n| [Why cjsonx?](#why-cjsonx) | [Toolchains](#verified-toolchains) | [Documentation](#documentation) |\n| [Philosophy](#design-philosophy) | [Installation](#build-and-installation) | [Examples](#examples) |\n| [Limits \u0026 Guarantees](#limits--guarantees) | [AI Methodology](#development-methodology--ai-assistance) | [Benchmarks](#benchmark-results) |\n| [License](#license) | | |\n\n---\n\n## Introduction\n\n**cjsonx** is a header-only C library for parsing JSON. It is designed to achieve high parsing speeds (exceeding 1.0 GB/s on modern hardware) while offering a fully mutable, ultra-compact 16-byte Flat-DOM.\n\nBuilt on top of a highly optimized dual-stage architecture, `cjsonx` validates structural characters using SIMD bitmasks (AVX2/NEON/WASM-SIMD) before applying a recursive descent parsing phase that utilizes the state-of-the-art Eisel-Lemire algorithm for blazing-fast 64-bit IEEE 754 floating-point numerical conversions.\n\n---\n\n## Why cjsonx?\n\nStandard JSON parsers often face specific limitations: they can be slower due to heavy heap allocation per node (using `malloc` recursively), or they consume excessive memory per node (e.g., standard parsers often require 56-64 bytes per node).\n\n`cjsonx` was built to address these specific use cases by providing a fully mutable DOM while drastically reducing memory overhead and maximizing computational throughput:\n\n| Parser | Speed (Large Payload) | DOM Node Size | Allocation Strategy | Portability |\n|---|---|---|---|---|\n| `cJSON` | ~130 MB/s | ~64 bytes | Heavy (O(N) Malloc) | Universal |\n| `jsmn` | ~600 MB/s | Tokenizer Only | None | Universal |\n| `yyjson` | ~1000+ MB/s | 16-24 bytes | Arena | High |\n| **cjsonx** | **~1000+ MB/s** | **16 bytes (Fixed)** | **Flat Arena** | **Universal** |\n\ncjsonx aims to provide an alternative: **delivering high throughput and a fully mutable DOM while maintaining an incredibly dense 16-byte memory footprint.**\n\n---\n\n## Trade-offs \u0026 Alternatives (When NOT to use cjsonx)\n\nWe believe in engineering honesty. `cjsonx` is built for a specific niche and is *not* a silver bullet. You should evaluate alternatives if your requirements match the following:\n\n- **Need the absolute fastest C++ parser?** Use [simdjson](https://github.com/simdjson/simdjson). It runs at 3-6 GB/s and is the industry gold standard for C++ server backends. `cjsonx` is pure C11 and cannot compete with their multi-year optimized C++ engine.\n- **Need a battle-tested, general-purpose C parser?** Use [yyjson](https://github.com/ibireme/yyjson). It is incredibly fast, highly optimized for general use cases, and has a massive community.\n- **Need to drop in a ubiquitous, legacy C parser?** Use [cJSON](https://github.com/DaveGamble/cJSON). It's older and much slower, but it works on ancient C89 compilers and has no modern standard requirements. (Note: `cjsonx` also runs without SIMD on any platform via its Scalar fallback, but requires a C11-compliant compiler).\n\n**So when *should* you use cjsonx?**\n\n1. **High-Performance Mutable Data:** You need a pure C11 parser that allows you to read, edit, add, and remove JSON nodes rapidly, and stringify them back to JSON text without rebuilding the entire document.\n2. **Strict Memory Constraints (IoT/RTOS):** You need high-speed parsing but absolutely **refuse to waste memory**. Our 16-byte nodes use 4x less RAM than traditional parsers like cJSON. Additionally, `cjsonx_parse_with_buffer()` provides a True Zero-Allocation mode for embedded systems.\n3. **WASM Edge Functions (Cloudflare Workers / Fastly):** You need a pure C11 parser that compiles effortlessly to WebAssembly and leverages WASM-SIMD128 for native execution at the edge, without the heavy overhead of C++ engines.\n\n---\n\n## Design Philosophy\n\nThe library is built around three strict constraints:\n\n**Flat Arena DOM.** There are no calls to `malloc` per node. The entire document tree is parsed sequentially into a continuous array of 16-byte structs. This guarantees cache locality and enables O(1) skipping over complex objects and arrays during iteration.\n\n**State-of-the-art Number Parsing.** `cjsonx` incorporates the Eisel-Lemire fast float algorithm directly into its lexical analysis phase. It parses 99.9% of all IEEE 754 floating-point numbers natively using a single fast path, falling back to strict standard library parsing only on extreme mathematical edge cases.\n\n**Zero OS-Dependencies.** The library is built entirely on standard C11. It does not rely on OS-specific file I/O or POSIX headers. It compiles seamlessly to WebAssembly, embedded ARM targets, and standard desktop operating systems.\n\n**True Zero-Allocation Mode.** For strict embedded constraints, the `cjsonx_parse_with_buffer()` API completely bypasses `malloc` by parsing the JSON entirely into a user-provided fixed-size stack buffer or RTOS memory pool.\n\n---\n\n## Limits \u0026 Guarantees\n\nProfessional-grade software requires transparent technical boundaries. Here is exactly what `cjsonx` guarantees, and where it draws the line:\n\n- **RFC 8259 Compliance:** `cjsonx` strictly adheres to RFC 8259 and ECMA-404. It correctly rejects structural anomalies, unescaped control characters, and deeply nested bombs.\n- **Thread Safety:** The core parsing engine is entirely stateless. Multiple threads can safely parse different JSON documents concurrently without any mutexes or locks.\n- **Length Limit:** The maximum byte length of any single string or serialized container is 16MB (specifically, 16,777,215 bytes, due to the 24-bit length field packed in the 16-byte DOM node structure).\n- **Nesting Depth Limit:** The stringification routines enforce a maximum nesting depth limit of 512 (`CJSONX_MAX_DEPTH`) to prevent stack overflow when printing extremely nested JSON.\n- **Builder Performance:** Pushing elements to an array via `cjsonx_array_push` is an O(N) operation because it traverses the list of siblings to locate the end of the array. Repeated sequential pushes to build large arrays will result in O(N^2) complexity.\n\n---\n\n## Requirements\n\n| Component | Requirement |\n|---|---|\n| C Standard | C11 or later |\n| Compiler | GCC 4.9+, Clang 3.5+, MSVC 2019+, Emscripten 3.0+ |\n| Dependencies| None (Standard C Library only) |\n\n---\n\n## Verified Toolchains\n\nThe following toolchains are tested on every commit via GitHub Actions:\n\n| Toolchain | Platform | Backend |\n|---|---|---|\n| GCC | Linux x86_64 | Scalar, AVX2 |\n| GCC (riscv64-linux-gnu) | Linux RISC-V64 (QEMU) | Scalar |\n| Clang | macOS Apple Silicon | NEON |\n| MSVC | Windows x64 | Scalar, AVX2 |\n| Emscripten | WASM (Node.js) | WASM-SIMD, Scalar |\n\n---\n\n## Build and Installation\n\n`cjsonx` is entirely header-only.\n\n### Single-Header Distribution (Recommended)\n\nThe simplest integration is copying the amalgamated `single_include/cjsonx.h` into your project. Define the implementation macro in **exactly one** C file to compile the core functions:\n\n```c\n#define CJSONX_IMPLEMENTATION\n#include \"cjsonx.h\"\n```\n\nAll other translation units should include the header without the macro.\n\n### CMake (System Install)\n\nYou can build the test suites and install the library system-wide:\n\n```bash\ncmake -S . -B build -DCMAKE_BUILD_TYPE=Release\ncmake --build build\nsudo cmake --install build\n```\n\nThen in your project's `CMakeLists.txt`:\n\n```cmake\nfind_package(cjsonx REQUIRED)\ntarget_link_libraries(my_app PRIVATE cjsonx::cjsonx)\n```\n\n---\n\n## API Reference\n\n### Core Parsing\n\n| Function | Signature | Description |\n|---|---|---|\n| `cjsonx_parse` | `cjsonx_doc_t* cjsonx_parse(const char* json, size_t length)` | Parses a JSON string into a managed document tree. Returns `NULL` on fatal memory error. Check `doc-\u003eis_valid` for syntax status. |\n| `cjsonx_parse_ex` | `cjsonx_doc_t* cjsonx_parse_ex(const char* json, size_t length, cjsonx_allocator_t* alloc)` | Parses a JSON string using custom memory allocation hooks. |\n| `cjsonx_parse_with_buffer` | `cjsonx_doc_t* cjsonx_parse_with_buffer(const char* json, size_t length, void* buffer, size_t buffer_size)` | Zero-allocation mode parsing JSON directly into a user-provided buffer. |\n| `cjsonx_doc_free` | `void cjsonx_doc_free(cjsonx_doc_t* doc)` | Frees the entire document arena in a single call. |\n| `cjsonx_error_string` | `const char* cjsonx_error_string(cjsonx_error_t err)` | Translates an error code into a human-readable string. |\n\n### DOM Access\n\n| Function | Signature | Description |\n|---|---|---|\n| `cjsonx_get` | `cjsonx_val_t cjsonx_get(cjsonx_val_t obj, const char* key)` | Retrieves a child node from an Object by its exact string key. |\n| `cjsonx_get_index` | `cjsonx_val_t cjsonx_get_index(cjsonx_val_t arr, size_t index)` | Retrieves a child node from an Array by its index. |\n| `cjsonx_get_type` | `cjsonx_type_t cjsonx_get_type(cjsonx_val_t val)` | Returns the type of the node (`CJSONX_STRING`, `CJSONX_NUMBER`, etc.). |\n| `cjsonx_num` | `double cjsonx_num(cjsonx_val_t val)` | Retrieves the numerical value as a float. |\n| `cjsonx_int` | `int64_t cjsonx_int(cjsonx_val_t val)` | Retrieves the numerical value as a 64-bit integer. |\n| `cjsonx_str` | `const char* cjsonx_str(cjsonx_val_t val)` | Retrieves the string pointer. Note: strings may not be null-terminated if they are zero-copy references. |\n| `cjsonx_str_len` | `size_t cjsonx_str_len(cjsonx_val_t val)` | Returns the exact length of the string. |\n| `cjsonx_size` | `size_t cjsonx_size(cjsonx_val_t val)` | Returns the element count of an Array or Object. |\n| `cjsonx_bool` | `bool cjsonx_bool(cjsonx_val_t val)` | Retrieves the boolean value. |\n| `cjsonx_is_null` | `bool cjsonx_is_null(cjsonx_val_t val)` | Returns `true` if the node is explicitly a JSON `null` or is empty/invalid. |\n| `cjsonx_pointer_get` | `cjsonx_val_t cjsonx_pointer_get(cjsonx_val_t root, const char* path)` | Retrieves a node using a RFC 6901 JSON Pointer path. |\n\n### Iteration\n\n| Function | Signature | Description |\n|---|---|---|\n| `cjsonx_iter_init` | `cjsonx_iter_t cjsonx_iter_init(cjsonx_val_t val)` | Initializes a lightweight iterator for an Array or Object. |\n| `cjsonx_iter_next` | `bool cjsonx_iter_next(cjsonx_iter_t* iter)` | Advances the iterator to the next element or key-value pair. |\n\n### Mutation \u0026 Builder API\n\n| Function | Signature | Description |\n|---|---|---|\n| `cjsonx_create_null` | `cjsonx_val_t cjsonx_create_null(cjsonx_doc_t* doc)` | Creates a `null` node. |\n| `cjsonx_create_bool` | `cjsonx_val_t cjsonx_create_bool(cjsonx_doc_t* doc, bool val)` | Creates a boolean node. |\n| `cjsonx_create_number` | `cjsonx_val_t cjsonx_create_number(cjsonx_doc_t* doc, double val)` | Creates a number node. |\n| `cjsonx_create_string` | `cjsonx_val_t cjsonx_create_string(cjsonx_doc_t* doc, const char* str)` | Creates a string node (copies string to arena). |\n| `cjsonx_create_object` | `cjsonx_val_t cjsonx_create_object(cjsonx_doc_t* doc)` | Creates an empty Object node. |\n| `cjsonx_create_array` | `cjsonx_val_t cjsonx_create_array(cjsonx_doc_t* doc)` | Creates an empty Array node. |\n| `cjsonx_object_set` | `bool cjsonx_object_set(cjsonx_val_t obj, const char* key, cjsonx_val_t val)` | Inserts or overwrites a key-value pair in an Object. |\n| `cjsonx_array_push` | `bool cjsonx_array_push(cjsonx_val_t arr, cjsonx_val_t val)` | Appends a value to an Array. |\n| `cjsonx_object_remove` | `bool cjsonx_object_remove(cjsonx_val_t obj, const char* key)` | Removes a key-value pair from an Object. |\n| `cjsonx_array_remove` | `bool cjsonx_array_remove(cjsonx_val_t arr, size_t index)` | Removes a value at the given index from an Array. |\n| `cjsonx_clone_val` | `cjsonx_val_t cjsonx_clone_val(cjsonx_doc_t* dest_doc, cjsonx_val_t src_val)` | Recursively clones a value node and its children into another document arena. |\n| `cjsonx_merge_patch` | `cjsonx_val_t cjsonx_merge_patch(cjsonx_val_t target, cjsonx_val_t patch)` | Applies an RFC 7396 JSON Merge Patch to a target node. |\n| `cjsonx_stringify` | `char* cjsonx_stringify(cjsonx_doc_t* doc)` | Converts document to minified JSON string (malloc'd). |\n| `cjsonx_stringify_format` | `char* cjsonx_stringify_format(cjsonx_doc_t* doc, int indent)` | Converts document to pretty JSON string with indent spaces. |\n\n### File I/O Utilities\n\n| Function | Signature | Description |\n|---|---|---|\n| `cjsonx_read_file` | `cjsonx_doc_t* cjsonx_read_file(const char* path)` | Reads and parses a JSON file. |\n| `cjsonx_read_file_ex` | `cjsonx_doc_t* cjsonx_read_file_ex(const char* path, cjsonx_allocator_t* alloc)` | Reads and parses a JSON file using a custom allocator. |\n| `cjsonx_write_file` | `bool cjsonx_write_file(const char* path, cjsonx_doc_t* doc)` | Serializes a document to a file (minified). |\n| `cjsonx_write_file_format` | `bool cjsonx_write_file_format(const char* path, cjsonx_doc_t* doc, int indent)` | Serializes a document to a file (pretty printed). |\n\n---\n\n## Documentation\n\nCheck out the `docs/` directory for deep-dives into the architecture and API:\n\n- [The cjsonx Algorithm](docs/algorithm.md): Detailed explanation of the 2-stage SIMD scanning and Eisel-Lemire numerical parsing engine.\n- [API Reference](docs/api_reference.md): Complete guide to all functions, structures, and memory safety guarantees.\n\n## Examples\n\nRunnable examples are provided in the `examples/` directory.\n\n**`dom_access.c`**\nDemonstrates basic file loading, parsing, and retrieving keys from the root object.\n\n```c\n#define CJSONX_IMPLEMENTATION\n#include \"cjsonx.h\"\n#include \u003cstdio.h\u003e\n#include \u003cstring.h\u003e\n\nint main() {\n    const char* json = \"{\\\"name\\\": \\\"cjsonx\\\", \\\"speed\\\": \\\"insane\\\"}\";\n\n    cjsonx_doc_t* doc = cjsonx_parse(json, strlen(json));\n    if (doc \u0026\u0026 doc-\u003eis_valid) {\n        cjsonx_val_t name = cjsonx_get(doc-\u003eroot, \"name\");\n        if (cjsonx_get_type(name) == CJSONX_STRING) {\n            printf(\"Parsed name: %.*s\\n\", (int)cjsonx_str_len(name), cjsonx_str(name));\n        }\n        cjsonx_doc_free(doc);\n    }\n    return 0;\n}\n```\n\n**`error_handling.c`**\nDemonstrates extracting byte offsets and exact error messages when parsing malformed JSON payloads.\n\n---\n\n## Benchmark Results\n\nBenchmarks were executed on a modern x86_64 CPU (GCC -O3 -march=native). We track **Parse Speed**, **Stringify Speed**, and the **Peak Memory** (Maximum RAM allocated during the parse operation).\n\n\u003e **Note on Memory**: `cjsonx` uses a Flat DOM approach with exactly 16 bytes per node. By optimizing initial node allocation capacity and performing a shrink-to-fit step at the end of parsing, `cjsonx` now achieves the lowest peak memory usage among tested libraries while maintaining high parsing throughput.\n\n### 1. `twitter.json` (0.60 MB)\n\n| Library | Parse (MB/s) | Stringify (MB/s) | Peak Mem (MB) |\n|---------|--------------|------------------|---------------|\n| **cjsonx** | 514.35 | 1929.13 | **0.92** |\n| yyjson | **1026.59** | **4890.89** | 1.20 |\n| cJSON | 408.14 | 636.55 | 1.23 |\n\n### 2. `citm_catalog.json` (1.65 MB)\n\n| Library | Parse (MB/s) | Stringify (MB/s) | Peak Mem (MB) |\n|---------|--------------|------------------|---------------|\n| **cjsonx** | **898.58** | 2233.71 | **2.07** |\n| yyjson | 810.77 | **6899.93** | 3.29 |\n| cJSON | 274.59 | 773.56 | 2.57 |\n\n### 3. `canada.json` (2.15 MB) - Heavy Floating-Point Arrays\n\n| Library | Parse (MB/s) | Stringify (MB/s) | Peak Mem (MB) |\n|---------|--------------|------------------|---------------|\n| **cjsonx** | 346.86 | 273.80 | **4.70** |\n| yyjson | **820.91** | **712.29** | 7.87 |\n| cJSON | 73.08 | 26.46 | 10.20 |\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eView raw console output from bench_compare\u003c/b\u003e\u003c/summary\u003e\n\n```console\ntiw@tiw-CachyOS ~/Public/cjsonx (master)\n❯./build/bench_compare benchmarks/datasets/citm_catalog.json \u0026\u0026 ./build/bench_compare benchmarks/datasets/twitter.json \u0026\u0026 ./build/bench_compare benchmarks/datasets/canada.json\n\nDataset: benchmarks/datasets/citm_catalog.json (1.65 MB)\n========================================================================\nLibrary    | Parse (MB/s)    | Stringify (MB/s) | Peak Mem (MB)\n-----------|-----------------|------------------|-----------------------\ncjsonx     | 898.58          | 2233.71         | 2.07\nyyjson     | 810.77          | 6899.93         | 3.29\ncJSON      | 274.59          | 773.56          | 2.57\n========================================================================\n\nDataset: benchmarks/datasets/twitter.json (0.60 MB)\n========================================================================\nLibrary    | Parse (MB/s)    | Stringify (MB/s) | Peak Mem (MB)\n-----------|-----------------|------------------|-----------------------\ncjsonx     | 514.35          | 1929.13         | 0.92\nyyjson     | 1026.59         | 4890.89         | 1.20\ncJSON      | 408.14          | 636.55          | 1.23\n========================================================================\n\nDataset: benchmarks/datasets/canada.json (2.15 MB)\n========================================================================\nLibrary    | Parse (MB/s)    | Stringify (MB/s) | Peak Mem (MB)\n-----------|-----------------|------------------|-----------------------\ncjsonx     | 346.86          | 273.80          | 4.70\nyyjson     | 820.91          | 712.29          | 7.87\ncJSON      | 73.08           | 26.46           | 10.20\n========================================================================\n\ntiw@tiw-CachyOS ~/Public/cjsonx (master)\n❯\n```\n\n\u003c/details\u003e\n\n### Analysis\n\n`cjsonx` demonstrates significant parsing throughput on large payloads, measuring up to ~898 MB/s on `citm_catalog.json`. This provides a performance profile comparable to, and often exceeding, modern parsers like `yyjson` during tree construction, while dramatically outperforming legacy standards like `cJSON` in computational speed and maintaining the lowest peak memory overhead.\n\n---\n\n## Development Methodology \u0026 AI Assistance\n\nBuilding a memory-safe, SIMD-accelerated C parser from scratch involves handling incredibly complex edge cases—from vectorized bit-masking to IEEE 754 catastrophic cancellation bounds.\n\nTo achieve this level of stability and performance within a short timeframe, this project was architected and rigorously verified in collaboration with **Advanced Agentic AI**. AI was specifically utilized to:\n\n- Stress-test the Eisel-Lemire numerical engine against extreme floating-point edge cases and LibFuzzer.\n- Assist in planning the memory layout and cache-locality of the 16-byte arena DOM.\n- Automate the generation of robust cross-platform CI/CD pipelines (Linux, macOS, Windows, WASM).\n\nHowever, **human agency remains at the core of this project**. Every single line of code generated or suggested was manually inspected, audited, and strictly verified. The core architecture, algorithms, and memory design were meticulously human-planned. This hybrid approach—combining human architectural vision with AI-driven debugging and verification—allowed us to push the boundaries of performance and reliability in a modern C library without compromising security or code ownership.\n\n---\n\n## Author's Note\n\nI'm just a kid building projects as a hobby. Thank you for showing interest in my little library! It really means a lot to me. :)\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiw302%2Fcjsonx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiw302%2Fcjsonx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiw302%2Fcjsonx/lists"}