]> xenbits.xensource.com Git - libvirt.git/commit
qemuxml2argvtest: Cache QAPI schema between tests
authorPeter Krempa <pkrempa@redhat.com>
Fri, 19 Feb 2021 15:19:09 +0000 (16:19 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Sat, 20 Feb 2021 12:27:44 +0000 (13:27 +0100)
commit9995a1af45ef482884e0f76ed70163681562aac1
tree549023fb35510084e0221244ad689aaabf928ece
parent8298a5bd69eaec25626628d5f407374449240033
qemuxml2argvtest: Cache QAPI schema between tests

It's quite wasteful to reparse the QAPI schema for each _CAPS_ test.

Add a simple cache filled lazily by encountered schemas.

The time saving on my box is quite significant:

real 0m3.318s
user 0m3.203s
sys 0m0.107s

vs

real 0m2.223s
user 0m2.134s
sys 0m0.084s

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tests/qemuxml2argvtest.c
tests/testutilsqemu.h