Bug#763695: console-setup: even worse than assumed
Hallo,
* Samuel Thibault [Tue, Aug 25 2015, 10:52:29PM]:
> Eduard Bloch, le Tue 25 Aug 2015 22:34:17 +0200, a écrit :
> > Hallo,
> > * Samuel Thibault [Tue, Aug 25 2015, 09:56:39PM]:
> > > Eduard Bloch, le Tue 25 Aug 2015 21:35:36 +0200, a écrit :
> > > > * Samuel Thibault [Tue, Aug 25 2015, 08:54:35PM]:
> > > > > Just so that people reading the log don't take it too exagerated:
> > > >
> > > > > Eduard Bloch, le Tue 25 Aug 2015 20:24:22 +0200, a écrit :
> > > > > > I checked again... about 20% of the time is spent in two calls of pidof
> > > > >
> > > > > We're here talking about ~15ms each.
> > > >
> > > > I don't. It's ~270ms each (I added another log with timestamps).
> > >
> > > How long is the readlink /proc/*/exe | grep?
> >
> > ~70ms (strace -f -tt -o logfile sh -c 'readlink /proc/*/exe | fgrep slash')
>
> strace is quite expensive, better use just
Oh, you are right. I didn't expect that impact. Without strace, pidof
takes ~22ms on this laptop. OTOH same with
sh "readlink...|grep"
also needs about ~10ms.
So... ok, maybe getting times from the log was a bad idea and causes
exageration.
> time (readlink /proc/*/exe | fgrep slash)
>
> But that's already a big improvement, I'm surprised that pidof can be so
> expensive.
Mea culpa; pidof probably creates lots of work for strace because of the
many "IO" operations on /proc.
Sorry...
Regards,
Eduard.
Reply to: