0 Replies Latest reply on Jun 20, 2006 8:41 AM by hgray123

    Flash Xtra 10.1.1 and XML performance

    hgray123
      I have found the performance of Flash XML objects to be drastically worse in the newest Flash Xtra (10.1.1). As an example, I have a large (125k) XML document that is several levels deep. Years ago, I wrote a simple handler to recursively search through XML for a node of a particular name. To test the performance, I fed it a string that I knew was not in the XML - thus making it have to search the entire XML tree.

      With Flash Xtra 10.1, it took around 126ms to search the tree
      With Flash Xtra 10.1.1, it took around 4300ms to search the tree

      That is an amazing degredation in performance. Has anybody else seen this, and is there any kind of workaround? I'll put my search code here if anybody has any ideas (or wants to use it)

      Thanks,
      Hardin


      ---------
      on xmlTreeNodeSearch currentNodeObj, matchNodeString
      -- Searches the entire tree starting at the current node, to find the matching node (by name)
      -- Returns the object of the matching node

      if not(objectP(currentNodeObj)) then return VOID

      if currentNodeObj.nodeName = matchNodeString then return currentNodeObj

      childCount = currentNodeObj.childNodes.length

      repeat with i = 0 to childCount - 1
      nextChild = currentNodeObj.childNodes
      if nextChild.nodeName = matchNodeString then
      return nextChild
      else
      if nextChild.hasChildNodes() then
      searchResult = xmlTreeNodeSearch(nextChild, matchNodeString)
      if not(voidP(searchResult)) then
      return searchResult
      end if
      else
      nothing
      end if
      end if
      end repeat
      return VOID
      end xmlTreeNodeSearch
      ---------