AcademySoftwareFoundation / Imath

Imath is a C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics
https://imath.readthedocs.io
BSD 3-Clause "New" or "Revised" License
362 stars 106 forks source link

Investigate performance metrics #6

Open cary-ilm opened 4 years ago

cary-ilm commented 4 years ago

Investigate how to measure execution performance, to detect regressions.

cary-ilm commented 4 years ago

I think the best approach to performance metrics for Imath is to implement a suite of tests at the python level, since any regression introduced at the C++ level (extra memory copy, unnecessary data initialization, etc) should be relatively easy to expose in computations in python objects, and with numpy arrays.

Then, we can build two different versions of the python imath module, one baseline version and one with the current version of Imath, compiled with unique namespaces. Then compare metrics, which means the "before" and "after" numbers are coming from the same process running on the same CPU. There will still be variation, but this should minimize it.

So, I think we should start with a suite of tests that measure the performance of creating, initializing, copying, and operating on imath array objects. We should also run gcov on these tests and make sure they reach full code coverage.