How to compare performance of two pieces of codes

前端 未结 7 1417
春和景丽
春和景丽 2020-12-29 11:25

I have a friendly competition with couple of guys in the field of programming and recently we have become so interested in writing efficient code. Our challenge was to try t

7条回答
  •  执念已碎
    2020-12-29 12:00

    It is quite difficult to calculate the detailing number of cpu time from a block of code. The normal way to do this is to design the worse / average / best input data as test cases. And do a timing profiling based on your real code with these test cases. There is no any tool can tell you the flops when it is without the detailing input test data and conditions.

提交回复
热议问题