Hai All,<div><br></div><div>In trails of finding the execution time lapse between Python and PyPy , its proved that PyPy is slower than Python.</div><div><br></div><div>Here are the trials done ;</div><div><br></div><div><b>Step-1: Written a Python code that uses repeated os.rename()</b></div>
<div><b><br></b></div><div><b>code: (file name : rename.py)</b></div><div><div><i>           #!/usr/bin/env python</i></div><div><i><br></i></div><div><i>           import os</i></div><div><i>           import sys</i></div>
<div><i><br></i></div><div><i>           os.chdir(&quot;/opt/pypy-1.8/bin&quot;)</i></div><div><i>           print &quot;Rename count -1  (a1 -&gt; a2)&quot;</i></div><div><i>           os.rename(&quot;a1&quot;,&quot;a2&quot;)</i></div>
<div><i>           print &quot;Rename count -2  (a2 -&gt; a3)&quot;</i></div><div><i>           os.rename(&quot;a2&quot;,&quot;a3&quot;)</i></div><div><i>           print &quot;Rename count -3  (a3 -&gt; a4)&quot;</i></div>
<div><i>           os.rename(&quot;a3&quot;,&quot;a4&quot;)</i></div><div><i>           print &quot;Rename count -4  (a4 -&gt; a5)&quot;</i></div><div><i>           os.rename(&quot;a4&quot;,&quot;a5&quot;)</i></div><div><i>           print &quot;Rename count -5  (a5 -&gt; a6)&quot;</i></div>
<div><i>           os.rename(&quot;a5&quot;,&quot;a6&quot;)</i></div><div><i>           print &quot;Rename count -6  (a6 -&gt; a7)&quot;</i></div><div><i>           os.rename(&quot;a6&quot;,&quot;a7&quot;)</i></div><div><i>           print &quot;Rename count -7  (a7 -&gt; a8)&quot;</i></div>
<div><i>           os.rename(&quot;a7&quot;,&quot;a8&quot;)</i></div><div><i>           print &quot;Rename count -8  (a8 -&gt; a9)&quot;</i></div><div><i>           os.rename(&quot;a8&quot;,&quot;a9&quot;)</i></div><div><i>           print &quot;Rename count -9  (a9 -&gt; a0)&quot;</i></div>
<div><i>           os.rename(&quot;a9&quot;,&quot;a0&quot;)</i></div><div><i>           print &quot;Rename count -10 (a0 -&gt; B0)&quot;</i></div><div><i>           os.rename(&quot;a0&quot;,&quot;B0&quot;)</i></div><div><i><br>
</i></div><div><b>Step-2: Observed Execution time with Python 2.7</b></div><div><div style="font-weight:bold"><i><br></i></div><div style="font-weight:bold"><i>           [root@Manojkiran bin]# time python rename.py </i></div>
<div><i>           Rename count -1  (a1 -&gt; a2)</i></div><div><i>           Rename count -2  (a2 -&gt; a3)</i></div><div><i>           Rename count -3  (a3 -&gt; a4)</i></div><div><i>           Rename count -4  (a4 -&gt; a5)</i></div>
<div><i>           Rename count -5  (a5 -&gt; a6)</i></div><div><i>           Rename count -6  (a6 -&gt; a7)</i></div><div><i>           Rename count -7  (a7 -&gt; a8)</i></div><div><i>           Rename count -8  (a8 -&gt; a9)</i></div>
<div><i>           Rename count -9  (a9 -&gt; a0)</i></div><div><i>           Rename count -10 (a0 -&gt; B0)</i></div><div style="font-weight:bold"><i><br></i></div><div style="font-weight:bold"><i>           real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.031s</i></div>
<div style="font-weight:bold"><i>           user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.021s</i></div><div style="font-weight:bold"><i>           sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.010s</i></div>
<div style="font-weight:bold"><br></div></div><div style="font-weight:bold">Step-3:<b> Observed Execution time with PyPy 1.8</b></div></div><div style="font-weight:bold"><b><br></b></div><div><div style="font-weight:bold">
           [root@Manojkiran bin]# time ./pypy rename.py </div><div><i>           ./pypy: /usr/local/ssl/lib/libssl.so.0.9.8: no version information available (required by ./pypy)</i></div><div><i>           ./pypy: /usr/local/ssl/lib/libcrypto.so.0.9.8: no version information available (required by ./pypy)</i></div>
<div><i>           Rename count -1  (a1 -&gt; a2)</i></div><div><i>           Rename count -2  (a2 -&gt; a3)</i></div><div><i>           Rename count -3  (a3 -&gt; a4)</i></div><div><i>           Rename count -4  (a4 -&gt; a5)</i></div>
<div><i>           Rename count -5  (a5 -&gt; a6)</i></div><div><i>           Rename count -6  (a6 -&gt; a7)</i></div><div><i>           Rename count -7  (a7 -&gt; a8)</i></div><div><i>           Rename count -8  (a8 -&gt; a9)</i></div>
<div><i>           Rename count -9  (a9 -&gt; a0)</i></div><div><i>           Rename count -10 (a0 -&gt; B0)</i></div><div style="font-weight:bold"><br></div><div style="font-weight:bold">           real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.054s</div>
<div style="font-weight:bold">           user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.036s</div><div style="font-weight:bold">           sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.016s</div>
</div><div><b><br></b></div>
<div><b>Step-4: Written a Python code that uses repeated os.link()</b></div><div><b><br></b></div><div><b>code: (file name : link.py)</b></div><div><div>          <i> #!/usr/bin/env python</i></div><div><i><br></i></div>
<div><i>           import os</i></div><div><i>           import sys</i></div><div><i><br></i></div><div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l0&quot;)</i></div><div><i>           print &quot;Linked count -1  (l0 -&gt; lo)&quot;</i></div>
<div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l1&quot;)</i></div>
<div><i>           print &quot;Linked count -2  (l0 -&gt; l1)&quot;</i></div><div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l2&quot;)</i></div><div><i>           print &quot;Linked count -3  (l0 -&gt; l2)&quot;</i></div>
<div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l3&quot;)</i></div>
<div><i>           print &quot;Linked count -4  (l0 -&gt; l3)&quot;</i></div><div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l4&quot;)</i></div><div><i>           print &quot;Linked count -5  (l0 -&gt; l4)&quot;</i></div>
<div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l5&quot;)</i></div>
<div><i>           print &quot;Linked count -6  (l0 -&gt; l5)&quot;</i></div><div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l6&quot;)</i></div><div><i>           print &quot;Linked count -7  (l0 -&gt; l6)&quot;</i></div>
<div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l7&quot;)</i></div>
<div><i>           print &quot;Linked count -8  (l0 -&gt; l7)&quot;</i></div><div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l8&quot;)</i></div><div><i>           print &quot;Linked count -9  (l0 -&gt; l8)&quot;</i></div>
<div><i>           os.link(&quot;/opt/pypy-1.8/bin/l0&quot;,&quot;/opt/pypy-1.8/bin/test/l9&quot;)</i></div>
<div><i>           print &quot;Linked count -10 (l0 -&gt; l9)&quot;</i></div><div><br></div><div><div><div><b>Step-5: Observed Execution time with Python 2.7</b></div><div><div style="font-weight:bold"><i><br></i></div><div style="font-weight:bold">
<i>           [root@Manojkiran bin]# time python link.py </i></div><div><i>           Linked count -1  (l0 -&gt; l0)</i></div><div><i>           </i><i>Linked</i><i> count -2  (l0 -&gt; l1)</i></div><div><i>           </i><i>Linked</i><i> count -3  (l0 -&gt; l2)</i></div>
<div><i>           </i><i>Linked</i><i> count -4  (l0 -&gt; l3)</i></div><div><i>           </i><i>Linked</i><i> count -5  (l0 -&gt; l4)</i></div><div><i>           </i><i>Linked</i><i> count -6  (l0 -&gt; l5)</i></div><div>
<i>           </i><i>Linked</i><i> count -7  (l0 -&gt; l6)</i></div><div><i>           </i><i>Linked</i><i> count -8  (l0 -&gt; l7)</i></div><div><i>           </i><i>Linked</i><i> count -9  (l0 -&gt; l8)</i></div><div><i>           </i><i>Linked</i><i> count -10 (l0 -&gt; l9)</i></div>
<div style="font-weight:bold"><i><br></i></div><div style="font-weight:bold"><i>           real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.028s</i></div><div style="font-weight:bold"><i>           user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.020s</i></div>
<div style="font-weight:bold"><i>           sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.008s</i></div><div style="font-weight:bold"><br></div></div><div style="font-weight:bold">Step-6:<b> Observed Execution time with PyPy 1.8</b></div>
</div><div style="font-weight:bold"><b><br></b></div><div><div style="font-weight:bold">           [root@Manojkiran bin]# time ./pypy link.py </div><div><i>           ./pypy: /usr/local/ssl/lib/libssl.so.0.9.8: no version information available (required by ./pypy)</i></div>
<div><i>           ./pypy: /usr/local/ssl/lib/libcrypto.so.0.9.8: no version information available (required by ./pypy)</i></div><div><div><i>           Linked count -1  (l0 -&gt; l0)</i></div><div><i>           </i><i>Linked</i><i> count -2  (l0 -&gt; l1)</i></div>
<div><i>           </i><i>Linked</i><i> count -3  (l0 -&gt; l2)</i></div><div><i>           </i><i>Linked</i><i> count -4  (l0 -&gt; l3)</i></div><div><i>           </i><i>Linked</i><i> count -5  (l0 -&gt; l4)</i></div><div>
<i>           </i><i>Linked</i><i> count -6  (l0 -&gt; l5)</i></div><div><i>           </i><i>Linked</i><i> count -7  (l0 -&gt; l6)</i></div><div><i>           </i><i>Linked</i><i> count -8  (l0 -&gt; l7)</i></div><div><i>           </i><i>Linked</i><i> count -9  (l0 -&gt; l8)</i></div>
<div><i>           </i><i>Linked</i><i> count -10 (l0 -&gt; l9)</i></div></div><div><i><br></i></div><div style="font-weight:bold">           real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.056s</div>
<div style="font-weight:bold">           user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.032s</div><div style="font-weight:bold">           sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.023s</div>
</div></div><div><br></div><div>Hence in my understanding Python is better in terms of execution time when compared with PyPy.</div><div><br></div><div>Kindly suggest me if my trails are proper and why PyPy failed to achieve better speed then PyPy ?</div>
<div><br></div><div>Is this a know issue or whether we have any fix for this ?</div><div><br></div><div>Thanking you,</div><div>-- </div>Sasikanth<br><br><br><br>
</div>