Permalink
Browse files

removing util bulk

Constructor utils were somewhat OTT, in the light of trying to
compact things down to a 1-file-size.

closes #12
  • Loading branch information...
1 parent 268de75 commit 4e8a9b315ba8f47a98abcdb5baf4f2a985bc87cf @hughfdjackson committed Feb 22, 2013
Showing with 2,422 additions and 69,596 deletions.
  1. +26 −32 benchmarks/object.js
  2. +1 −5 node_modules/benchmark/package.json
  3. +0 −1 node_modules/multimethod/.npmignore
  4. +0 −154 node_modules/multimethod/README.md
  5. +0 −19 node_modules/multimethod/Rakefile
  6. +0 −186 node_modules/multimethod/docs/docco.css
  7. +0 −116 node_modules/multimethod/docs/multimethod.html
  8. +0 −1 node_modules/multimethod/index.js
  9. +0 −10 node_modules/multimethod/multimethod-min.js
  10. +0 −181 node_modules/multimethod/multimethod.js
  11. +0 −22 node_modules/multimethod/node_modules/underscore/LICENSE
  12. +0 −19 node_modules/multimethod/node_modules/underscore/README
  13. +0 −32 node_modules/multimethod/node_modules/underscore/package.json
  14. +0 −30 node_modules/multimethod/node_modules/underscore/underscore-min.js
  15. +0 −958 node_modules/multimethod/node_modules/underscore/underscore.js
  16. +0 −29 node_modules/multimethod/package.json
  17. +0 −109 node_modules/multimethod/test/multimethod-tests.js
  18. +0 −20 node_modules/multimethod/test/test.html
  19. +0 −19 node_modules/multimethod/test/vendor/jquery.js
  20. +0 −196 node_modules/multimethod/test/vendor/qunit.css
  21. +0 −2,360 node_modules/multimethod/test/vendor/qunit.js
  22. +0 −962 node_modules/multimethod/test/vendor/underscore.js
  23. +0 −2 node_modules/sinon/.npmignore
  24. +0 −3 node_modules/sinon/.travis.yml
  25. +0 −42 node_modules/sinon/AUTHORS
  26. +0 −299 node_modules/sinon/Changelog.txt
  27. BIN node_modules/sinon/GPATH
  28. BIN node_modules/sinon/GRTAGS
  29. BIN node_modules/sinon/GSYMS
  30. BIN node_modules/sinon/GTAGS
  31. +0 −27 node_modules/sinon/LICENSE
  32. +0 −69 node_modules/sinon/README.md
  33. +0 −94 node_modules/sinon/build
  34. +0 −54 node_modules/sinon/jsl.conf
  35. +0 −336 node_modules/sinon/lib/sinon.js
  36. +0 −176 node_modules/sinon/lib/sinon/assert.js
  37. +0 −153 node_modules/sinon/lib/sinon/collection.js
  38. +0 −239 node_modules/sinon/lib/sinon/match.js
  39. +0 −423 node_modules/sinon/lib/sinon/mock.js
  40. +0 −125 node_modules/sinon/lib/sinon/sandbox.js
  41. +0 −537 node_modules/sinon/lib/sinon/spy.js
  42. +0 −355 node_modules/sinon/lib/sinon/stub.js
  43. +0 −75 node_modules/sinon/lib/sinon/test.js
  44. +0 −97 node_modules/sinon/lib/sinon/test_case.js
  45. +0 −74 node_modules/sinon/lib/sinon/util/event.js
  46. +0 −201 node_modules/sinon/lib/sinon/util/fake_server.js
  47. +0 −83 node_modules/sinon/lib/sinon/util/fake_server_with_clock.js
  48. +0 −349 node_modules/sinon/lib/sinon/util/fake_timers.js
  49. +0 −472 node_modules/sinon/lib/sinon/util/fake_xml_http_request.js
  50. +0 −27 node_modules/sinon/lib/sinon/util/timers_ie.js
  51. +0 −19 node_modules/sinon/lib/sinon/util/xhr_ie.js
  52. +0 −3 node_modules/sinon/node_modules/buster-format/.travis.yml
  53. +0 −3 node_modules/sinon/node_modules/buster-format/AUTHORS
  54. +0 −27 node_modules/sinon/node_modules/buster-format/LICENSE
  55. +0 −15 node_modules/sinon/node_modules/buster-format/Readme.md
  56. +0 −10 node_modules/sinon/node_modules/buster-format/jsTestDriver.conf
  57. +0 −199 node_modules/sinon/node_modules/buster-format/lib/buster-format.js
  58. +0 −3 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/.travis.yml
  59. +0 −3 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/AUTHORS
  60. +0 −28 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/LICENSE
  61. +0 −20 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/Readme.md
  62. +0 −17 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/jsTestDriver.conf
  63. +0 −223 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/lib/buster-core.js
  64. +0 −152 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/lib/buster-event-emitter.js
  65. +0 −16 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/lib/define-version-getter.js
  66. +0 −37 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/package.json
  67. +0 −4 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/run-tests
  68. +0 −564 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/test/buster-core-test.js
  69. +0 −417 ...dules/sinon/node_modules/buster-format/node_modules/buster-core/test/buster-event-emitter-test.js
  70. +0 −3 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/buster-util/AUTHORS
  71. +0 −28 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/buster-util/LICENSE
  72. +0 −30 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/buster-util/jstdhtml
  73. +0 −4 ...s/sinon/node_modules/buster-format/node_modules/buster-core/vendor/buster-util/lib/buster-util.js
  74. +0 −52 ...es/buster-format/node_modules/buster-core/vendor/buster-util/lib/buster-util/jstestdriver-shim.js
  75. +0 −106 ...node_modules/buster-format/node_modules/buster-core/vendor/buster-util/lib/buster-util/req-res.js
  76. +0 −29 .../node_modules/buster-format/node_modules/buster-core/vendor/buster-util/lib/buster-util/runner.js
  77. +0 −246 ...de_modules/buster-format/node_modules/buster-core/vendor/buster-util/lib/buster-util/test-case.js
  78. +0 −23 ...modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/buster-util/package.json
  79. +0 −2 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/.npmignore
  80. +0 −3 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/.travis.yml
  81. +0 −33 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/AUTHORS
  82. +0 −269 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/Changelog.txt
  83. +0 −27 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/LICENSE
  84. +0 −69 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/README.md
  85. +0 −93 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/build
  86. +0 −54 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/jsl.conf
  87. +0 −329 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon.js
  88. +0 −176 ...odules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/assert.js
  89. +0 −152 ...es/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/collection.js
  90. +0 −239 ...modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/match.js
  91. +0 −423 ..._modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/mock.js
  92. +0 −125 ...dules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/sandbox.js
  93. +0 −518 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/spy.js
  94. +0 −320 ..._modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/stub.js
  95. +0 −67 ..._modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/test.js
  96. +0 −97 ...les/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/test_case.js
  97. +0 −74 ...es/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/event.js
  98. +0 −201 ...on/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/fake_server.js
  99. +0 −83 ...ules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/fake_server_with_clock.js
  100. +0 −349 ...on/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/fake_timers.js
  101. +0 −471 ...dules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/fake_xml_http_request.js
  102. +0 −27 ...inon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/timers_ie.js
  103. +0 −19 ...s/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/lib/sinon/util/xhr_ie.js
  104. +0 −35 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/package.json
  105. +0 −22 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/node/run.js
  106. +0 −1 ...on/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/resources/xhr_target.txt
  107. +0 −13,989 ...inon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/rhino/env.rhino.1.2.js
  108. +0 −36 ..._modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/rhino/run.js
  109. +0 −122 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/runner.js
  110. +0 −50 ...dules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon-dist.html
  111. +0 −65 node_modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon.html
  112. +0 −1,305 .../sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/assert_test.js
  113. +0 −353 ...on/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/collection_test.js
  114. +0 −637 ...s/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/match_test.js
  115. +0 −957 ...es/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/mock_test.js
  116. +0 −396 ...sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/sandbox_test.js
  117. +0 −2,568 ...les/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/spy_test.js
  118. +0 −1,244 ...es/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/stub_test.js
  119. +0 −260 ...non/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/test_case_test.js
  120. +0 −467 ...es/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/test_test.js
  121. +0 −109 ...on/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/util/event_test.js
  122. +0 −667 ...e_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/util/fake_server_test.js
  123. +0 −216 ...uster-format/node_modules/buster-core/vendor/sinon/test/sinon/util/fake_server_with_clock_test.js
  124. +0 −925 ...e_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon/util/fake_timers_test.js
  125. +0 −1,185 ...buster-format/node_modules/buster-core/vendor/sinon/test/sinon/util/fake_xml_http_request_test.js
  126. +0 −443 ...modules/sinon/node_modules/buster-format/node_modules/buster-core/vendor/sinon/test/sinon_test.js
  127. +0 −38 node_modules/sinon/node_modules/buster-format/package.json
  128. +0 −2 node_modules/sinon/node_modules/buster-format/run-tests
  129. +0 −380 node_modules/sinon/node_modules/buster-format/test/buster-format-test.js
  130. +0 −179 node_modules/sinon/package.json
  131. +0 −13 node_modules/sinon/release.sh
  132. +0 −22 node_modules/sinon/test/node/run.js
  133. +0 −1 node_modules/sinon/test/resources/xhr_target.txt
  134. +0 −13,989 node_modules/sinon/test/rhino/env.rhino.1.2.js
  135. +0 −36 node_modules/sinon/test/rhino/run.js
  136. +0 −122 node_modules/sinon/test/runner.js
  137. +0 −50 node_modules/sinon/test/sinon-dist.html
  138. +0 −65 node_modules/sinon/test/sinon.html
  139. +0 −1,305 node_modules/sinon/test/sinon/assert_test.js
  140. +0 −366 node_modules/sinon/test/sinon/collection_test.js
  141. +0 −655 node_modules/sinon/test/sinon/match_test.js
  142. +0 −957 node_modules/sinon/test/sinon/mock_test.js
  143. +0 −396 node_modules/sinon/test/sinon/sandbox_test.js
  144. +0 −2,640 node_modules/sinon/test/sinon/spy_test.js
  145. +0 −1,397 node_modules/sinon/test/sinon/stub_test.js
  146. +0 −260 node_modules/sinon/test/sinon/test_case_test.js
  147. +0 −475 node_modules/sinon/test/sinon/test_test.js
  148. +0 −109 node_modules/sinon/test/sinon/util/event_test.js
  149. +0 −667 node_modules/sinon/test/sinon/util/fake_server_test.js
  150. +0 −216 node_modules/sinon/test/sinon/util/fake_server_with_clock_test.js
  151. +0 −925 node_modules/sinon/test/sinon/util/fake_timers_test.js
  152. +0 −1,185 node_modules/sinon/test/sinon/util/fake_xml_http_request_test.js
  153. +0 −443 node_modules/sinon/test/sinon_test.js
  154. +1 −0 node_modules/string-hash/package.json
  155. +2 −1 node_modules/{multimethod/node_modules → }/underscore/.npmignore
  156. +5 −0 node_modules/underscore/.travis.yml
  157. +1 −0 node_modules/underscore/CNAME
  158. +9 −0 node_modules/underscore/CONTRIBUTING.md
  159. +1 −1 node_modules/{multimethod → underscore}/LICENSE
  160. +19 −0 node_modules/underscore/README.md
  161. BIN node_modules/underscore/favicon.ico
  162. +1,053 −312 node_modules/{multimethod/node_modules → }/underscore/index.html
  163. 0 node_modules/{multimethod/node_modules → }/underscore/index.js
  164. +32 −0 node_modules/underscore/package.json
  165. +1 −0 node_modules/underscore/underscore-min.js
  166. +1,226 −0 node_modules/underscore/underscore.js
  167. +21 −19 src/dict.js
  168. +22 −15 src/list.js
  169. +1 −27 src/util.js
  170. +1 −2 test/dict-test.js
View
@@ -1,18 +1,19 @@
var Benchmark = new require('benchmark')
+var _ = require('underscore')
var genProp = function(){
var o = {}
o[Math.random()] = Math.random()
return o
}
-var genObj = function(p, n){
+var genObj = _.memoize(function(p, n){
var o = p.dict({})
for ( var i = 0; i < n; i +=1 ) {
o = o.set(genProp())
}
return o
-}
+})
var testSet = function(p, n){
@@ -62,49 +63,44 @@ var test = function(p, version){
return suite
.add(version + ': has 1', testHas(p, 1))
- .add(version + ': has 3', testHas(p, 3))
- .add(version + ': has 5', testHas(p, 5))
- .add(version + ': has 10', testHas(p, 10))
- .add(version + ': has 25', testHas(p, 25))
+ // .add(version + ': has 3', testHas(p, 3))
+ // .add(version + ': has 5', testHas(p, 5))
+ // .add(version + ': has 10', testHas(p, 10))
+ // .add(version + ': has 25', testHas(p, 25))
.add(version + ': has 100', testHas(p, 100))
.add(version + ': has 1000', testHas(p, 1000))
- .add(version + ': has 10000', testHas(p, 10000))
.add(version + ': get 1', testGet(p, 1))
- .add(version + ': get 3', testGet(p, 3))
- .add(version + ': get 5', testGet(p, 5))
- .add(version + ': get 10', testGet(p, 10))
- .add(version + ': get 25', testGet(p, 25))
+ // .add(version + ': get 3', testGet(p, 3))
+ // .add(version + ': get 5', testGet(p, 5))
+ // .add(version + ': get 10', testGet(p, 10))
+ // .add(version + ': get 25', testGet(p, 25))
.add(version + ': get 100', testGet(p, 100))
.add(version + ': get 1000', testGet(p, 1000))
- .add(version + ': get 10000', testGet(p, 10000))
.add(version + ': set 1', testSet(p, 1))
- .add(version + ': set 3', testSet(p, 3))
- .add(version + ': set 5', testSet(p, 5))
- .add(version + ': set 10', testSet(p, 10))
- .add(version + ': set 25', testSet(p, 25))
+ // .add(version + ': set 3', testSet(p, 3))
+ // .add(version + ': set 5', testSet(p, 5))
+ // .add(version + ': set 10', testSet(p, 10))
+ // .add(version + ': set 25', testSet(p, 25))
.add(version + ': set 100', testSet(p, 100))
.add(version + ': set 1000', testSet(p, 1000))
- .add(version + ': set 10000', testSet(p, 10000))
.add(version + ': remove 1', testRemove(p, 1))
- .add(version + ': remove 3', testRemove(p, 3))
- .add(version + ': remove 5', testRemove(p, 5))
- .add(version + ': remove 10', testRemove(p, 10))
- .add(version + ': remove 25', testRemove(p, 25))
+ // .add(version + ': remove 3', testRemove(p, 3))
+ // .add(version + ': remove 5', testRemove(p, 5))
+ // .add(version + ': remove 10', testRemove(p, 10))
+ // .add(version + ': remove 25', testRemove(p, 25))
.add(version + ': remove 100', testRemove(p, 100))
.add(version + ': remove 1000', testRemove(p, 1000))
- .add(version + ': remove 10000', testRemove(p, 10000))
.add(version + ': transient 1', testTransient(p, 1))
- .add(version + ': transient 3', testTransient(p, 3))
- .add(version + ': transient 5', testTransient(p, 5))
- .add(version + ': transient 10', testTransient(p, 10))
- .add(version + ': transient 25', testTransient(p, 25))
+ // .add(version + ': transient 3', testTransient(p, 3))
+ // .add(version + ': transient 5', testTransient(p, 5))
+ // .add(version + ': transient 10', testTransient(p, 10))
+ // .add(version + ': transient 25', testTransient(p, 25))
.add(version + ': transient 100', testTransient(p, 100))
.add(version + ': transient 1000', testTransient(p, 1000))
- .add(version + ': transient 10000', testTransient(p, 10000))
.on('cycle', function(event) {
var bench = event.target
@@ -121,11 +117,9 @@ var test = function(p, version){
console.log( '---\nFastest:', this.filter('fastest').pluck('name').join(', '))
})
- .run({
- async: true
- })
+ .run()
}
-test(require('../versions/0.7.0'), '0.7.0')
-test(require('../versions/0.6.0'), '0.6.0')
test(require('..'), 'current')
+test(require('../versions/0.7.0'), '0.7.0')
+//test(require('../versions/0.6.0'), '0.6.0')

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 4e8a9b3

Please sign in to comment.