title: I am using Interop.TDAPIOLELib.dll for QC ALM Integration But taking too much time for getting All Test Plan Tree Structure
body: <p>I am using <strong>Interop.TDAPIOLELib.dll</strong> for <strong>QC ALM 12</strong> Integration and installed QcConnector.exe from tool link from QC ALM 12 on my 32 bit window machine.</p>
  
  <p>I want to fetch all TestPlan with parent folder hierarchy . But its take too much time around <strong>75 artifact of QC ALM</strong> (included Test Plan and Folder) taking <strong>1 minute 50 seconds</strong>.</p>
  
  <pre><code>  Private Sub LoadQCTree()
  
      Dim rootNode As Object = Nothing
  
      _treeManager = CType(_qcConnection.TreeManager, TreeManager)
  
      Dim rootList As TDAPIOLELib.List = _treeManager.RootList
  
      Dim rNode = rootList.Item(1)
  
      rootNode = _treeManager.TreeRoot(rNode)
  
      Dim FolderList As List = rootNode.NewList()
  
      'Read sub node hierarchy...
  
      RecurseTree(CType(FolderList, List))
  
      ReadChildTestCases(rootNode)
  
   End Sub
  
  
    Private Sub RecurseTree(ByVal SubNodes As TDAPIOLELib.List)
  
      For Each itm As SysTreeNode In SubNodes
          Dim Description = CStr(itm.Description).Trim
          If Not Description = "" Then Description = ConvertPlain(Description).Trim
          AddNodeEntry(itm.Name, CStr(itm.NodeID), CStr(itm.Father.NodeID), "Folder", Description, Now, Now, "TestCase", "folder")
  
          Dim children = itm.NewList
          RecurseTree(CType(children, List))
          ReadChildTestCases(itm)
  
      Next
  
    End Sub
  
    Private Sub ReadChildTestCases(ByVal itm As SysTreeNode)
  
      Dim testFilter As TDFilter = CType(_testFactory.Filter, TDFilter)
  
      testFilter.Filter("TS_SUBJECT") = Chr(34) &amp; itm.Path &amp; Chr(34)
  
  
      Dim TestList As List = _testFactory.NewList(testFilter.Text)
  
      For Each test As Test In TestList
          Try
              Dim description As String = Convert.ToString(test.Field("TS_DESCRIPTION")).Trim
              If Not description = "" Then description = ConvertPlain(description).Trim
              Dim modifiedOn As Date = CDate(test.Field("TS_VTS"))
              Dim CreationDate As Date = CDate(test.Field("TS_CREATION_DATE"))
              modifiedOn = Date.SpecifyKind(modifiedOn, DateTimeKind.Local)
              CreationDate = Date.SpecifyKind(CreationDate, DateTimeKind.Local)
  
              Dim BaseId = test.Field("TS_BASE_TEST_ID")
              Dim type = test.Field("TS_TYPE")
              AddNodeEntry(test.Name, CStr(test.ID), CStr(itm.NodeID), "File", description, modifiedOn, CreationDate, "TestCase", type)
          Catch ex As Exception
              'Do nothing..
              'Current node will skip from the tree hierarchy
  
          End Try
      Next
    End Sub
  </code></pre>
  
  <p>And also want to Fetch Requirements with folder hierarchy but its also taking to much time.</p>
  
  <p>So , I'll try to improve performance using thread .</p>
  
  <p>Thread 1 :  Load all Test Plan</p>
  
  <p>Thread 2 :  Load all Requirement</p>
  
  <p>and run parallel but i think is not supported parallel request. Because when i fetch requirement it takes <strong>40 second (for 30 requirements)</strong> but fetch both parallel taking <strong>1 minute 15 second</strong> for only requirements .</p>
  
  <p>Please Help me to find out the way to how improve performance .</p>
  
  <p>It is possible to get all test plan tree structure in one call. </p>
  
  <p>Thanks    </p>