compared python 2 and 3 speeds

This commit is contained in:
rasbt 2014-05-25 11:46:20 -04:00
parent fa0b5f185c
commit ea23193787
2 changed files with 37 additions and 3 deletions

View File

@ -2868,7 +2868,26 @@ In [8]:
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><strong>Note</strong><br />Some people pointed out the speed difference between Python 3's <code>range()</code> and Python2's <code>xrange()</code>. Since they are implemented the same way one would expect the same speed. However the difference here just comes from the fact that Python 3 generally tends to run slower than Python 2.</p>
<p><br> <br></p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered">
<div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h4 id="Note-about-the-speed-differences-in-Python-2-and-3">Note about the speed differences in Python 2 and 3<a class="anchor-link" href="#Note-about-the-speed-differences-in-Python-2-and-3">&#182;</a></h4>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered">
<div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Some people pointed out the speed difference between Python 3's <code>range()</code> and Python2's <code>xrange()</code>. Since they are implemented the same way one would expect the same speed. However the difference here just comes from the fact that Python 3 generally tends to run slower than Python 2.</p>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:8b17f6649c9b74d878c198037ee831fbec78e7ac375adfc4a62f03266d9d66c3"
"signature": "sha256:eb93a4258ce700755924939b5dc873c027a656b1faafcd0228616b8575378418"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -881,7 +881,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Note** \n",
"<br>\n",
"<br>"
]
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Note about the speed differences in Python 2 and 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Some people pointed out the speed difference between Python 3's `range()` and Python2's `xrange()`. Since they are implemented the same way one would expect the same speed. However the difference here just comes from the fact that Python 3 generally tends to run slower than Python 2. "
]
},