Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QDomDocument vs PugiXML and the internal process loop



  • 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 ?


  • Lifetime Qt Champion

    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 ?



  • 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 ?


  • Lifetime Qt Champion

    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.



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