<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'> I ran some mostly scientific measures of Cygwin. <BR> On one machine, no reboots, one OS, one set of files.<BR> x86, single proc, Windows 2000 (I'll go back to XP soon). <BR> It shows that..well, at least that wrapping Cygwin processes with sh is VERY expensive. <BR> Like, the data isn't yet complete, but this could cut building Cygwin libm3 <BR> from around 100 seconds to around 20 seconds. Not counting the Modula-3 front end time. <BR> Just cm3cg+as.<BR>
<BR> cd libm3\NT386GNU <BR> having already built successfully, all the *.ic *.mc files are present <BR>
<BR>
<BR> cm3cg not wrapped with sh (F1) <BR> Repeated runs. <BR> 28 seconds (other stuff running on machine) <BR> 16 seconds <BR> 13 seconds (13.?) <BR> 13.8 seconds <BR> 14.01 seconds <BR> 13.3 seconds <BR> now add the -o flag <BR> 13.64 seconds <BR> 14.07 seconds <BR> now without echoing <BR> 13.22 seconds <BR> 13.18 seconds <BR>
<BR>
<BR> cm3cg wrapped with sh (F2) <BR> 51 seconds <BR> 51.35 seconds <BR> 51.19 seconds <BR> 50.88 seconds <BR> now add the -o flag <BR> 51.76 seconds <BR> now without echoing <BR> 51.05 seconds <BR>
These runs did NOT have -o flags, but subsequent runs with -o were about the same. <BR> I added -o so I could run the as variations. <BR>
now the same with .s <BR> note that due to the way the above worked, I just have *.s files, and <BR> not the usual *.is and *.ms <BR>
<BR>
<BR> as not wrapped with sh (F3) <BR> 5.6 seconds <BR> 5.28 seconds <BR> now remove echo <BR> 5.08 seconds <BR> 5.08 seconds <BR> 5.04 seconds <BR> forgot -o flag, oh well, enough data <BR>
as wrapped with sh (F4) <BR> 43 seconds <BR> 43.56 seconds <BR> forgot -o flag, oh well, enough data <BR>
What is not yet confirmed is: <BR> 1) Does cm3 wrap everything with sh? <BR> 2) Does calling m3cg/as from cm3 have these costs? <BR>
Very clear: <BR> Wrapping stuff with sh on Cygwin is expensive! <BR>
<BR>
<BR> Actions: <BR> Confirm this cost is being paid by cm3. <BR> Either: <BR> 1) implement some "batch modes" in cm3 and/or cm3cg <BR> 2) or maybe, um, just make sure that cm3 does not wrap with sh, and <BR> if cm3 itself causes this slowdown, because of how Cygwin works, try <BR> interposing a small Win32 helper app. I think Cygwin handles runnig <BR> Win32 apps and being run from Win32 apps differently than Cygwin running <BR> Cygwin -- i.e. not slowly. I'll see. Could be that creating twice the number <BR> of processes, in order to avoid Cygwin running Cygwin, could be faster. Not yet known. <BR>
<BR>
Maybe use system() instead vfork() + exec()? Odd, though, vfork instead of fork is supposed to help.<BR>
<BR> Here is the test code, you edit it to run one case or another: <BR>
<BR>
<BR>
@if not "%1" == "" goto :%1<BR>@rem \cygwin\bin\time cmd /c %~f0 F1<BR>@rem \cygwin\bin\time cmd /c %~f0 F2<BR>@rem \cygwin\bin\time cmd /c %~f0 F3<BR>@\cygwin\bin\time cmd /c %~f0 F4<BR>@goto :eof<BR>
<BR>
<BR>
:F1<BR>@echo off<BR>@del *s *o<BR>for %%a in (*.ic *.mc) do cm3cg -quiet %%a -o %%a.s"<BR>goto :eof<BR>
<BR>
<BR>
:F2<BR>@echo off<BR>@del *s *o<BR>for %%a in (*.ic *.mc) do sh -c "cm3cg -quiet %%a -o %%a.s"<BR>goto :eof<BR>
<BR>
<BR>
:F3<BR>@del *o<BR>@echo off<BR>for %%a in (*.s) do as %%a<BR>goto :eof<BR>
<BR>
<BR>
:F4<BR>@del *o<BR>for %%a in (*.s) do sh -c "as %%a"<BR>goto :eof<BR>
<BR>
<BR> - Jay<BR><BR><BR><br /><hr />Helping your favorite cause is as easy as instant messaging. You IM, we give. <a href='http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join' target='_new'>Learn more.</a></body>
</html>