Skip to content

Commit 65a0c69

Browse files
committed
Really basic perf test.
1 parent 8d308da commit 65a0c69

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

perftest

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#! /usr/bin/env python
2+
"""
3+
A *very* basic performance test.
4+
5+
"""
6+
7+
import timeit
8+
9+
from jsonschema import DRAFT_3, validate
10+
11+
12+
instance = schema = DRAFT_3
13+
number = 1000
14+
15+
results = timeit.timeit(
16+
# Validate the Draft 3 meta-schema against itself without meta-validating
17+
stmt="validate(instance, schema, meta_validate=False)",
18+
setup="from __main__ import instance, schema, validate",
19+
number=number,
20+
)
21+
22+
print("Validated %s times. Finished in %s seconds." % (number, results))

0 commit comments

Comments
 (0)