Results 1 to 5 of 5

Thread: Why is QBuffer's close call so slow?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why is QBuffer's close call so slow?

    After further investigation I found out that it is the deletion of "QXmlQuery query" that takes ages. Wysota's tip for moving declations outside the if clause gave me the hint that it could be some destruction (when leaving the if) that is taking such a long time. I moved (byteArray, buffer, sourceDocument and query) declarations to the beging of my method and changed the creation of "QXmlQuery query" to "QXmlQuery* query = new QXmlQuery();". I now see that

    Qt Code:
    1. //Starting to delete query "ROUTE" "ke 8. huhti 09:53:36 2009"
    2. if (query)
    3. delete query;
    4. //Finished deleting query "ROUTE" "ke 8. huhti 09:53:46 2009"
    To copy to clipboard, switch view to plain text mode 

    Any idea why deletion of QXmlQuery takes such a long time.

  2. #2
    Join Date
    Apr 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why is QBuffer's close call so slow?

    I also noticed that it does not help to move the QXmlQuery to class member and pass that to the method as a varaible. This way it would only need to be deleted once after all method calls. Anyway, this is because then QXmlQuery's

    "query->bindVariable("inputDocument", &sourceDocument);"

    will hold on the second method call. Most likely as to documentation "If name has already been bound, its previous binding will be overridden". So it is the realising of something that is slowing it down..

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.