Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryoppippi/json-schema-benchmark

JSON Schema Generation Benchmark
https://github.com/ryoppippi/json-schema-benchmark

bun json-schema tschema typebox typescript typia zod

Last synced: 17 days ago
JSON representation

JSON Schema Generation Benchmark

Awesome Lists containing this project

README

        

# json-schema-benchmark

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

## Result

```sh
~/g/g/r/JSON-Schema-Benchmark main• ❱ bun run index.ts
platform: Darwin 23.5.0 arm64 arm
bun version: 1.1.21+70ca2b76c
benchmark start
┌───┬───────────────────┬────────────┬────────────────────┬────────┬──────────┐
│ │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │
├───┼───────────────────┼────────────┼────────────────────┼────────┼──────────┤
│ 0 │ typia │ 32,816,961 │ 30.4720474430912 │ ±1.79% │ 32816962 │
│ 1 │ tschema │ 3,475,386 │ 287.73780848206604 │ ±1.20% │ 3475387 │
│ 2 │ @sinclair/typebox │ 2,689,724 │ 371.7852713569184 │ ±0.98% │ 2689725 │
│ 3 │ zod │ 71,656 │ 13955.375169085659 │ ±1.52% │ 71709 │
└───┴───────────────────┴────────────┴────────────────────┴────────┴──────────┘
```

## Related

This benchmark code is based on
[lukeed/tschema](https://github.com/lukeed/tschema)

## Related my projects

- [unplugin-typia](https://github.com/ryoppippi/unplugin-typia)
- [openai with typia](https://github.com/ryoppippi/openai-with-typia)

## License

[MIT](./LICENSE)