← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1943639] Re: project/instances/attach_interface has O(N) scaling time complexity for opening form

 

Reviewed:  https://review.opendev.org/c/openstack/horizon/+/809230
Committed: https://opendev.org/openstack/horizon/commit/9f5d659d160d24d359992dda22fecb0db6b6f805
Submitter: "Zuul (22348)"
Branch:    master

commit 9f5d659d160d24d359992dda22fecb0db6b6f805
Author: Nicolas Bock <nicolas.bock@xxxxxxxxxxxxx>
Date:   Wed Sep 15 09:39:31 2021 -0600

    Get ports directly instead of via loop
    
    In order to get a list of available ports, the current implementation
    of the form code in `project/instances/attach_interface` loops through
    the available networks in the project and requests a list of ports for
    each via the Neutron API. This implementation is O(N) in time with a
    large prefactor (the time for a Neutron API call) where N is the
    number of networks.
    
    Instead of calling the Neutron API for each network this change uses
    one call to the Neutron API to get the list of ports on all networks
    and filters this list via a list comprehension. While this
    implementation is still O(N) the prefactor is significantly smaller.
    
    Closes-Bug: #1943639
    Change-Id: I8fd32c3aad22d8ef7f57201f5144f6b2e357ef10
    Signed-off-by: Nicolas Bock <nicolas.bock@xxxxxxxxxxxxx>


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1943639

Title:
  project/instances/attach_interface has O(N) scaling time complexity
  for opening form

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The time complexity of opening the project/instances/attach_interface
  form box is O(N) where N is the number of networks in the project.
  This is due to

  https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/dashboards/project/instances/utils.py#L210

  Which loops over the networks and requests the ports associated with
  the network. For large projects this scaling behavior can become
  prohibitive.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1943639/+subscriptions



References