qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net
Subject: Re: [PATCH 2/5] qtest/qom-test: Shallow testing of qom-list / qom-get
Date: Mon, 4 Aug 2025 12:38:12 -0400	[thread overview]
Message-ID: <6f9f2dca-9eb9-420f-b170-e3ae0b3adf07@oracle.com> (raw)
In-Reply-To: <20250725135034.2280477-3-armbru@redhat.com>

On 7/25/2025 9:50 AM, Markus Armbruster wrote:
> This test traverses the QOM sub-tree rooted at /machine with a
> combination of qom-list and qom-get.  In my x86_64 testing, it runs
> almost 12000 QMP commands in 34 seconds.  With -m slow, we test more
> machines, and it takes almost 84000 commands in almost four minutes.
> 
> Since commit 3dd93992ffb (tests/qtest/qom-test: unit test for
> qom-list-get), the test traverses this tree a second time, with
> qom-list-get.  In my x86_64 testing, this takes some 200 QMP commands
> and around two seconds, and some 1100 in just under 12s with -m slow.
> 
> Traversing the entire tree is useful, because it exercise the QOM
> property getters.  Traversing it twice not so much.
> 
> Make the qom-list / qom-get test shallow unless -m slow is given:
> don't recurse.  Cuts the number of commands to around 600, and run
> time to under 5s for me.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   tests/qtest/qom-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
> index cb5dbfe329..40bdc3639f 100644
> --- a/tests/qtest/qom-test.c
> +++ b/tests/qtest/qom-test.c
> @@ -180,7 +180,7 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
>           links = g_slist_delete_link(links, links);
>       }
>       while (children) {
> -        test_properties(qts, children->data, true);
> +        test_properties(qts, children->data, g_test_slow());
>           g_free(children->data);
>           children = g_slist_delete_link(children, children);
>       }

Nice optimization.  These tests were annoyingly slow!

Reviewed-by: Steve Sistare <steven.sistare@oracle.com>


  reply	other threads:[~2025-08-04 18:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 13:50 [PATCH 0/5] qtest/qom-test: Leak plug, faster, better coverage Markus Armbruster
2025-07-25 13:50 ` [PATCH 1/5] qtest/qom-test: Plug memory leak with -p Markus Armbruster
2025-08-04 17:11   ` Steven Sistare
2025-08-05  6:54     ` Markus Armbruster
2025-08-05 12:07       ` Steven Sistare
2025-07-25 13:50 ` [PATCH 2/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
2025-08-04 16:38   ` Steven Sistare [this message]
2025-07-25 13:50 ` [PATCH 3/5] qtest/qom-test: Traverse entire QOM tree Markus Armbruster
2025-08-04 16:40   ` Steven Sistare
2025-07-25 13:50 ` [PATCH 4/5] qtest/qom-test: Don't bother to execute QMP command quit Markus Armbruster
2025-08-04 17:10   ` Steven Sistare
2025-08-05  6:06     ` Markus Armbruster
2025-08-05 12:03       ` Steven Sistare
2025-07-25 13:50 ` [PATCH 5/5] MAINTAINERS: Cover tests/qtest/qom-test.c Markus Armbruster
2025-08-04  7:01 ` [PATCH 0/5] qtest/qom-test: Leak plug, faster, better coverage Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f9f2dca-9eb9-420f-b170-e3ae0b3adf07@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).