dimanche 21 avril 2019

Platform independent performance test for python code

I am adding continuous integration tests for a Python module. I need to estimate whether the performance of the code degraded due to the last code update. The current CI server runs on AWS and the type of hardware may vary in the future so timeit and other time-based modules are irrelevant.

def heavy_module():
    do_stuff()

# platform independent test
def test_heavy_module():
    if operations(heavy_module) > 1000000:
        raise Exception('performance degragetion')   

Aucun commentaire:

Enregistrer un commentaire