Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Parsing takes too long - How to speed-up???

Parsing takes too long - How to speed-up???

Scheduled Pinned Locked Moved XML / XSL
xmljsonperformancetutorialquestion
2 Posts 2 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rybeck
    wrote on last edited by
    #1

    I have 18000 items and it takes about 10 minutes to parse my xml-file, but only a few seconds if I comment out line 6. What I'm doing wrong? How can speed-up the following? 1. Set oXMLNodeList = oXMLElement.selectNodes("data/item") 2. Put #fTestFile, , "Count: " & oXMLNodeList.Length & vbCrLf 3. For Each oItemY In oXMLNodeList 4. Put #fTestFile, , vbCrLf 5. For Each oItemX In oItemY.childNodes 6. Put #fTestFile, , " ;" & oItemX.nodeTypedValue 7. Next oItemY 8. Next oItemY

    M 1 Reply Last reply
    0
    • R Rybeck

      I have 18000 items and it takes about 10 minutes to parse my xml-file, but only a few seconds if I comment out line 6. What I'm doing wrong? How can speed-up the following? 1. Set oXMLNodeList = oXMLElement.selectNodes("data/item") 2. Put #fTestFile, , "Count: " & oXMLNodeList.Length & vbCrLf 3. For Each oItemY In oXMLNodeList 4. Put #fTestFile, , vbCrLf 5. For Each oItemX In oItemY.childNodes 6. Put #fTestFile, , " ;" & oItemX.nodeTypedValue 7. Next oItemY 8. Next oItemY

      M Offline
      M Offline
      Michael A Barnhart
      wrote on last edited by
      #2

      I do not work with VB so this is somewhat of an outside observation and could be a worthless comment but: I would have added a line 4.5 Set oYList = oItemY.childNodes assuming this is valid in VB. Potentially you may be copying the data over and over, I have seen this impact. Then line 5 would be For Each oItemX in OYList Line 7 should be Next oItemX by commenting out line 6 you are never actually addressing the data. Good ideas are not adopted automatically. They must be driven into practice with courageous patients. -Admiral Rickover. ...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups