Skip to content

Commit

Permalink
to_json benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Jan 15, 2024
1 parent f8ecac2 commit 6214599
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/benchmarks/test_serialization_micro.py
Expand Up @@ -449,3 +449,9 @@ def test_dataclass_serialization_json(benchmark):
dc = Foo(a='hello', b=b'more', c=123, d=1.23)
assert s.to_python(dc) == {'a': 'hello', 'b': b'more', 'c': 123, 'd': 1.23}
benchmark(s.to_json, dc)


@pytest.mark.benchmark(group='dataclass-ser')
def test_dataclass_to_json(benchmark):
dc = Foo(a='hello', b=b'more', c=123, d=1.23)
benchmark(to_json, dc)

0 comments on commit 6214599

Please sign in to comment.