Results 1 to 3 of 3

Thread: QProcess extremely slow on Windows?

  1. #1
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question QProcess extremely slow on Windows?

    I'm using a QProcess to call an external application. I also have to read and parse the output of that program.

    The problem is that when the external program outputs a lot of messages (several lines per second), the external program slows down (the external program is a media player, so this is unacceptable).

    Maybe my application is not fast enough to process the output and the QProcess buffer fills.

    I thought on optimize the function that parses the lines, but the problem is that even not doing nothing, just reading the buffer with readStdout, just that, it already produces the slow down. So it seems that the bottleneck is in QProcess.

    This only happens on Windows, tested with Qt 4.2.2 and 4.2.3. On linux it doesn't happen at all (tested with Qt 3.3 and 4.2.3).

    To maintain compatibility with Qt 3 I'm using a Q3Process but I tried to convert the code to use a Qt4 QProcess and the result is the same (or even worse).

    I don't know how to fix this important problem.

    Is there any way to tell QProcess to use a bigger buffer, maybe?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QProcess extremely slow on Windows?

    You can try to increase the buffer in a platform dependent way (it's a system buffer) in QProcess::setupChildProcess(). But you might just try reading the data faster. How did you organise the reading process?

  3. #3
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess extremely slow on Windows?

    I've just simply connect the readyReadStdout and readyReadStderr signals to a function which read the data with readStdout(), and then processes it.

    But as I said, just simply calling readStdout() (even without storing the result) makes the external process to slow down.

    In Qt 4, it's similar, I connect the readyReadStandardOutput signal and read the data with readAllStandardOutput().

Similar Threads

  1. need help for QProcess under windows
    By patcito in forum Qt Programming
    Replies: 4
    Last Post: 26th May 2006, 20:54
  2. QTextEdit extremely slow with links
    By elahav in forum Qt Programming
    Replies: 2
    Last Post: 25th May 2006, 19:00
  3. QProcess +standard error + windows
    By antonio.r.tome in forum Qt Programming
    Replies: 0
    Last Post: 18th April 2006, 15:58
  4. Qprocess never end in MS windows
    By antonio.r.tome in forum Qt Programming
    Replies: 12
    Last Post: 23rd February 2006, 13:35
  5. QProcess problem with windows batch file
    By bood in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 09:08

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.