Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2011 18:24:18 -0500
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Mark Saad <nonesuch@longcount.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: rtld optimizations
Message-ID:  <20110127182418.77c53c60@kan.dnsalias.net>
In-Reply-To: <AANLkTimCVnqN7WAGfP7GtVZreBv%2BpXKFWRWqPDnAADhC@mail.gmail.com>
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> <1296165538.20060.43.camel@dt.vicor.com> <AANLkTimCVnqN7WAGfP7GtVZreBv%2BpXKFWRWqPDnAADhC@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_//rdBBBf+zz=.dpEJjCVbXkU
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Thu, 27 Jan 2011 17:53:49 -0500
Mark Saad <nonesuch@longcount.org> wrote:

> On Thu, Jan 27, 2011 at 4:58 PM, Devin Teske <dteske@vicor.com> wrote:
> > 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
>=20
> So for both I took the simplest approach . I spent to much time on
> looking for more exotic solutions.
> This seamed to be the easiest to run and somewhat os / platform
> agnostic.
>=20
> 1. time application  " time firefox"
> 2. kill it when its fully loaded.  *
> 3. record time
> 4. rerun test 10 times make an average to normalize my response time
> in closing the application.
>=20
> * I have the window manager open the window in the same place so I
> could be ready to hit the close widget.
> * For firefox I had it set to load a local page on startup
> * For openoffice I waited till it was at the "what do you want to do"
> window
>=20
> I know there is a lot of room here to debate how fast I can close and
> application, what's cached , how busy is the disk etc. I tried using
> mplayer but I did not get good results.  My logic in using mplayer was
> that its linked to almost every audio / video lib you can name. Making
> it do some task, dump every frame into a jpg or remove the audio track
> from some video etc, should be simple to test without using a gui or
> requiring human input to stop it.
>=20
> I am stumped, at first I just was curious at first if there was any
> truth in the post, and wanted to know if anyone looked into it. Now I
> want to know how you test this correctly.
>=20

For starters, the number of libraries given binary is linked too is
completely and utterly irrelevant :) The change NetBSD guys claims to
revolutionize his application startup times only applies to programs
that dlopen (read - load dynamically) libraries with long largely
identical dependency chains and calls dlsym on them many, many
thousand times. I do not think you will find any real app out there
that fits this description close enough to actually demonstrate the
effect of the change that is distinguishable from the statistical noise.
Pressing ^C certainly not precise enough for that.

--=20
Alexander Kabaev

--Sig_//rdBBBf+zz=.dpEJjCVbXkU
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iD8DBQFNQf6nQ6z1jMm+XZYRAsA6AJ94tgMPX0U+29kv654bmvp78Hvk8ACeO9+i
waVZDwAmMgsYDws0V2ORYu0=
=Ojtt
-----END PGP SIGNATURE-----

--Sig_//rdBBBf+zz=.dpEJjCVbXkU--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110127182418.77c53c60>