add version of Richards that uses super() by carljm · Pull Request #271 · python/pyperformance
Currently, none of the benchmarks in pyperformance exercise super() method calls significantly. But real-world modern object-oriented Python code often does (one source: Instagram server codebase uses lots of super() method calls, some in hot paths.)
To correct this gap in visibility, this PR adds a copy of the Richards benchmark that is modified to use super() calls. Existing super-method calls that were done by naming the base class directly (Task.__init__(self, ...)) are modified to use super(), and the already-polymorphic Task.fn method is modified slightly such that overrides now call up to the base method using super().
If we accept that Richards is a roughly reasonable representation of some object-oriented Python code, I think this is a similarly reasonable representation of the real-world use of super() in such code.
Thanks to @pablogsal for this suggestion.