Google Application Engine: Profiling your python App


What would you do if you think that an application have some performance issues?. Where do we start?… it’s a tough question. I think it’s possible to start by try to know where the bottle-neck is. So, In order to do this a profiler seems to be a good option.

If you’re using Google Application Engine with Python, then check out this post about how to enable the profiler

Luckily you will enable the output easily. Now you need to understand the meaning of each reported data, so checkout this article about profile in the python’s site.

This basically will help you to find out where the bottle-neck is, sadly it does not say how to solve it ;p.


Google Apps Engine: Python’s Way


As part of my welcome pack for developing in Google Application Engine (aka GAE), I had to chose between two languages: Java or Python. Because of my most recent work involves C# most of the time, the most obvious option wasJava. However, the client has their systems in Pyhon… so? I’m mastering Python in 3 days ;-).


My first approach was reading the language specification (it wasn’t a very smart option). So, my second attempt was using Wikipedia (aka wiki) to know more Python. Luckily Wiki has a good idea of how to define Python‘s language.

It might emphasize some points:

  • Python is a high-level programming language ( It means, that you don’t have to think as if you were coding for assembler)
  • It supports many programming paradigms (imperative, functional and object oriented). IMHO it’s a really strong functional programming language.
  • The syntax is simple to read, however I think if you aren’t familiar with functional languages, it would be good to start reading the tutorial instead of getting directly into the code. If you need to check some functional programming concepts you can take a look to
  • The language has a set of implementations (or flavors). So the main concepts are shared among implementations, however there might be particular details in some specific flavors. BTW, some popular flavors are CPhyton, IronPython, Python, and JPhython.


First of all, you’ll need to get Python at Then, you can decide if you want to use an IDE or just a text editor. I strongly recommend to read the Pythons official tutorial at,  (and sadly I cannot explain python in a post, and it will be impossible for being a novice on this language ).


Then if you want to install Google’s App Engine, it might be a good moment for doing it.  ;-), it can be downloaded at Certainly you might need to add additional packages to your python installation depending on what need to do.


Another important aspect of learning a new language is selecting the right tool. Ok, here there are some purists that suggest to learn by using simple text editors instead of an advance IDE for developing. It’s up to you whether or not to use an IDE.

Now, let’s talk about the tool. The best free tool I’ve found it’s Eclipse ( you can use a plugin called Pydev ( in order to support pythons develelopment.  At this time pydev offers a really nice set of tools, such as:

  • debugging
  • code coverage
  • code snippets
  • refactoring
  • code auto-completion
  • And all the other steroids that are already included in Eclipse (such as projects structure, the chance to integrate to a source control tool… etc)

I can suggest to see the following link in order to get quick getting started about how to set up eclipse and python.  The video might be outdated, however this guy goes direct to the point in how to set up your environment and take advantage of the pydev plugin see at

If you wan to know more about pydev and it can do for you, you can check

I’m running out of time, so this is it for today. Unfortunately, I haven’t became the Pythons expert that I wanted… however I’ve spent only 3 days reading about python ;-).  It’s a good start for me (considering that python is not the only thing that I’m learning …. sigh ….)

Anyway, happy coding!