[pulseaudio-tickets] [Bug 44532] New: pa_database_next() is inefficient for the "simple" pa_database implementation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jan 6 08:23:54 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=44532

             Bug #: 44532
           Summary: pa_database_next() is inefficient for the "simple"
                    pa_database implementation
    Classification: Unclassified
           Product: PulseAudio
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: medium
         Component: core
        AssignedTo: pulseaudio-bugs at lists.freedesktop.org
        ReportedBy: tanuk at iki.fi
         QAContact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net


If I want to iterate through a database with pa_database_next(), it will have
O(n*n) time complexity with the "simple" pa_database implementation, because
pa_database_next() will every time search for the next item by iterating the
backing pa_hashmap from the beginning.

I'm not sure what would be the best way to fix this. Maybe the pa_database
iteration interface could be changed to match pa_hashmap_iterate()?

In normal use cases I don't see this inefficiency causing any trouble, because
the databases don't tend to be very big. It's just annoying to have this kind
of stuff in the code...

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the pulseaudio-bugs mailing list