Is stopwatch benchmarking acceptable?

后端 未结 13 2222
夕颜
夕颜 2020-11-28 03:07

Does anyone ever use stopwatch benchmarking, or should a performance tool always be used? Are there any good free tools available for Java? What tools do you use?

13条回答
  •  难免孤独
    2020-11-28 03:37

    How do you address operating system scheduling when benchmarking?

    Benchmark for long enough on a system which is representative of the machine you will be using. If your OS slows down your application, then that should be part of the result.

    There is no point in saying, my program would be faster, if only I didn't have an OS.

    If you are using Linux, you can use tools such as numactl, chrt and taskset to control how CPUs are used and the scheduling.

提交回复
热议问题