Skip to content
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

[RFC] Insert right objects before the left ones #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bgoglin
Copy link
Contributor

@bgoglin bgoglin commented Mar 8, 2016

Not really useful as long as we don't have hundreds of children within a single object. The quadratic complexity is negligible on current machines since we usually have tens of children max. Mostly useful for large synthetic topologies so far.

Check whether the first commit in the PR decreases performance before merging.

Otherwise just keep that code here until machines really need that sort of optimization. The Linux backend will need a reverse foreach loop.

…ss remaining siblings

When we found where we should be inserted, we have to look at next sibling
in case they should become children.
No need to go till the last children: Once the first cpuset bit of a children
is above out last, we're done.

Mostly useful when inserting in reverse-cpuset-order.
…creation time

The core inserts new objects within children by walking the existing children
list from left to right. So insert the left children last is more efficient
since it doesn't walk the entire list anymore.
Otherwise, the overall complexity is quadratic with the number of children
below objects.

lstopo -i "pu:10000" goes down from 20s to 0.8s on my laptop.
lstopo -i "100 100" is only improved by 1-2%.
On real/existing platforms (KNL or 768pu-AltixUV), the impact seems negligible.
@bgoglin bgoglin changed the title Insert right objects before the left ones [RFC] Insert right objects before the left ones Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant