更新时间:2023-11-08 21:13:22
http://jsperf.com for more accurate benchmarking and fancy graphs. I made one: http://jsperf.com/empty-vs-check
This is micro-optimization. NOBODY WILL EVER NOTICE A DIFFERENCE. There's a difference of less than a half a second for a billion iterations, which will never happen. Do what you think is more readable; don't worry about performance.