Comparing wall time and resource usage across different programming environments

88 Views Asked by At

Is there a particular software resource monitor that researchers or academics use to compare execution time and other resource usage metrics between programming environments? For instance, if I have a routine in C++, python and another in Matlab, that are all identical in function and similar implantations -how would I make an objective, measurable result comparison as to which was the most efficient process. Likewise is it a tool that could also analyze performance between versions of the same code to track improvements in processing efficiency. Please try to answer this question without generalizations like "oh, C++ is always more efficient than python and python will always be more efficient than Matlab."

1

There are 1 best solutions below

0
Dmitrii Z. On

The correct way is to write tests. Get current time before actual algo starts, and get current time after it ends. There are ways to do that in c++, python and matlab You must not think of results as they are 100% precision because of system scheduling process etc, though it is a good way to compare before-after results. Good way to get more precision results is to run your code multiple times.