-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterate through positional audio program names only once #5712
Comments
Hi I am Hardik Soni. A Open Source Contributor, Please assign this issue to me. |
Hi, First time commenting. Would a better solution be an observable map? Mumble could attach each plugin in use as a subscriber to the map for the program name it wants. |
That seems pretty much in line with OP's original suggestion, yeah. The key point here is that the iteration over available programs has to be done on Mumble's side while all plugins only tell Mumble what name they are looking for. That way the list of processed only has to be traversed once. Storing the plugin's requests in a map seems conceptually like a good idea that should allow for a reasonable clean implementation of lookups. If performance is of high importance for this, we should consider a flat map in order to make best use of CPU cache (aka: don't use |
I wouldn't bikeshed about the data structure here, the performance difference for the map type would be not measurable if the rest is designed correctly. There actually is a backwards API source-compatible way to implement this:
And again, the data structure to use is not really that relevant, the main performance improvement here is that not every plugin has to iterate through the entire process list. |
Context
Right now Mumble iterates through every program name of every PID for every positional audio plugin. This is quite wasted CPU time if either the PID count is high or plugin count is high, as the time complexity is in$\mathcal{O}(PIDNum \cdot pluginNum )$ .
Example:
mumble/plugins/gtav/gtav.cpp
Line 81 in dd5df45
Description
A better solution would be if each plugin tells Mumble what program name it is looking for, so that only Mumble has to iterate over the PID-list once.
Mumble component
Client
OS-specific?
No
Additional information
This issue originated from #5704 (comment)
The text was updated successfully, but these errors were encountered: