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

boost::range::join performance issue #44

Closed
mathbagu opened this issue Mar 11, 2020 · 2 comments
Closed

boost::range::join performance issue #44

mathbagu opened this issue Mar 11, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@mathbagu
Copy link

  • Do you want to request a feature or report a bug?
    Bug

  • What is the current behavior?
    When we iterate over all the buses from the Network bus view, the performance decrease after several voltage levels. Doing a classic for-loop offer acceptable performance.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

// This for-loop is really slow
for (const Bus& bus : network.getBusView().getBuses()) {
    std::cout << bus.getId() << std::endl;
}

// This for-loop is fast
for (const VoltageLevel& vl : network.getVoltageLevels()) {
    for (const Bus& bus : vl.getBusView().getBuses()) {
        std::cout << bus.getId() << std::endl;
    }
}
  • What is the expected behavior?
    Iterate over the buses of the busView efficiently.

  • What is the motivation / use case for changing the behavior?
    Increase the performance.

  • Please tell us about your environment:

    • PowSyBl Version: ...
    • OS Version: ...
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)

(if a question doesn't apply, you can delete it)

@mathbagu mathbagu added the bug Something isn't working label Mar 11, 2020
@mathbagu
Copy link
Author

Maybe the boost::range::join is not adapted to what we need, and we should implement a flatten iterator:
https://stackoverflow.com/questions/44508979/boost-range-adaptor-flattened
https://stackoverflow.com/questions/3623082/flattening-iterator

@mathbagu
Copy link
Author

boostorg/range#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant