array-unique icon indicating copy to clipboard operation
array-unique copied to clipboard

Bench1

Open nickkolok opened this issue 7 years ago • 0 comments

Well, currently using functions seem to be not optimal; moreover, there is no immutable API in arr-uniq.

math@ubuntu:~/git/array-unique$ js benchmark/index.js 
Benchmarking: (3 of 3)
 · long
 · med
 · short

# benchmark/fixtures/long.js (76 bytes)
  actual-using-immutable x 3.24 ops/sec ±2.53% (11 runs sampled)
  actual-using x 5.96 ops/sec ±0.07% (18 runs sampled)
  filter x 24.27 ops/sec ±0.29% (42 runs sampled)
  for-in x 278 ops/sec ±0.87% (81 runs sampled)
  linear-search-01 x 7.13 ops/sec ±0.06% (21 runs sampled)
  set-immutable: 
  set x 666 ops/sec ±0.85% (89 runs sampled)
  while-hash-in x 335 ops/sec ±2.74% (81 runs sampled)
  while-hash x 327 ops/sec ±1.12% (85 runs sampled)
  while x 28.76 ops/sec ±0.21% (49 runs sampled)

  fastest is set

# benchmark/fixtures/med.js (74 bytes)
  actual-using-immutable x 1,345 ops/sec ±0.32% (90 runs sampled)
  actual-using x 3,150 ops/sec ±0.04% (92 runs sampled)
  filter x 4,660 ops/sec ±1.49% (92 runs sampled)
  for-in x 6,438 ops/sec ±0.83% (91 runs sampled)
  linear-search-01 x 4,526 ops/sec ±1.07% (91 runs sampled)
  set-immutable: 
  set x 16,264 ops/sec ±1.99% (90 runs sampled)
  while-hash-in x 7,392 ops/sec ±1.46% (89 runs sampled)
  while-hash x 7,149 ops/sec ±1.57% (89 runs sampled)
  while x 19,108 ops/sec ±0.51% (92 runs sampled)

  fastest is while

# benchmark/fixtures/short.js (73 bytes)
  actual-using-immutable x 543,050 ops/sec ±0.65% (91 runs sampled)
  actual-using x 3,862,035 ops/sec ±0.16% (92 runs sampled)
  filter x 245,017 ops/sec ±0.64% (87 runs sampled)
  for-in x 246,300 ops/sec ±1.44% (89 runs sampled)
  linear-search-01 x 4,029,468 ops/sec ±0.76% (89 runs sampled)
  set-immutable: 
  set x 541,598 ops/sec ±0.68% (89 runs sampled)
  while-hash-in x 272,946 ops/sec ±0.86% (91 runs sampled)
  while-hash x 225,818 ops/sec ±1.20% (90 runs sampled)
  while x 6,709,808 ops/sec ±1.09% (91 runs sampled)

  fastest is while
math@ubuntu:~/git/array-unique$ nodejs -v
v6.10.3
math@ubuntu:~/git/array-unique$

nickkolok avatar Jun 19 '17 18:06 nickkolok