【发布时间】:2016-12-06 20:32:04
【问题描述】:
以下执行时间的差异是真的吗?
library(microbenchmark)
microbenchmark(x = NULL, x <- NULL, times = 100e3)
Unit: nanoseconds
expr min lq mean median uq max neval
x 0 0 0.60819 0 0 8426 1e+05
x <- NULL 0 0 1.75101 0 1 8727 1e+05
我收到警告,大约 75% 的评估的执行时间为非正数。尽管如此,每次我运行它时,我都会得到一致的结果:平均而言,x = NULL 比 x <- NULL 快。
【问题讨论】:
-
call 和 same C function。没有性能差异。
标签: r performance microbenchmark