[Interest] QProcess performance issues

Thiago Macieira thiago.macieira at intel.com
Fri May 15 19:16:08 CEST 2015


On Friday 15 May 2015 11:17:24 René J.V. Bertin wrote:
> On Thursday May 14 2015 20:56:33 Thiago Macieira wrote:
> >> Anyway, I can't remember, esp. not what exactly happens in popenEx().
> >> I've
> >> linked to the code, so you can look that up just as easily as I ...
> >
> >I did. You didn't do what is the cause of the problem: the non-blocking
> >part of it.
> 
> OK, I thought you were asking me if I did asynchronous writing ... and I
> tend to associate that with at least perceptually higher performance
> ("feels faster"). Curious that it apparently has the adverse effect here
> ... but I've learned it's best to avoid that kind of sentiment when MS
> Windows is involved ;) 

The problem being that Windows pipes don't support non-blocking API, so 
QProcess has a thread for it.

> Does a typical Unix popen implementation use
> non-blocking writes? If so, there may be a reason Microsoft didn't use it
> in their implementation ...

No, it doesn't. popen from POSIX is blocking.

> So the lesson here would be that if you're going to be piping into (or from)
> an external application through QProcess on MS Windows, you'll want to do
> it from a background thread that acts as a buffer?

QProcess does it for you.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list