From: Eli Zaretskii <eliz@gnu.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Two strange messages while building Emacs on MS-Windows
Date: Tue, 11 Dec 2012 23:05:44 +0200 [thread overview]
Message-ID: <83sj7c8fkn.fsf@gnu.org> (raw)
In-Reply-To: <CAH8Pv0gNTM7svV2qE+pfV=vxvFCK_UB2oT+zr4hVW4wgti0S_g@mail.gmail.com>
> Date: Tue, 11 Dec 2012 21:41:55 +0100
> From: Dani Moncayo <dmoncayo@gmail.com>
> 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 <stdio.h>
#include <windows.h>
#include <tchar.h>
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;
}
next prev parent reply other threads:[~2012-12-11 21:05 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 19:21 Two strange messages while building Emacs on MS-Windows Dani Moncayo
2012-12-07 19:54 ` Glenn Morris
2012-12-07 19:57 ` Glenn Morris
2012-12-07 20:17 ` Dani Moncayo
2012-12-07 21:35 ` Eli Zaretskii
2012-12-07 22:11 ` Dani Moncayo
2012-12-07 22:35 ` Stefan Monnier
2012-12-08 8:02 ` Eli Zaretskii
2012-12-08 8:43 ` Dani Moncayo
2012-12-08 9:24 ` Eli Zaretskii
2012-12-08 23:06 ` Stefan Monnier
2012-12-09 3:44 ` Eli Zaretskii
2012-12-09 15:50 ` Stefan Monnier
2012-12-09 18:15 ` Óscar Fuentes
2012-12-09 18:52 ` Eli Zaretskii
2012-12-09 19:31 ` Óscar Fuentes
2012-12-09 22:14 ` Eli Zaretskii
2012-12-09 22:44 ` Óscar Fuentes
2012-12-10 6:06 ` Eli Zaretskii
2012-12-10 11:11 ` Óscar Fuentes
2012-12-10 14:37 ` Eli Zaretskii
2012-12-10 15:42 ` Óscar Fuentes
2012-12-10 16:20 ` Eli Zaretskii
2012-12-09 22:00 ` Eli Zaretskii
2012-12-09 23:31 ` Dani Moncayo
2012-12-10 6:13 ` Eli Zaretskii
2012-12-10 20:57 ` Dani Moncayo
2012-12-10 21:08 ` Eli Zaretskii
2012-12-10 21:33 ` Dani Moncayo
2012-12-11 6:49 ` Eli Zaretskii
2012-12-11 7:18 ` Dani Moncayo
2012-12-11 7:51 ` Eli Zaretskii
2012-12-11 20:41 ` Dani Moncayo
2012-12-11 21:00 ` Eli Zaretskii
2012-12-11 20:41 ` Dani Moncayo
2012-12-11 21:05 ` Eli Zaretskii [this message]
2012-12-11 21:58 ` Dani Moncayo
2012-12-11 22:55 ` Stefan Monnier
2012-12-12 3:50 ` Eli Zaretskii
2012-12-12 14:26 ` Stefan Monnier
2012-12-12 17:18 ` Eli Zaretskii
2012-12-12 18:42 ` Eli Zaretskii
2012-12-12 3:48 ` Eli Zaretskii
2012-12-12 18:41 ` Eli Zaretskii
2012-12-11 7:57 ` Daniel Colascione
2012-12-11 20:42 ` Dani Moncayo
2012-12-11 20:47 ` Daniel Colascione
2012-12-11 20:58 ` Dani Moncayo
2012-12-11 20:59 ` Daniel Colascione
2012-12-11 21:01 ` Dani Moncayo
2012-12-11 21:02 ` Daniel Colascione
2012-12-10 9:59 ` Eli Zaretskii
2012-12-10 10:37 ` Romain Francoise
2012-12-10 14:42 ` Eli Zaretskii
2012-12-10 15:33 ` Romain Francoise
2012-12-10 16:04 ` Eli Zaretskii
2012-12-10 14:44 ` Eli Zaretskii
2012-12-07 22:57 ` joakim
2012-12-08 8:08 ` Eli Zaretskii
2012-12-08 10:58 ` joakim
2012-12-08 11:35 ` Óscar Fuentes
2012-12-08 12:12 ` Óscar Fuentes
2012-12-08 12:44 ` Eli Zaretskii
2012-12-08 13:24 ` Óscar Fuentes
2012-12-08 13:38 ` Eli Zaretskii
2012-12-09 1:18 ` Óscar Fuentes
2012-12-08 12:33 ` Eli Zaretskii
2012-12-07 21:35 ` Stefan Monnier
2012-12-09 3:20 ` Jason Rumney
2012-12-07 20:17 ` Dani Moncayo
2012-12-07 21:24 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83sj7c8fkn.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dmoncayo@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).