26.2 Profiling

There are numerous ways to profile software. Some profilers dig directly into system memory, while others are Python tools that aggregate all the information of your process, providing an in-depth look at all that is going on in Python’s bytecode.

For our purposes, such tools are overkill. We don’t have any users: we don’t know what our most viewed webpages are, or what our most used features are. It makes no sense to profile at such a low level when we can’t even target the right webpage or feature. When it comes to profiling and optimization, information is key. Without it, you are usually wasting your time pre-optimizing your code.

Even so, there are several basic optimizations that we can make before we launch our website. ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.