Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The performance tests are broken. #229

Closed
agirorn opened this issue Dec 22, 2017 · 3 comments
Closed

The performance tests are broken. #229

agirorn opened this issue Dec 22, 2017 · 3 comments

Comments

@agirorn
Copy link
Contributor

agirorn commented Dec 22, 2017

When I run the performance tests it fails.

EventEmitter2 git:(master) ✗ ./node_modules/.bin/nodeunit test/perf/benchmark.js 
EventEmitterHeatUp x 4,246,065 ops/sec ±0.28% (94 runs sampled)
EventEmitter x 4,099,899 ops/sec ±1.57% (92 runs sampled)
EventEmitter2 x 14,586,093 ops/sec ±1.01% (93 runs sampled)
EventEmitter2 (wild) x 11,040,898 ops/sec ±0.74% (89 runs sampled)

/home/agirorn/code-open/EventEmitter2/test/perf/benchmark.js:50
    console.log('\nFastest is ' + this.filter('fastest').pluck('name'));
                                                         ^
TypeError: this.filter(...).pluck is not a function
    at Suite.<anonymous> (/home/agirorn/code-open/EventEmitter2/test/perf/benchmark.js:50:58)
    at /home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:1215:40
    at arrayEach (/home/agirorn/code-open/EventEmitter2/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/home/agirorn/code-open/EventEmitter2/node_modules/lodash/lodash.js:9359:14)
    at Suite.emit (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:1214:11)
    at Suite.onComplete (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:1186:17)
    at getNext (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:900:30)
    at execute (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:862:26)
    at invoke (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:970:20)
    at Suite.runSuite [as run] (/home/agirorn/code-open/EventEmitter2/node_modules/benchmark/benchmark.js:1169:7)
    at Object.<anonymous> (/home/agirorn/code-open/EventEmitter2/test/perf/benchmark.js:53:4)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
@RangerMauve
Copy link
Contributor

I haven't had much time to do maintenance, and this looks like a library version problem. A pr to fix this would be very much appreciated!

@evilive3000
Copy link

just replace pluck with map

before:
this.filter('fastest').pluck('name')
after:
this.filter('fastest').map('name')

@RangerMauve
Copy link
Contributor

@evilive3000 Would you mind testing it out and submitting a PR?

ronkorving pushed a commit to ronkorving/EventEmitter2 that referenced this issue Jan 31, 2018
RangerMauve added a commit that referenced this issue Jan 31, 2018
Fixes #229 by calling map() instead of pluck()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants