Skip to content

Commit 13b2e17

Browse files
committed
docs(README): add benchmarks section
1 parent 5d2836b commit 13b2e17

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
The compiler is used to convert an array of schema nodes to a function with imperative JavaScript code that can be executed to validate a data object. The compiler operates at the low-level and does not offer any JavaScript API for creating the schema (see vinejs for user-land APIs).
66

7+
## Benchmarks
8+
Ajv performs better in some instances because Ajv holds a reference to the input data object and does not create a new output object. Though Ajv behavior results in slightly better performance, it comes at the cost of sharing the same pointers between the input and output objects, and hence mutating one will mutate the other as well.
9+
10+
![](./vine_benchmarks.png)
11+
712
## Schema
813

914
Schema refers to an object or an array of objects that the compiler takes as an input to generate JavaScript output. Following is an example of an `object` schema node with `username` property.

vine_benchmarks.png

550 KB
Loading

0 commit comments

Comments
 (0)