Python code optimization may seem easy or hard depending on the performance target. If the target is “best effort”, carefully choosing the algorithm and applying well-known common practices is usually enough. If the target is dictated by the UX, you have to go down a few abstraction layers and hack the system sometimes. Or rewrite the underlying libraries. Or change the language, really. This post is about our experience in Python code optimizations when whatever you do is not fast enough.
Despite several widely acknowledged flaws, Python remains one of the most popular development languages worldwide. The sole fact that for years Python had two different and incompatible versions existing in parallel should have spelled the end for Python given the numerous alternatives available in the market. But Python overcame this conflict. Developers also criticized Python’s design and functionalities. Python is known to be slow and inadequate at dealing with memory-intensive operations.
We’re excited to announce the release of a major update to the Google Cloud Python logging library. v3.0.0 makes it even easier for Python developers to send and read logs from Google Cloud, providing real-time insights into what is happening in your application. If you’re a Python developer working with Google Cloud, now is a great time to try out Cloud Logging! If you're unfamiliar with the `google-cloud-logging` library, getting started is simple.
In this blog post we’ll help answer the age old question, “What does this service talk to and what does it say?” We’ll see how to inspect inbound and outbound REST API calls to see what calls are being made and what incoming traffic causes a reaction. This can be pretty handy when you’re taking over maintenance of an existing service, or if your code just isn’t behaving the way you expect.
Marshmallow is a Python library that converts complex data types to and from Python data types. It is a powerful tool for both validating and converting data. In this tutorial, I will be using Marshmallow to validate a simple bookmarks API where users can save their favorite URLs along with a short description of each site.
Python JSON logging has become the standard for generating readable structured data from logs. While logging in JSON is definitely much better than using the standard logging module, it comes with its own set of challenges. As your server or application grows, the number of logs also increases exponentially. It’s difficult to go through JSON log files, even if it’s structured, due to the sheer size of logs generated.