Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDomDocument vs PugiXML and the internal process loop
QtWS25 Last Chance

QDomDocument vs PugiXML and the internal process loop

Scheduled Pinned Locked Moved Solved General and Desktop
qdomdocumentinternal procespugixml
5 Posts 2 Posters 632 Views
  • 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.
  • J Offline
    J Offline
    jonndoe47
    wrote on 22 Apr 2020, 19:01 last edited by
    #1

    Ok, I think I understand things, I'm processing a XML document with pugixml , the document processing. I added a qdialog with a progressbar. The qdialog shows AFTER processing has finished. Now obviously this is because pugixml is not part of the qt architecture. Will using the qdomdocument to process the xml allow this and how fast is it and how flexible is it and easy to pick up, pugi was easy to use. I don't need to show a progress bar as it takes only a few seconds to parse 230k xml with. ???? What's the consensus ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Apr 2020, 19:16 last edited by
      #2

      Hi,

      No, it will be the same. The loading process blocks the event loop hence you see your dialog after it's finished.

      Did you benchmark the time it takes to load your xml file ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • J Offline
        J Offline
        jonndoe47
        wrote on 22 Apr 2020, 19:40 last edited by jonndoe47
        #3

        To load the XML its very quick about 30ms , but to process the xml and loop through the dom tree is about 4 seconds.

        I have yet to add the code to insert into an sqlite db.

        Now the question I have is why does the dialog box appear AFTER the processing has started. I use show before the looping through the dom tree.

        I can understand the progress bar not updating properly.

        Any viewpoints regarding the QDOMDocument processing speed vs PugiXML ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Apr 2020, 20:10 last edited by
          #4

          Because show does not show anything, it schedules with the event loop to make things visible. You are blocking the event loop hence you only see your widget after.

          You'll have to do the benchmarking yourself.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • J Offline
            J Offline
            jonndoe47
            wrote on 22 Apr 2020, 21:44 last edited by
            #5

            Thank you for your help (and for previous answers). Cheers, marking this completed.

            1 Reply Last reply
            0

            5/5

            22 Apr 2020, 21:44

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved