Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #771216
| From | Niko Tyni <ntyni@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server |
| Date | 2016-10-02 21:50 +0200 |
| Message-ID | <snUVQ-2Gn-7@gated-at.bofh.it> (permalink) |
| References | <snShj-11m-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Control: found -1 5.24.1~rc3-3
On Sun, Oct 02, 2016 at 06:40:32PM +0200, Leszek Dubiel wrote:
> Package: perl
> Version: 5.20.2-3+deb8u6
> Severity: normal
>
> Dear Maintainer,
>
> >From time to time my server get locked, all computation power was
> consumed by that perl script.
> People were testing program and didn't have the same effect. So it
> appeared that this is problem only on my server. I have moved script to
> another computer with the same version of Debian (jessie, stable), and
> script still did run very slow. Problem dissapeared on new version
> (stretch). I have tested on my ubuntu (run fast), and the same hardware
> under VirtualBox with fresh installation of Debian Jessie -- script did
> run very slow.
>
> So the problem exists on current debian stable version (jessie), and
> doesn't exist on newer versions.
I see this on current sid/amd64 (Perl 5.24) too fwiw, and also in an
amd64 chroot with Perl 5.22. I've no idea why it goes away for you on
stretch. Can you confirm that? Are you only testing on i386 or on amd64
as well?
It looks like the difference between
$par = "(" . $inp . ")"; # is slow
and
$par = sprintf "(%s)", $inp; # is fast
internally is that the first one uses copy on write semantics, meaning
it doesn't have to copy the whole string in memory. Of course, this
is supposed to improve performance rather than degrade it.
AFAICS the regexp behaviour stays unchanged, it's just the performance
that drops. I tried some debugging with 'debugperl -Dr' but it mostly
hides the problem by slowing down the execution by itself.
It would be nice to distill the issue to a smaller test case but it's
rather sensitive to the input as you noted so that doesn't seem to be
easy.
Thanks for the report, will try to investigate more.
--
Niko Tyni ntyni@debian.org
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Leszek Dubiel <leszek.dubiel@dubielvitrum.pl> - 2016-10-02 19:00 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Niko Tyni <ntyni@debian.org> - 2016-10-02 21:50 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server gregor herrmann <gregoa@debian.org> - 2016-10-02 22:50 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Niko Tyni <ntyni@debian.org> - 2016-10-02 23:10 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server gregor herrmann <gregoa@debian.org> - 2016-10-02 23:20 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Niko Tyni <ntyni@debian.org> - 2016-10-03 21:30 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Niko Tyni <ntyni@debian.org> - 2016-10-03 22:30 +0200
Bug#839600: perl: concatenating string instead of sprintf takes all computation power of server Leszek Dubiel <leszek.dubiel@dubielvitrum.pl> - 2016-10-02 23:30 +0200
csiph-web