Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Python (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Performance=== A perforance comparison among various Python implementations, using a non-numerical (combinatorial) workload, was presented at EuroSciPy '13.<ref>{{cite conference |title=Performance of Python runtimes on a non-numeric scientific code |last=Murri |first=Riccardo |conference=European Conference on Python in Science (EuroSciPy) |year=2013 |arxiv=1404.6388|bibcode=2014arXiv1404.6388M}}</ref> In addition, Python's performance relative to other programming languages is benchmarked by [[The Computer Language Benchmarks Game]].<ref>{{cite web|title=The Computer Language Benchmarks Game|url=https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html|access-date=30 April 2020|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614210246/https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html|url-status=live}}</ref> There are several approaches to optimizing Python performance, given the inherent slowness of an [[interpreted language]]. These approaches include the following strategies or tools: * [[Just-in-time compilation]]: Dynamically compiling Python code just before it is executed. This technique is used in libraries such as [[Numba]] and [[PyPy]]. * [[Compiler|Static compilation]]: Python code is compiled into machine code sometime before execution. An example of this approach is Cython, which compiles Python into C. * Concurrency and parallelism: Multiple tasks can be run simultaneously. Python contains modules such as `multiprocessing` to support this form of parallelism. Moreover, this approach helps to overcome limitations of the [[Global interpreter lock|Global Interpreter Lock]] (GIL) in CPU tasks. * Efficient data structures: Performance can also be improved by using data types such as <code>Set</code> for membership tests, or <code>deque</code> from <code>collections</code> for [[Queueing theory|queue]] operations.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)