Try pypy and pythonpypy.

Source: Internet
Author: User

Try pypy and pythonpypy.

Pypy is a python interpreter and JIT compiler. Python code performance can be greatly improved without modifying any code.

It is super easy to use. download and install the compiled Binary Package on the official website, and then specify the interpreter when running the code.

Let's try the following code.

Import timet1 = time. time () I = 10000000 while I: I-= 1 print time. time ()-t1


It's actually 25 times different!


However, pypy is not ideal for code speed-up with IO operations, but is slower in some cases.

There is also compatibility issues with third-party libraries.

In short, we need to use pypy for scenarios involving numerical computation and mass circulation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.