Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The following command sometimes takes as much as half a minute to run under Cygwin (1-7.19-1) and perl 5, version 14, subversion 2 (v5.14.2) built for cygwin-thread-multi-64int on an otherwise idle system with 16GB of RAM and an 8-core CPU running Windows 7.
$ time /usr/bin/perl -e 'use File::Temp' real 0m38.796s user 0m0.109s sys 0m0.124s
The second time it is executed it is typically considerably faster.
$ time /usr/bin/perl -e 'use File::Temp' real 0m2.498s user 0m0.124s sys 0m0.124s

I have run the command under strace to see if there was a particular system call that takes a long time to execute, but a cursory examination of the output didn't show me such a culprit.

I also looked at the time when each included file is opened, and I see that they are evenly spread out, with some however (warnings, Cwd, Config, Basename, constant) taking more than a second to load.

$ awk '/open: open/{print $2 / 1e6, $7}' strace.out 0.062687 open(/dev/urandom, 0.093652 open(/dev/urandom, 0.162175 open(/dev/null, 0.332337 open(/usr/lib/perl5/5.14/File/Temp.pm, 0.413667 open(/usr/lib/perl5/5.14/strict.pm, 0.574798 open(/usr/lib/perl5/5.14/Carp.pm, 0.647806 open(/usr/lib/perl5/5.14/warnings.pm, 2.12777 open(/usr/lib/perl5/5.14/Exporter.pm, 2.40747 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/File/Spec.p +m, 2.48178 open(/usr/lib/perl5/5.14/vars.pm, 2.56121 open(/usr/lib/perl5/5.14/warnings/register.pm, 2.83884 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/File/Spec/C +ygwin.pm, 3.06084 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/File/Spec/U +nix.pm, 3.59694 open(/usr/lib/perl5/5.14/File/Path.pm, 3.67258 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/Cwd.pm, 4.72324 open(/usr/lib/perl5/5.14/XSLoader.pm, 4.94318 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/DynaLoader. +pm, 5.00538 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/Config.pm, 16.219 open(/usr/lib/perl5/5.14/File/Basename.pm, 17.3896 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/Fcntl.pm, 17.7389 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/IO/Seekable +.pm, 17.8311 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/IO/Handle.p +m, 17.9298 open(/usr/lib/perl5/5.14/Symbol.pm, 18.1662 open(/usr/lib/perl5/5.14/SelectSaver.pm, 18.2823 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/IO.pm, 19.0989 open(/usr/lib/perl5/5.14/i686-cygwin-threads-64int/Errno.pm, 19.468 open(/usr/lib/perl5/5.14/base.pm, 19.8129 open(/usr/lib/perl5/5.14/overload.pm, 20.236 open(/usr/lib/perl5/5.14/constant.pm, 22.0238 open(/usr/lib/perl5/5.14/Carp/Heavy.pm, 22.1132 open(/usr/lib/perl5/5.14/Exporter/Heavy.pm,

In reply to File::Temp painfully slow under Cygwin by dds

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found