Date: Thu, 27 Jan 2011 21:58:58 +0000 From: Devin Teske <dteske@vicor.com> To: Kostik Belousov <kostikbel@gmail.com> Cc: freebsd-hackers@freebsd.org, Mark Saad <nonesuch@longcount.org> Subject: Re: rtld optimizations Message-ID: <1296165538.20060.43.camel@dt.vicor.com> In-Reply-To: <20110127213536.GR2518@deviant.kiev.zoral.com.ua> References: <AANLkTikwHteyqMfMpy_B-AxQ5ZQ_Z3RKhkNpGN23fXtX@mail.gmail.com> <20110125234911.223d8f75@kan.dnsalias.net> <201101271305.21510.naylor.b.david@gmail.com> <AANLkTinkhfso3iRR4pERxhf=%2BnCqy2YDigzgyfNVtnaJ@mail.gmail.com> <20110127203126.GN2518@deviant.kiev.zoral.com.ua> <1296161448.20060.40.camel@dt.vicor.com> <20110127205907.GP2518@deviant.kiev.zoral.com.ua> <1296162754.20060.42.camel@dt.vicor.com> <20110127213536.GR2518@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2011-01-27 at 23:35 +0200, Kostik Belousov wrote: > On Thu, Jan 27, 2011 at 09:12:34PM +0000, Devin Teske wrote: > > On Thu, 2011-01-27 at 22:59 +0200, Kostik Belousov wrote: > > > > > On Thu, Jan 27, 2011 at 08:50:48PM +0000, Devin Teske wrote: > > > > Probably did something like this: > > > > > > > > time sh -c '( firefox & ); sleep 10000000' > > > > > > > > and then pressed Ctrl-C when he felt that firefox was finished loading. > > > > The moment Ctrl-C is pressed, time(1) shows how long it ran up until you > > > > pressed Ctrl-C. > > > > NOTE: Pressing Ctrl-C will not terminate the firefox instance. > > > > > > You cannot have 1/100 of seconds precision with this method. > > > This is why I am asking, seeing < 0.1 seconds difference. > > > Not to mention some methodical questions, like whether the caches were > > > warmed before the measurement by several runs before the actual > > > test. > > > > > > Really? > > > > $ time sh -c '( firefox & ); sleep 10000000' > > ^C > > > > real 0m5.270s > > user 0m0.000s > > sys 0m0.005s > > > > > > I'd call that 1/100th of a second precision, wouldn't you? > > > > HINT: Try using bash instead of csh. > (I supposed that) obvious point of my mail is that you cannot reliably > measure 1/100 second intervals when human interaction is involved. > To make it completely obvious: human has to press CTRL-C, I did not > mean reading the numbers from display. I hypothesized that the results would always be subjected because we couldn't tell whether one person would consider "complete" to be "web page loaded" versus another person might consider "complete" to be when the window frame/decorations are drawn by the window manager. However, if Firefox provides a way of timing it in an objective manner... that would surely be superior to the method I've suggested which can lag by a few hundreds of even a few tenths of a second (depends on the subject's ability to quickly invoke focus-follows-mouse and press Ctrl-C). So yeah... my suggestion isn't perfect... but is generally "good enough" if the application you're testing doesn't provide a hook for determining when it is officially done loading. Now... here's an idea that might work (since we're talking about a web browser -- this obviously won't work for OpenOffice, though variations on the idea can be had): 1. Launch Firefox from the command-line with arguments to point it at a web page which uses JavaScript to print the current date and time in the web page 2. Execute: ps axo pid,state,command,lstart | grep firefox 3. Calculate the time difference between the "lstart" and the time printed in the browser. I do believe that should be sufficient to get accurate/objective results. NOTE: For OpenOffice, you could perhaps have the spreadsheet program open a spreadsheet with a macro to display the current date/time then use the lstart data from ps(1) to calculate the results. Similarly, you could have OpenOffice.org Writer open a document with a header-macro to display the current date/time. -- Devin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1296165538.20060.43.camel>