Skip to content

Commit

Permalink
docs: Update benchmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Oct 26, 2024
1 parent c373c9f commit 12d683a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions crates/jsonschema-py/BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ Sources:

| Benchmark | fastjsonschema | jsonschema | jsonschema-rs |
|---------------|----------------|---------------|----------------|
| OpenAPI | - (1) | 682.93 ms (**x95.94**) | 7.12 ms |
| Swagger | - (1) | 1204.99 ms (**x221.35**)| 5.68 ms |
| Canada (GeoJSON) | 11.39 ms (**x4.24**) | 803.60 ms (**x299.57**) | 2.68 ms |
| CITM Catalog | 5.19 ms (**x3.24**) | 85.19 ms (**x53.24**) | 1.65 ms |
| Fast (Valid) | 2.03 µs (**x7.08**) | 37.11 µs (**x129.28**) | 316.60 ns |
| Fast (Invalid)| 2.26 µs (**x3.89**) | 36.31 µs (**x62.37**) | 582.10 ns |
| OpenAPI | - (1) | 640.34 ms (**x87.62**) | 7.31 ms |
| Swagger | - (1) | 1134.76 ms (**x214.34**)| 5.29 ms |
| Canada (GeoJSON) | 10.43 ms (**x4.21**) | 785.21 ms (**x316.82**) | 2.48 ms |
| CITM Catalog | 4.97 ms (**x3.66**) | 82.42 ms (**x60.67**) | 1.36 ms |
| Fast (Valid) | 1.95 µs (**x6.49**) | 35.81 µs (**x119.15**) | 300.55 ns |
| Fast (Invalid)| 2.17 µs (**x4.14**) | 35.83 µs (**x68.31**) | 524.50 ns |

### jsonschema-rs Performance: `validate` vs `is_valid`

| Benchmark | validate | is_valid | Speedup |
|---------------|------------|------------|---------|
| OpenAPI | 7.12 ms | 7.74 ms | **0.92x** |
| Swagger | 5.68 ms | 5.44 ms | **1.04x** |
| Canada (GeoJSON) | 2.68 ms | 2.68 ms | **1.00x** |
| CITM Catalog | 1.65 ms | 1.60 ms | **1.03x** |
| Fast (Valid) | 316.60 ns | 287.05 ns | **1.10x** |
| Fast (Invalid)| 582.10 ns | 630.99 ns | **0.92x** |
| OpenAPI | 7.31 ms | 6.51 ms | **1.12x** |
| Swagger | 5.29 ms | 5.15 ms | **1.03x** |
| Canada (GeoJSON) | 2.48 ms | 2.43 ms | **1.02x** |
| CITM Catalog | 1.36 ms | 1.28 ms | **1.06x** |
| Fast (Valid) | 300.55 ns | 249.95 ns | **1.20x** |
| Fast (Invalid)| 524.50 ns | 561.00 ns | **0.93x** |

Notes:

Expand Down
2 changes: 1 addition & 1 deletion crates/jsonschema-py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jsonschema_rs.Draft202012Validator(invalid_schema, ignore_unknown_formats=False)

`jsonschema-rs` is designed for high performance, outperforming other Python JSON Schema validators in most scenarios:

- Up to **50-390x** faster than `jsonschema` for complex schemas and large instances
- Up to **60-390x** faster than `jsonschema` for complex schemas and large instances
- Generally **3-7x** faster than `fastjsonschema` on CPython

For detailed benchmarks, see our [full performance comparison](https://github.com/Stranger6667/jsonschema/blob/master/crates/jsonschema-py/BENCHMARKS.md).
Expand Down

0 comments on commit 12d683a

Please sign in to comment.