From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Two strange messages while building Emacs on MS-Windows Date: Tue, 11 Dec 2012 23:05:44 +0200 Message-ID: <83sj7c8fkn.fsf@gnu.org> References: <83mwxpmtp6.fsf@gnu.org> <83fw3hm0nn.fsf@gnu.org> <83k3srdh3d.fsf@gnu.org> <838v96dgyd.fsf@gnu.org> <8338zecu4i.fsf@gnu.org> <83vcc9aa4a.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1355259990 20166 80.91.229.3 (11 Dec 2012 21:06:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2012 21:06:30 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Dani Moncayo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 11 22:06:42 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TiX2F-0007mU-HL for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 22:06:39 +0100 Original-Received: from localhost ([::1]:40637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiX22-0001iy-LW for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2012 16:06:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiX1v-0001iT-HQ for emacs-devel@gnu.org; Tue, 11 Dec 2012 16:06:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiX1u-00029b-1h for emacs-devel@gnu.org; Tue, 11 Dec 2012 16:06:19 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:36423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiX1t-00029O-Pc for emacs-devel@gnu.org; Tue, 11 Dec 2012 16:06:17 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MEV00800X6THE00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Tue, 11 Dec 2012 23:05:50 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MEV008SXX9PGW10@a-mtaout22.012.net.il>; Tue, 11 Dec 2012 23:05:50 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155489 Archived-At: > Date: Tue, 11 Dec 2012 21:41:55 +0100 > From: Dani Moncayo > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > > > So now the new mystery is: why does it take you a whopping 7.5 min to > > compile the C sources of Emacs? It takes about 30 sec for me with GCC > > 3.4.x; GCC 4.7.2 that you use should be about 2 times slower, so I'd > > expect something like 1 min, not 7.5. > > > > Try this: > > > > cd nt > > touch ../src/config.h > > make -j6 > > > > and time the last command. > > 0:51 As expected. So, if compiling the C sources takes 1 min and compiling the Lisp files takes 6.5 min, how come the bootstrap takes 15 min? What else takes 7.5 min? > >> $ time /c/emacs/trunk/bin/emacs --batch --eval '(message "Hello")' > >> Hello > >> > >> real 0m1.189s > >> user 0m0.031s > >> sys 0m0.000s > > > > Maybe that's your problem. Does the time go down if you repeat that > > command? > > I've tried that now, and I observe that the "real" component varies > between 145 and 200 ms (without decreasing or increasing tendency; > it's kinda random). Most Windows time measurement have inherent 15-msec granularity. > I don't know what's the best way to measure execution time from a > cmd.exe shell. I attach a program that you could use, call it timep.exe. /* timep: Emulate Unix `time' command. */ #include #include #include LPTSTR SkipArg (const LPTSTR args) { LPTSTR argp = args; while (*argp != _T (' ')) ++argp; while (*argp == _T (' ')) ++argp; return argp; } int _tmain (int argc, LPTSTR argv []) { STARTUPINFO StartUp; PROCESS_INFORMATION ProcInfo; union { /* Structure required for file time arithmetic. */ LONGLONG li; FILETIME ft; } CreateTime, ExitTime, ElapsedTime; FILETIME KernelTime, UserTime; SYSTEMTIME ElTiSys, KeTiSys, UsTiSys, StartTimeSys, ExitTimeSys; LPTSTR targv = SkipArg (GetCommandLine ()); OSVERSIONINFO OSVer; BOOL IsNT; HANDLE hProc; DWORD status; OSVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx (&OSVer); IsNT = (OSVer.dwPlatformId == VER_PLATFORM_WIN32_NT); /* NT (all versions) returns VER_PLATFORM_WIN32_NT. */ GetStartupInfo (&StartUp); GetSystemTime (&StartTimeSys); /* Execute the command line; wait for process to complete. */ CreateProcess (NULL, targv, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &StartUp, &ProcInfo); /* Assure that we have all REQUIRED access to the process. */ DuplicateHandle (GetCurrentProcess (), ProcInfo.hProcess, GetCurrentProcess (), &hProc, PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, 0); WaitForSingleObject (hProc, INFINITE); GetExitCodeProcess (hProc, &status); GetSystemTime (&ExitTimeSys); if (status >= 0 && status < 256 && IsNT) { /* W NT. Elapsed, Kernel, & User times. */ GetProcessTimes (hProc, &CreateTime.ft, &ExitTime.ft, &KernelTime, &UserTime); ElapsedTime.li = ExitTime.li - CreateTime.li; FileTimeToSystemTime (&ElapsedTime.ft, &ElTiSys); FileTimeToSystemTime (&KernelTime, &KeTiSys); FileTimeToSystemTime (&UserTime, &UsTiSys); _ftprintf (stderr, _T ("\nreal\t%02dh%02dm%02d.%03ds\n"), ElTiSys.wHour, ElTiSys.wMinute, ElTiSys.wSecond, ElTiSys.wMilliseconds); _ftprintf (stderr, _T ("user\t%02dh%02dm%02d.%03ds\n"), UsTiSys.wHour, UsTiSys.wMinute, UsTiSys.wSecond, UsTiSys.wMilliseconds); _ftprintf (stderr, _T ("sys\t%02dh%02dm%02d.%03ds\n"), KeTiSys.wHour, KeTiSys.wMinute, KeTiSys.wSecond, KeTiSys.wMilliseconds); } else { /* Windows 9x and CE. Elapsed time only. */ } CloseHandle (ProcInfo.hThread); CloseHandle (ProcInfo.hProcess); CloseHandle (hProc); return 0; }