babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

Unit test framework circumvents standard profilers #60

Closed jarrodmcc closed 7 years ago

jarrodmcc commented 7 years ago

The current unit test framework circumvents the use of standard profilers for some reason.
E.g.

python -m cProfile -o profile_test -s cumtime hydrogen_integration_test.py


Ran 0 tests in 0.000s

OK

vs

python hydrogen_integration_test.py .

Ran 1 test in 4.366s

OK

It's not strictly necessary to be able to profile our unit tests specifically, but it's at least one convenient avenue for identifying unexpected sticking points. Alternative solutions include a different set of benchmarks that don't use "unittest" to identify this type of issue.

As we continue to engineer the code more and more, it's important to have performance tests as well, to make sure introducing a convenient abstraction didn't slow the code down by 50%.