High Performance Python: Profiling

Note

This article is part of an ongoing series about profiling Python programs that starts here [4].

Note

This text is a draft and may be subject to changes.

There are two things we can profile, execution time and memory consumption.

Profiling Execution Time, Part I

From the Linux command ...

more ...

The Fighty Engine

Note

This article is part of an ongoing series about profiling Python programs that starts here. You may skip this article if you are only interested in profiling, and not in the game details.

The player character of a typical RPG has a set of attributes which describe her stats ...

more ...

High Performance Python: Prima Facie

Table of Contents

Introduction

Once in a while memories of old pet projects (or imagined pet projects) bubble up again. This time it was fighty.

Many years ago friends and I played an online browser game called The Arena (which still ...

more ...

Python UnitTest Discover Quirks

Pelican contains a test suite that uses Python’s UnitTest 2 [1], and working on Pelican’s source I had run that suite from time to time.

Yesterday, however, I was delighted with this:

$ unit2 discover -v

tests.test_settings (unittest2.loader.ModuleImportFailure) ... ERROR
tests.test_importer (unittest2.loader.ModuleImportFailure) ... ERROR
tests ...
more ...

Python 3 Unicode-Bytes Quirks

Imagine in your program you compare two variables which contain strings. You are pretty sure that under certain circumstances both variables contain the same strings, — but somehow Python insists that they do not!

For a quick debug, you print out both variables and get

>>> print(s1, s2, s1 == s2)
b ...
more ...