grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep-3.7.98-c9ac on Linux/s390x


From: Jim Meyering
Subject: Re: grep-3.7.98-c9ac on Linux/s390x
Date: Sun, 3 Jul 2022 20:45:35 -0700

On Sun, Jul 3, 2022 at 1:54 PM Bruno Haible <bruno@clisp.org> wrote:
> > > On Linux/s390x (emulated with qemu-system-s390x) all tests pass, except 
> > > one:
> > >
> > >
> > > FAIL: long-pattern-perf
> > > =======================
> > >
> > > ...
> > > + base_ms=1250
> > > ++ user_time_ 1 grep -f re-10x in
> > > ...
> > > + b10x_ms=81800
> > > + returns_ 1 expr 1250 '<' 81800 / 20
> > > 1
> > > + fail=1
> > > + Exit 1
> > > + set +e
> > > + exit 1
> > > + exit 1
> > > + remove_tmp_
> > > + __st=1
> > > + cleanup_
> > > + :
> > > + test '' = yes
> > > + cd /home/bruno/grep-3.7.98-c9ac/build-64/tests
> > > + chmod -R u+rwx 
> > > /home/bruno/grep-3.7.98-c9ac/build-64/tests/gt-long-pattern-perf.PZ1I
> > > + rm -rf 
> > > /home/bruno/grep-3.7.98-c9ac/build-64/tests/gt-long-pattern-perf.PZ1I
> > > + exit 1
> > > FAIL long-pattern-perf (exit status: 1)
> > >
> > >
> > > Apparently the timings are not so reliable in a qemu emulated system.
> >
> > Thanks for reporting that.
> > Is that reproducible?
>
> Yes. In a second run, the test fails again, this time with
>
> + base_ms=1120
> ++ user_time_ 1 grep -f re-10x in
> ...
> + b10x_ms=38550
> + returns_ 1 expr 1120 '<' 38550 / 20
>
> > That test allows some leeway, letting a 10x increase in regex size
> > evoke a 20x runtime increase.
> > Accommodating this fringe environment (at least with that one sample
> > timing) would require raising that well past 60x, which would get too
> > close to the old 100x perf hit that's supposed to be avoided, now.
>
> I agree that the thresholds that you have chosen are reasonable.
>
> Apparently, qemu is special due to its built-in just-in-time compiler
> technology.
>
> Is there a way to detect this special situation? The tips from [1],
> or these conditions:
>
> LC_ALL=C mount | grep '^/dev/vda.* on / ' >/dev/null
> LC_ALL=C lscpu | grep '^Virtualization type:.*full' >/dev/null
>
> detect system-level virtualization, but cannot distinguish an
> emulated CPU from a paravirtualized CPU. Even when considering
>
> cat /proc/cpuinfo | grep -i bogomips
>
> So, I'm not able to propose a patch to detect this special situation.

Thanks for pursuing that.
One possibility would be to skip the test if $base_ms is larger than say 800.
That might also avoid failure on your 1.5GB-RAM Solaris 11 OpenIndiana system.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]