Benchmarks

September 9, 2015 ยท View on GitHub

As mentioned in the readme, wrapped methods are roughly from 6 times to 400 times slower, but the good part is that they're fast enough for most cases anyway. In any case, you can judge by yourself.

The numbers under the "Native" and "Wrapped" columns are the times the methods get executed in a second, respectively in their native and wrapped versions. The "Times slower" column is nothing more than the ratio between those values, showing how many times the wrapped version is slower than its native counterpart.

Desktop/server

Test platforms:

  • node.js, Edge, IE and Firefox on Windows 10 64 bit (Intel Core i7-4702, 2.2 GHz, 8 GB RAM)

Firefox 42

MethodNativeWrappedTimes slower
push25417829.66543275.6346.79
pop7860866.30677851.7611.60
unshift14044179.39510869.7727.49
shift6914513.50655179.4310.55
splice2995672.07497946.076.02

Edge 20

MethodNativeWrappedTimes slower
push54767474.31224397.80244.06
pop17836266.04319777.5755.78
unshift42150329.96287599.60146.56
shift22004442.66308611.5671.30
splice7153927.19154216.8246.39

Internet Explorer 11

MethodNativeWrappedTimes slower
push67207010.31153079.86439.03
pop19568671.29226766.5086.29
unshift61131116.39153108.35399.27
shift32824464.61266664.56123.09
splice7139044.25127588.3255.95

Node.js 0.10.40

MethodNativeWrappedTimes slower
push45629360.74344638.00132.40
pop48703376.85351396.30138.60
unshift35820837.05337823.47106.03
shift19675249.29338654.3558.10
splice10476493.27327468.5931.99

Mobile

Test platforms:

  • Firefox 40 on Samsung Galaxy Note 3 with Android 5.0 (Qualcomm Snapdragon 800, quad core, 2.3 GHz, 3 GB RAM)
  • Safari 8 on iPhone 5 with iOS 8.4 (Apple A6, dual core, 1.3 GHz, 1 GB RAM)
  • IE Mobile on Nokia Lumia 820 with Windows Phone 8.1 (Qualcomm Snapdragon S4 Plus, 1.5 GHz, 1 GB RAM)

Firefox 40

MethodNativeWrappedTimes slower
push6693456.0439537.94169.29
pop3198455.2528403.75112.61
unshift4958252.7337789.83131.21
shift1562613.2115324.80101.97
splice927863.7032838.0028.26

Safari 8

MethodNativeWrappedTimes slower
push5368891.57133325.5840.27
pop39911211.76229963.86173.55
unshift5833209.88129235.2945.14
shift2396270.59144764.7116.55
splice1824675.32107976.1916.90

IE Mobile

MethodNativeWrappedTimes slower
push13773883.1917019.24809.31
pop5193937.6723500.54221.01
unshift7586075.9917224.12440.43
shift2927335.6223124.06126.59
splice1133894.1713962.8481.21