Skip to content

add jsonc benchmark suite#211

Merged
cs01 merged 1 commit intomainfrom
feat/jsonc-benchmark
Mar 11, 2026
Merged

add jsonc benchmark suite#211
cs01 merged 1 commit intomainfrom
feat/jsonc-benchmark

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • Adds benchmark implementations of the JSONC parser in C, Go, Node.js, and Bun for performance comparison against the ChadScript native binary
  • All parsers produce identical output (verified via MD5)

Benchmark results (834KB JSONC, 5000 objects)

Parser Time vs C
C (clang -O2) 2.1ms 1.0x
Go 3.6ms 1.7x
Node.js 32.8ms 15x
ChadScript (native) 143ms 67x

The ChadScript gap is primarily due to charAt() allocating a GC buffer per character (~800K allocations for this input). The existing LLVM IR string builder already provides 2x speedup over naive concat. Further improvement requires optimizing charAt or adding substring/slice support.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cs01 cs01 merged commit 9e5a0a1 into main Mar 11, 2026
11 of 12 checks passed
@cs01 cs01 deleted the feat/jsonc-benchmark branch March 11, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant