<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Noam Rathaus wrote:
<blockquote
cite="mid:6a2b811d0909080750u37843c5yc95a7f29ad548d11@mail.gmail.com"
type="cite">
<div dir="ltr">The only obvious one is that read() shown under
strace, takes a significant more time on the new machine than the old
one<br>
</div>
</blockquote>
You can split the difference between the platforms into three groups:<br>
Time spent in the kernel (0.032 seconds)<br>
Time spent in userspace (7.761 seconds)<br>
Time spent sleeping or otherwise scheduled out (7.287 seconds)<br>
<br>
strace -c goes a long way, and works very hard, to show us information
that is not useful to us. It counts CPU time spent in system calls, not
actual wall time. What may provide a more useful output in this case is
-T, which will also count time in which the process was sleeping inside
a system call (which accounts for about half the slowdown).<br>
<br>
The second half of the slowdown, the one done in user space, is more
difficult to trace without the sources (i.e. - the perl sources).
valgrind has a module for detecting what causes a slowdown, but I doubt
Noam wants to start analyzing perl to figure out what the different
areas actually mean.<br>
<br>
Shachar<br>
<blockquote
cite="mid:6a2b811d0909080750u37843c5yc95a7f29ad548d11@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_quote">On Tue, Sep 8, 2009 at 5:43 PM, Shachar
Shemesh <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:shachar@shemesh.biz">shachar@shemesh.biz</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr" bgcolor="#ffffff" text="#000000">
<div class="im">Noam Meltzer wrote:
<blockquote type="cite">
<div dir="ltr">the time output does looks like you have higher
cpu
usage for some reason, so i agree with Shachar on this.<br>
<br>
you can also try to pinpoint the place the cpu is spent.<br>
strace and/or ltrace with the '-f -c' flags can help.<br>
</div>
</blockquote>
</div>
I'm not sure about ltrace, but strace will not help. Most of the time
is spent in user space, not in the kernel.<br>
<br>
Strace may help if the problem is time spent in another process (i.e. -
while the main process is sleeping), but it seems Noam has already
tried that one and failed to spot any obvious candidates.<br>
<font color="#888888"><br>
Shachar</font>
<div class="im"><br>
<blockquote type="cite">
<div dir="ltr"><br>
<br>
<br>
<div class="gmail_quote">On Tue, Sep 8, 2009 at 5:24 PM, Shachar
Shemesh <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:shachar@shemesh.biz" target="_blank">shachar@shemesh.biz</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr" bgcolor="#ffffff" text="#000000">
<div>Noam Rathaus wrote:
<blockquote type="cite">
<div dir="ltr">I know the time difference doesn't look too
bad,
but
take a bigger code set:<br>
<br>
Fast:<br>
real 0m1.682s<br>
user 0m1.584s<br>
sys 0m0.064s<br>
<br>
Slow:<br>
real 0m16.730s<br>
user 0m9.345s<br>
sys 0m0.096s<br>
<br>
</div>
</blockquote>
</div>
These times spell "CPU intensive". Does your library do anything
special? If you try to import a dummy library, does this still happen?
<div><br>
<br>
Shachar<br>
<br>
<pre cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a moz-do-not-send="true" href="http://www.lingnu.com" target="_blank">http://www.lingnu.com</a>
</pre>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<pre cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a moz-do-not-send="true" href="http://www.lingnu.com" target="_blank">http://www.lingnu.com</a>
</pre>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>