Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Created December 5, 2014 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yutannihilation/30e394ac580058f3bce7 to your computer and use it in GitHub Desktop.
Save yutannihilation/30e394ac580058f3bce7 to your computer and use it in GitHub Desktop.
speed of `base::+` and `.Primitive("+")`
> a <- runif(1000,1,10)
> microbenchmark(base::`+`(a, a), .Primitive("+")(a,a))
Unit: microseconds
expr min lq mean median uq max neval
base::`+`(a, a) 14.527 16.483 28.85315 19.556 20.6730 716.852 100
.Primitive("+")(a, a) 5.308 6.147 9.96258 9.220 10.1975 49.448 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment