Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-16 Thread Christopher Faylor
On Wed, Nov 15, 2006 at 10:17:59PM -0500, Charles Wilson wrote: >Christopher Faylor wrote: > >>Fully implementing posix_spawn is quite a bit of work although I did >>tell Linus Torvalds that I'd look into implementing it in Cygwin >>eventually (it would make git-on-cygwin faster). >> >>I have a pat

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-16 Thread Loic Grenie
Eric Blake byu.net> writes: > Loic Grenie matapp.unimib.it> writes: > >> That intermediate sh invocation can probably be slightly streamlined >> by doing something similar to >> >> sprintf(cmd, "(%s) >&%d %d>&- %d>&-", program, pdes[1], pdes[0], pdes[1]); >> pid = spawnl(_P_NOWAIT, _PATH_B

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Charles Wilson
Christopher Faylor wrote: Fully implementing posix_spawn is quite a bit of work although I did tell Linus Torvalds that I'd look into implementing it in Cygwin eventually (it would make git-on-cygwin faster). I have a patch in my sandbox which implements a more lightweight approach for popen us

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Eric Blake
Loic Grenie matapp.unimib.it> writes: > That intermediate sh invocation can probably be slightly streamlined > by doing something similar to > > sprintf(cmd, "(%s) >&%d %d>&- %d>&-", program, pdes[1], pdes[0], pdes[1]); > pid = spawnl(_P_NOWAIT, _PATH_BSHELL, "sh", "-c", cmd, NULL); Nope.

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Loic Grenie
Eric Blake byu.net> writes: > Eric Blake byu.net> writes: > > > > else > > > sprintf(cmd, "sh -c '%s' %d>&-", program, pdes[1]) > > > } > > > pid = spawnl(_P_NOWAIT, _PATH_BSHELL, "sh", "-c", cmd, NULL); > > > > Why are you going through two levels of sh? That seems like a waste t

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Larry Hall (Cygwin)
Linda Walsh wrote: Loic Grenie wrote: On Tue Nov 14 15:53:36 2006, Eric Blake ([EMAIL PROTECTED] ) wrote: And admitting that your changes are untested is not a good sign for getting it approved. I'm not really "admitting", I am just expliciting that the patch is untested. I do

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Christopher Faylor
On Wed, Nov 15, 2006 at 04:18:10PM +, Eric Blake wrote: >Eric Blake byu.net> writes: >>> else >>> sprintf(cmd, "sh -c '%s' %d>&-", program, pdes[1]) >>> } >>> pid = spawnl(_P_NOWAIT, _PATH_BSHELL, "sh", "-c", cmd, NULL); >> >Why are you going through two levels of sh? That seems

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-15 Thread Eric Blake
Eric Blake byu.net> writes: > > else > > sprintf(cmd, "sh -c '%s' %d>&-", program, pdes[1]) > > } > > pid = spawnl(_P_NOWAIT, _PATH_BSHELL, "sh", "-c", cmd, NULL); > > Why are you going through two levels of sh? That seems like a waste to > me; the whole idea of using spawn is to

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-14 Thread Linda Walsh
I tried your program as is: ~/test> cygthrash 0.000 Before std 0.781 After std 0.828 Result: Tue Nov 14 20:51:52 PST 2006 0.828 After close std 0.000 Before new 0.015 After new 0.062 Result: Tue Nov 14 20:51:52 PST 2006 0.062 After close new 0.000 Before std 0.766 After std 0.797 Resul

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-14 Thread Loic Grenie
On Tue Nov 14 15:53:36 2006, Eric Blake ([EMAIL PROTECTED] ) wrote: > According to Loic Grenie on 11/14/2006 4:12 AM: >>The subjects says it all: when a process has a large memory space, >> a popen() triggers a long disk thrashing. The result can clearly be >> seen iwth the allegated cygtha

Re: Excessive thrashing when popen()ing after a large malloc()

2006-11-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Loic Grenie on 11/14/2006 4:12 AM: >The subjects says it all: when a process has a large memory space, > a popen() triggers a long disk thrashing. The result can clearly be > seen iwth the allegated cygtharsh program (running with

Excessive thrashing when popen()ing after a large malloc()

2006-11-14 Thread Loic Grenie
The subjects says it all: when a process has a large memory space, a popen() triggers a long disk thrashing. The result can clearly be seen iwth the allegated cygtharsh program (running with 1GB of memory, change the size of the malloc to roughly half your memory size): % ./cygthrash 0.