Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pypy.org
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PyPy
pypy.org
Commits
068ecf60
Commit
068ecf60
authored
13 years ago
by
Armin Rigo
Browse files
Options
Downloads
Patches
Plain Diff
Typo in capitalization. Regen.
parent
656ba44c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
performance.html
+16
-4
16 additions, 4 deletions
performance.html
source/performance.txt
+1
-1
1 addition, 1 deletion
source/performance.txt
with
17 additions
and
5 deletions
performance.html
+
16
−
4
View file @
068ecf60
...
...
@@ -99,10 +99,22 @@
might be worthwhile to consider rewriting it as a pure Python version
that uses something like
<tt
class=
"docutils literal"
>
ctypes
</tt>
for the interface.
</li>
<li><strong>
Missing RPython modules
</strong>
: A few modules of the standard library
(like
<tt
class=
"docutils literal"
>
csv
</tt>
and
<tt
class=
"docutils literal"
>
cPickle
</tt>
) are in C in CPython, but in pure Python
in PyPy. Sometimes the JIT is able to do a good job on them, and
sometimes not. In most cases (like
<tt
class=
"docutils literal"
>
csv
</tt>
and
<tt
class=
"docutils literal"
>
cPickle
</tt>
), we're slower
than cPython, with the notable exception of
<tt
class=
"docutils literal"
>
json
</tt>
and
<tt
class=
"docutils literal"
>
heapq
</tt>
.
</li>
(like
<tt
class=
"docutils literal"
>
csv
</tt>
and
<tt
class=
"docutils literal"
>
cPickle
</tt>
) are written in C in CPython, but written
natively in pure Python in PyPy. Sometimes the JIT is able to do a
good job on them, and sometimes not. In most cases (like
<tt
class=
"docutils literal"
>
csv
</tt>
and
<tt
class=
"docutils literal"
>
cPickle
</tt>
), we're slower than CPython, with the notable exception of
<tt
class=
"docutils literal"
>
json
</tt>
and
<tt
class=
"docutils literal"
>
heapq
</tt>
.
</li>
<li><strong>
Abuse of itertools
</strong>
: The itertools module is often
“
abused
”
in the
sense that it is used for the wrong purposes. From our point of view,
itertools is great if you have iterations over millions of items, but
not for most other cases. It gives you 3 lines in functional style
that replace 10 lines of Python loops (longer but arguably much easier
to read). The pure Python version is generally not slower even on
CPython, and on PyPy it allows the JIT to work much better
–
simple
Python code is fast. The same argument also applies to
<tt
class=
"docutils literal"
>
filter()
</tt>
,
<tt
class=
"docutils literal"
>
reduce()
</tt>
, and to some extend
<tt
class=
"docutils literal"
>
map()
</tt>
(although the simple case
is JITted), and to all usages of the
<tt
class=
"docutils literal"
>
operator
</tt>
module we can think
of.
</li>
</ul>
<p>
We generally consider things that are slower on PyPy than CPython to be bugs
of PyPy. If you find some issue that is not documented here,
...
...
This diff is collapsed.
Click to expand it.
source/performance.txt
+
1
−
1
View file @
068ecf60
...
...
@@ -66,7 +66,7 @@
(like ``csv`` and ``cPickle``) are written in C in CPython, but written
natively in pure Python in PyPy. Sometimes the JIT is able to do a
good job on them, and sometimes not. In most cases (like ``csv`` and
``cPickle``), we're slower than
c
Python, with the notable exception of
``cPickle``), we're slower than
C
Python, with the notable exception of
``json`` and ``heapq``.
* **Abuse of itertools**: The itertools module is often "abused" in the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment