rtviz Tutorial

Introduction

rtviz is a small library for visualizing the runtimes of certain functions in python.

rtviz works by mapping a function over a list of lists and plotting the runtime of each function call agains the length of the list element.

Installation


In [1]:
from rtviz import rtviz
%matplotlib inline

In [2]:
help(rtviz)


Help on function rtviz in module rtviz.main:

rtviz(func, *args, max_size=1000, num_samples=500, viz=True, verbose=True)
    Takes in a function that receives an iterable as input.
    Returns a plot of the runtimes over iterables of random integers of increasing length.
    
    func: a function that acts on an iterable


In [4]:
rtviz(sorted)


sorted took 105.267ms.

In [ ]: