Skip to content
  • Markus Armbruster's avatar
    0dde9fd1
    qom: Make info qom-tree sort children more efficiently · 0dde9fd1
    Markus Armbruster authored
    
    
    Commit e8c9e658 "qom: Make "info qom-tree" show children sorted"
    sorts children the simple, stupid, quadratic way.  I thought the
    number of children would be small enough for this not to matter.  I
    was wrong: there are outliers with several hundred children, e.g ARM
    machines nuri and smdkc210 each have a node with 513 children.
    
    While n^2 sorting isn't noticeable in normal, human usage even for
    n=513, it can be quite noticeable in certain automated tests.  In
    particular, the sort made device-introspect-test even slower.  Commit
    3e7b80f8 "tests: improve performance of device-introspect-test" just
    fixed that by cutting back its excessive use of "info qom-tree".
    Sorting more efficiently makes sense regardless, so do it.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-6-armbru@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    0dde9fd1
    qom: Make info qom-tree sort children more efficiently
    Markus Armbruster authored
    
    
    Commit e8c9e658 "qom: Make "info qom-tree" show children sorted"
    sorts children the simple, stupid, quadratic way.  I thought the
    number of children would be small enough for this not to matter.  I
    was wrong: there are outliers with several hundred children, e.g ARM
    machines nuri and smdkc210 each have a node with 513 children.
    
    While n^2 sorting isn't noticeable in normal, human usage even for
    n=513, it can be quite noticeable in certain automated tests.  In
    particular, the sort made device-introspect-test even slower.  Commit
    3e7b80f8 "tests: improve performance of device-introspect-test" just
    fixed that by cutting back its excessive use of "info qom-tree".
    Sorting more efficiently makes sense regardless, so do it.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-6-armbru@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Loading