Google Cloud Platform Blog
Product updates, customer stories, and tips and tricks on Google Cloud Platform
Upgrading to Python 2.7: simple and practical
Tuesday, November 6, 2012
We launched a major improvement to the Python runtime when we introduced support for Python 2.7 last February. It has since proven to be astonishingly popular – just a few months later more than half of all active Python applications on App Engine are using Python 2.7.
What’s so great about Python 2.7? It isn’t just a language update, it also includes a number of features that can help your apps run much more efficiently.
Increase efficiency with concurrent requests
. Now a single frontend instance can handle multiple requests at the same time in separate threads. This means App Engine requires fewer frontend instances to handle the traffic, which can lead to significant cost savings.
Rapidly growing mobile gaming company
Pocket Gems
reduced the cost of running their front-end instances by 78% when they switched to to the Python 2.7 runtime. “We immediately saw a dramatic difference” said engineering director David Underhill “We only need one third as many instances under Python 2.7 as we did under 2.5 to handle the same traffic”.
Move faster with more native C modules.
In Python 2.7 we’ve added more native C modules to App Engine. Core libraries like cPickle run much faster than the equivalent pure Python library available in the Python 2.5 runtime.
Take advantage of popular third-party libraries like PIL and numpy
. We’ve greatly expanded the number of third party libraries available for use in App Engine in Python 2.7. So far we’ve added the Python Imaging Library (PIL), lxml, numpy,
and several others
.
Best of all, upgrading won't require lots of code changes. “It was pretty straightforward,” says Underhill. “We had to be careful, but we ended up needing to change less than 0.4% of the code”.
If you're ready to make the switch, check out our
migration guide
,
find out more about the other great features
of the Python 2.7 runtime and get in-depth tips from the App Engine Python team by
watching their talk on Migrating to Python 2.7
at Google I/O 2012.
- Posted by Andrew Jessup, Product Manager, Google App Engine
Free Trial
GCP Blogs
Big Data & Machine Learning
Kubernetes
GCP Japan Blog
Firebase Blog
Apigee Blog
Popular Posts
World's largest event dataset now publicly available in BigQuery
A look inside Google’s Data Center Networks
Enter the Andromeda zone - Google Cloud Platform’s latest networking stack
Using labels to organize Google Cloud Platform resources
New in Google Cloud Storage: auto-delete, regional buckets and faster uploads
Labels
Announcements
193
Big Data & Machine Learning
134
Compute
271
Containers & Kubernetes
92
CRE
27
Customers
107
Developer Tools & Insights
151
Events
38
Infrastructure
44
Management Tools
87
Networking
43
Open
1
Open Source
135
Partners
102
Pricing
28
Security & Identity
85
Solutions
24
Stackdriver
24
Storage & Databases
164
Weekly Roundups
20
Feed
Subscribe by email
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.
Learn More
Technical questions? Check us out on
Stack Overflow
.
Subscribe to
our monthly newsletter
.
Google
on
Follow @googlecloud
Follow
Follow