diff options
author | isaacs <i@izs.me> | 2012-03-23 03:43:28 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-03-23 03:43:28 +0400 |
commit | a7cd76bb3b3c0696d61c600d9b91e5e97cbb6367 (patch) | |
tree | 4f5b03a19a6689f94ae81c6bd8bd26495c6aa890 | |
parent | 67f1778065b4f1d96a59f5290c57061c1808feb8 (diff) |
Remove unused fast-list module from npm
-rw-r--r-- | deps/npm/node_modules/fast-list/.npmignore | 1 | ||||
-rw-r--r-- | deps/npm/node_modules/fast-list/.travis.yml | 4 | ||||
-rw-r--r-- | deps/npm/node_modules/fast-list/README.md | 116 | ||||
-rw-r--r-- | deps/npm/node_modules/fast-list/fast-list.js | 144 | ||||
-rw-r--r-- | deps/npm/node_modules/fast-list/package.json | 20 |
5 files changed, 0 insertions, 285 deletions
diff --git a/deps/npm/node_modules/fast-list/.npmignore b/deps/npm/node_modules/fast-list/.npmignore deleted file mode 100644 index c2658d7d1b3..00000000000 --- a/deps/npm/node_modules/fast-list/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/fast-list/.travis.yml b/deps/npm/node_modules/fast-list/.travis.yml deleted file mode 100644 index f1d0f13c8a5..00000000000 --- a/deps/npm/node_modules/fast-list/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/deps/npm/node_modules/fast-list/README.md b/deps/npm/node_modules/fast-list/README.md deleted file mode 100644 index 88a842ef0e0..00000000000 --- a/deps/npm/node_modules/fast-list/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# The Problem - -You've got some thing where you need to push a bunch of stuff into a -queue and then shift it out. Or, maybe it's a stack, and you're just -pushing and popping it. - -Arrays work for this, but are a bit costly performance-wise. - -# The Solution - -A linked-list implementation that takes advantage of what v8 is good at: -creating objects with a known shape. - -This is faster for this use case. How much faster? About 50%. - - $ node bench.js - benchmarking /Users/isaacs/dev-src/js/fast-list/bench.js - Please be patient. - { node: '0.6.2-pre', - v8: '3.6.6.8', - ares: '1.7.5-DEV', - uv: '0.1', - openssl: '0.9.8l' } - Scores: (bigger is better) - - new FastList() - Raw: - > 22556.39097744361 - > 23054.755043227666 - > 22770.398481973436 - > 23414.634146341465 - > 23099.133782483157 - Average (mean) 22979.062486293868 - - [] - Raw: - > 12195.121951219513 - > 12184.508268059182 - > 12173.91304347826 - > 12216.404886561955 - > 12184.508268059182 - Average (mean) 12190.891283475617 - - new Array() - Raw: - > 12131.715771230503 - > 12184.508268059182 - > 12216.404886561955 - > 12195.121951219513 - > 11940.298507462687 - Average (mean) 12133.609876906768 - - Winner: new FastList() - Compared with next highest ([]), it's: - 46.95% faster - 1.88 times as fast - 0.28 order(s) of magnitude faster - - Compared with the slowest (new Array()), it's: - 47.2% faster - 1.89 times as fast - 0.28 order(s) of magnitude faster - -This lacks a lot of features that arrays have: - -1. You can't specify the size at the outset. -2. It's not indexable. -3. There's no join, concat, etc. - -If any of this matters for your use case, you're probably better off -using an Array object. - -## Installing - -``` -npm install fast-list -``` - -## API - -```javascript -var FastList = require("fast-list") -var list = new FastList() -list.push("foo") -list.unshift("bar") -list.push("baz") -console.log(list.length) // 2 -console.log(list.pop()) // baz -console.log(list.shift()) // bar -console.log(list.shift()) // foo -``` - -### Methods - -* `push`: Just like Array.push, but only can take a single entry -* `pop`: Just like Array.pop -* `shift`: Just like Array.shift -* `unshift`: Just like Array.unshift, but only can take a single entry -* `drop`: Drop all entries -* `item(n)`: Retrieve the nth item in the list. This involves a walk - every time. It's very slow. If you find yourself using this, - consider using a normal Array instead. -* `map(fn, thisp)`: Like `Array.prototype.map`. Returns a new FastList. -* `reduce(fn, startValue, thisp)`: Like `Array.prototype.reduce` -* `forEach(fn, this)`: Like `Array.prototype.forEach` -* `filter(fn, thisp)`: Like `Array.prototype.filter`. Returns a new - FastList. -* `slice(start, end)`: Retrieve an array of the items at this position. - This involves a walk every time. It's very slow. If you find - yourself using this, consider using a normal Array instead. - -### Members - -* `length`: The number of things in the list. Note that, unlike - Array.length, this is not a getter/setter, but rather a counter that - is internally managed. Setting it can only cause harm. diff --git a/deps/npm/node_modules/fast-list/fast-list.js b/deps/npm/node_modules/fast-list/fast-list.js deleted file mode 100644 index 692db0df8f5..00000000000 --- a/deps/npm/node_modules/fast-list/fast-list.js +++ /dev/null @@ -1,144 +0,0 @@ -;(function() { // closure for web browsers - -function Item (data, prev, next) { - this.next = next - if (next) next.prev = this - this.prev = prev - if (prev) prev.next = this - this.data = data -} - -function FastList () { - if (!(this instanceof FastList)) return new FastList - this._head = null - this._tail = null - this.length = 0 -} - -FastList.prototype = -{ push: function (data) { - this._tail = new Item(data, this._tail, null) - if (!this._head) this._head = this._tail - this.length ++ - } - -, pop: function () { - if (this.length === 0) return undefined - var t = this._tail - this._tail = t.prev - if (t.prev) { - t.prev = this._tail.next = null - } - this.length -- - if (this.length === 1) this._head = this._tail - else if (this.length === 0) this._head = this._tail = null - return t.data - } - -, unshift: function (data) { - this._head = new Item(data, null, this._head) - if (!this._tail) this._tail = this._head - this.length ++ - } - -, shift: function () { - if (this.length === 0) return undefined - var h = this._head - this._head = h.next - if (h.next) { - h.next = this._head.prev = null - } - this.length -- - if (this.length === 1) this._tail = this._head - else if (this.length === 0) this._head = this._tail = null - return h.data - } - -, item: function (n) { - if (n < 0) n = this.length + n - var h = this._head - while (n-- > 0 && h) h = h.next - return h ? h.data : undefined - } - -, slice: function (n, m) { - if (!n) n = 0 - if (!m) m = this.length - if (m < 0) m = this.length + m - if (n < 0) n = this.length + n - - if (m === n) { - return [] - } - - if (m < n) { - throw new Error("invalid offset: "+n+","+m+" (length="+this.length+")") - } - - var len = m - n - , ret = new Array(len) - , i = 0 - , h = this._head - while (n-- > 0 && h) h = h.next - while (i < len && h) { - ret[i++] = h.data - h = h.next - } - return ret - } - -, drop: function () { - FastList.call(this) - } - -, forEach: function (fn, thisp) { - var p = this._head - , i = 0 - , len = this.length - while (i < len && p) { - fn.call(thisp || this, p.data, i, this) - p = p.next - i ++ - } - } - -, map: function (fn, thisp) { - var n = new FastList() - this.forEach(function (v, i, me) { - n.push(fn.call(thisp || me, v, i, me)) - }) - return n - } - -, filter: function (fn, thisp) { - var n = new FastList() - this.forEach(function (v, i, me) { - if (fn.call(thisp || me, v, i, me)) n.push(v) - }) - return n - } - -, reduce: function (fn, val, thisp) { - var i = 0 - , p = this._head - , len = this.length - if (!val) { - i = 1 - val = p && p.data - p = p && p.next - } - while (i < len && p) { - val = fn.call(thisp || this, val, p.data, this) - i ++ - p = p.next - } - return val - } -} - -if ("undefined" !== typeof(exports)) module.exports = FastList -else if ("function" === typeof(define) && define.amd) { - define("FastList", function() { return FastList }) -} else (function () { return this })().FastList = FastList - -})() diff --git a/deps/npm/node_modules/fast-list/package.json b/deps/npm/node_modules/fast-list/package.json deleted file mode 100644 index 9bcc6b41337..00000000000 --- a/deps/npm/node_modules/fast-list/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", - "name": "fast-list", - "description": "A fast linked list (good for queues, stacks, etc.)", - "version": "1.0.2", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fast-list.git" - }, - "main": "fast-list.js", - "dependencies": {}, - "devDependencies": { - "bench": "~0.3.2", - "tap": "~0.1.0" - }, - "scripts": { - "test": "tap test.js", - "bench": "node bench.js" - } -} |