Bug 44532 - pa_database_next() is inefficient for the "simple" pa_database implementation
Summary: pa_database_next() is inefficient for the "simple" pa_database implementation
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium minor
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-06 08:23 UTC by Tanu Kaskinen
Modified: 2018-07-30 09:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Tanu Kaskinen 2012-01-06 08:23:54 UTC
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...
Comment 1 GitLab Migration User 2018-07-30 09:39:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/78.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.