Gozala / reducers

Library for higher-order manipulation of collections
MIT License
181 stars 8 forks source link

Benchmarks #49

Open Raynos opened 11 years ago

Raynos commented 11 years ago
var fold = require("reducers/fold")

var it = function () {}
var list = []
var initial = {}

// 7 ~ 30ms
for (var i = 0; i < 100000; i++) {
  list.reduce(it, initial)
}

// 100 ~ 500ms
for (var i = 0; i < 100000; i++) {
  fold(list, it, initial)
}

fold is almost two orders of magnitude slower then Array.prototype.reduce :(

This should probably be fixed.