Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-426

Performance Issue: Inefficient implementation of readOperationalData method.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • mdsal
    • None
    • Operating System: Windows
      Platform: PC

    • 902

    Description

      I have an ODL controller running with 198 nodes; each node with 104 NodeConnectors.

      My code queries each of the 198 nodes for the nodeConnectors using the following code:

      public static List<NodeConnector> getNodeConnectors(DataProviderService dps, String nodeId) {

      // Create a Type-safe reader so that casting isn't necessary.
      TypeSafeDataReader reader = TypeSafeDataReader.forReader(dps);

      // Create the inventory node Id key:
      NodeId inventoryNodeId = new NodeId(nodeId);
      NodeKey inventoryNodeKey = new NodeKey(inventoryNodeId);

      // Get the child node Id:
      InstanceIdentifierBuilder<Node> nodeChild = InstanceIdentifier.builder(Nodes.class).child(Node.class,
      inventoryNodeKey);
      InstanceIdentifier<Node> nodePath = nodeChild.toInstance();

      // Read the node from the Operational Data store:
      Node node = reader.readOperationalData(nodePath);

      if (node == null)

      { throw new RuntimeException("MD-SAL Node not found for nodeId:" + nodeId); }

      return node.getNodeConnector();
      }

      This takes about 12 seconds to run on a standard Windows desktop.

      An Analysis of the CPU performance using JProfiler shows a very high number of calls to SchemaAwareDataStoreAdapter$MergeFirstLevelReader$2.apply, with the bulk of CPU time spent in this method (specifically Map.equals).

      See attachment for screen snapshot of the JProfiler analysis.

      For any questions, feel free to contact.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            ntraxler@ciena.com Norman Traxler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: