Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-2019

Improve performance of saving CM handles

XMLWordPrintable

      In NCMP, CM handles are saved using a CpsDataService method called saveListElementsBatch. This method has very poor performance compared to saveListElements.

      Comparing the two methods:

      void saveListElements(String dataspaceName, 
                            String anchorName, 
                            String parentNodeXpath, 
                            String jsonData, 
                            OffsetDateTime observedTimestamp);
      
      void saveListElementsBatch(String dataspaceName, 
                                 String anchorName, 
                                 String parentNodeXpath, 
                                 Collection<String> jsonDataList, 
                                 OffsetDateTime observedTimestamp);
      

      saveListElementsBatch takes a collection of JSON, with one list element in each JSON:

       

      { "list-name": [ "element1": ... ] }
      { "list-name": [ "element2": ... ] }
      { "list-name": [ "element3": ... ] }

      This has extremely poor performance, as the Yang parser is invoked for every item in the collection.

      By comparison, saveListElements supports saving multiple list elements in a single batch, by wrapping the list elements in a single JSON array: 

      { "list-name": [ "element1": ..., "element2": ..., "element3": ... ] }

      This task is to change NCMP to use saveListElements, and remove the not needed saveListElementsBatch code.

            danielhanrahan Daniel Hanrahan
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: