I understand that our problem might not(only|at all) be related to Perl, but since this is the language of choice and I know there is a lot of wisdom to be found here, I beg to ask...

When migrating several older Perl programs from an old to a new server we saw a dramatic decrease in execution speed, although the newer machine should be much faster.

Old machine:
Intel Celeron @2.2GHz, 4533 bogomips, 2GB RAM, Perl 5.10.1, Ubuntu 10.04 LTS, kernel 2.6.32-45, mysql 14.14 Distrib 5.1.66, SysV init

New machine:
Intel Core i3-4160 @3.6GHz, 7200 bogomips, 8GB RAM, Perl 5.20.2, Debian jessie, kernel 3.16.0-4, mysql 15.1 Distrib 10.0.23-MariaDB, systemd 215

The difference in one task was about 10-fold (i.e. the script took more than 10 times as long to run on the new machine, 0m58 vs. 11m). In another case the slow down was about 4 to 8-fold. Measurements were taken with the 'time' command on the command line.

The slowest program reads a dBase database table sequentially, mangles the data a bit and writes the records to a text and to a MariaDB SQL table. When commenting out the only $sth->execute statement the execution time jumps up from 11 minutes to 38 seconds. Some careful performance tuning on the MySQL/MariaDB server brought the execution time down to 2m40 (from 11m), still about 3 times slower than the old machine.

Another program, which does not use SQL, reads a dBase file, mangles the data a bit and writes them to a text file. Here the slowdown is about 4-fold. Some analysis with Devel::NYTProf found that most time is spent in IO::Handle which in turn is called by XBase.pm.

What I did and concluded so far:

My question:
What else could be the reason for the slowdown? Is there anything which makes Perl 5.20 so much slower at IO handling? Is there anything obvious that I am missing, maybe something affecting IO in general? Buffering?

Any help is highly appreciated.

Thanks in advance,
Ekki


In reply to Much slower execution from one machine to another by df4or

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.