ata-validator 0.4.14 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Ultra-fast JSON Schema validator powered by [simdjson](https://github.com/simdjson/simdjson). Multi-core parallel validation, RE2 regex, codegen bytecode engine. Standard Schema V1 compatible.
4
4
 
5
- **[ata-validator.com](https://ata-validator.com)**
5
+ **[ata-validator.com](https://ata-validator.com)** | **[API Docs](docs/API.md)** | **[Contributing](CONTRIBUTING.md)**
6
6
 
7
7
  ## Performance
8
8
 
@@ -10,13 +10,24 @@ Ultra-fast JSON Schema validator powered by [simdjson](https://github.com/simdjs
10
10
 
11
11
  | Scenario | ata | ajv | |
12
12
  |---|---|---|---|
13
- | **validate(obj)** valid | 25.5M ops/sec | 19.3M ops/sec | **ata 1.3x faster** |
14
- | **validate(obj)** invalid | 17.7M ops/sec | 13.5M ops/sec | **ata 1.3x faster** |
15
- | **isValidObject(obj)** | 39.5M ops/sec | 17.6M ops/sec | **ata 2.2x faster** |
16
- | **Constructor cold start** | 1.28M ops/sec | 812 ops/sec | **ata 1,580x faster** |
17
- | **First validation** | 396K ops/sec | 880 ops/sec | **ata 450x faster** |
13
+ | **validate(obj)** valid | 16.6M ops/sec | 9.8M ops/sec | **ata 1.7x faster** |
14
+ | **validate(obj)** invalid | 10.0M ops/sec | 5.6M ops/sec | **ata 1.8x faster** |
15
+ | **isValidObject(obj)** | 36.0M ops/sec | 9.4M ops/sec | **ata 3.8x faster** |
16
+ | **Schema compilation** | 1.6M ops/sec | 781 ops/sec | **ata 2,067x faster** |
17
+ | **First validation** | 614K ops/sec | 775 ops/sec | **ata 793x faster** |
18
18
 
19
- > validate(obj) numbers are isolated single-schema benchmarks. Multi-schema benchmark overhead reduces throughput; real-world numbers depend on workload.
19
+ > Measured with [mitata](https://github.com/evanwashere/mitata) (process-isolated). Results vary by workload and hardware.
20
+
21
+ ### vs typebox 1.x (with format: 'email')
22
+
23
+ | Scenario | ata | typebox | |
24
+ |---|---|---|---|
25
+ | **isValidObject(obj)** valid | 90.9M ops/sec | 18.2M ops/sec | **ata 5.0x faster** |
26
+ | **isValidObject(obj)** invalid | 435M ops/sec | 169M ops/sec | **ata 2.6x faster** |
27
+ | **Schema compilation** | 2.0M ops/sec | 18.5K ops/sec | **ata 110x faster** |
28
+ | **First validation** | 1.55M ops/sec | 18.2K ops/sec | **ata 85x faster** |
29
+
30
+ > typebox 1.x is JSON Schema compliant with RFC format support. [Benchmark code](benchmark/bench_vs_typebox_esm.mjs)
20
31
 
21
32
  ### Large Data - JS Object Validation
22
33
 
@@ -53,8 +64,8 @@ Ultra-fast JSON Schema validator powered by [simdjson](https://github.com/simdjs
53
64
 
54
65
  ## When to use ata
55
66
 
56
- - **High-throughput `validate(obj)`** - 25.5M ops/sec valid, 17.7M ops/sec invalid
57
- - **Serverless / cold starts** - 1,580x faster constructor, 450x faster first validation
67
+ - **High-throughput `validate(obj)`** - 16.6M ops/sec valid, 10.0M ops/sec invalid
68
+ - **Serverless / cold starts** - 2,067x faster compilation, 793x faster first validation
58
69
  - **Security-sensitive apps** - RE2 regex, immune to ReDoS attacks
59
70
  - **Batch/streaming validation** - NDJSON log processing, data pipelines (2.6x faster)
60
71
  - **Standard Schema V1** - native support for Fastify v5, tRPC, TanStack
@@ -67,7 +78,7 @@ Ultra-fast JSON Schema validator powered by [simdjson](https://github.com/simdjs
67
78
 
68
79
  ## Features
69
80
 
70
- - **Hybrid validator**: 25.5M ops/sec valid, 17.7M ops/sec invalid - codegen + single-pass error collection. No try/catch, no double pass. Schema compilation cache for repeated schemas
81
+ - **Hybrid validator**: 16.6M ops/sec valid, 10.0M ops/sec invalid - codegen + single-pass error collection. No try/catch, no double pass. Schema compilation cache for repeated schemas
71
82
  - **Multi-core**: Parallel validation across all CPU cores - 13.4M validations/sec
72
83
  - **simdjson**: SIMD-accelerated JSON parsing at GB/s speeds, adaptive On Demand for large docs
73
84
  - **RE2 regex**: Linear-time guarantees, immune to ReDoS attacks (2391x faster on pathological input)
@@ -234,6 +245,7 @@ npm run test:suite
234
245
 
235
246
  MIT
236
247
 
237
- ## Author
248
+ ## Authors
238
249
 
239
250
  [Mert Can Altin](https://github.com/mertcanaltin)
251
+ [Daniel Lemire](https://github.com/lemire)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ata-validator",
3
- "version": "0.4.14",
3
+ "version": "0.4.15",
4
4
  "description": "Ultra-fast JSON Schema validator. Beats ajv on every valid-path benchmark: 1.1x–2.7x faster validate(obj), 151x faster compilation, 5.9x faster parallel batch. Speculative validation with V8-optimized JS codegen, simdjson, multi-core. Standard Schema V1 compatible.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -64,8 +64,10 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@sinclair/typebox": "^0.34.49",
67
+ "mitata": "^1.0.34",
67
68
  "node-gyp": "^11.0.0",
68
- "prebuildify": "^6.0.1"
69
+ "prebuildify": "^6.0.1",
70
+ "typebox": "^1.1.7"
69
71
  },
70
72
  "gypfile": true
71
73
  }