]> granicus.if.org Git - json-c/commit
tests: add test_deep_copy test
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Fri, 16 Jun 2017 07:50:49 +0000 (10:50 +0300)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 27 Nov 2017 14:17:48 +0000 (16:17 +0200)
commit1eab22f0da9054bac02fbe9d90499a3ee5e8e5b2
tree695b783d72cbe3289f44435c2493e583da552631
parentbf80d5ad0ed3b34c54d6fce47edb16ed704f47bc
tests: add test_deep_copy test

Seems to perform better than outputting to string
and re-parsing it.

BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 20 seconds
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 7 seconds

It should make a difference on embedded systems.
The test was performed on a i5 desktop CPU [~3.5 years of age].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
.gitignore
tests/Makefile.am
tests/test_deep_copy.c [new file with mode: 0644]
tests/test_deep_copy.expected [new file with mode: 0644]
tests/test_deep_copy.test [new symlink]