[英]Comparing wall time and resource usage across different programming environments
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.
例如,如果我在C ++,python中有一个例程,在Matlab中又有一个例程,它们在功能和植入方面都相同,那么我将如何进行客观,可测量的结果比较,以了解哪个是最有效的过程。 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."
请尝试回答这个问题,不要笼统地说:“哦,C ++总是比python更高效,而python总是比Matlab更高效”。
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.
在c ++ , python和matlab中有多种方法可以做到这一点。由于系统调度过程等原因,它们绝对是100%的精度,尽管这是比较前后结果的好方法,但您不必考虑结果。 Good way to get more precision results is to run your code multiple times.
获得更精确结果的好方法是多次运行代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.