Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Exception thrown from internals of Benchmark on simple example... #180

Closed
getify opened this issue Dec 12, 2016 · 8 comments
Closed

Exception thrown from internals of Benchmark on simple example... #180

getify opened this issue Dec 12, 2016 · 8 comments
Labels

Comments

@getify
Copy link

getify commented Dec 12, 2016

I tried this simple example (node v7):

var Benchmark = require("benchmark");

Benchmark.options.onStart = function onStart(evt){
	console.log("onStart",evt.target.name);
};

var main = Benchmark.Suite("main");

main.add("test",function(){
	var x = new Array(1400);
});

main.run();

When I run this on the command line, the output I get is:

bug

  1. I'm not sure why onStart is getting called twice?
  2. I don't understand why my usage is causing this exception?

Am I missing something?

@jdalton
Copy link
Member

jdalton commented Dec 12, 2016

Which version of Benchmark.js are you using?

@getify
Copy link
Author

getify commented Dec 12, 2016

2.1.2

@jdalton jdalton added the bug label Dec 13, 2016
@jdalton
Copy link
Member

jdalton commented Dec 13, 2016

Narrowed the bug down to bb1511c. I have a patch. Going to test it a bit though.

@getify
Copy link
Author

getify commented Dec 13, 2016

thanks for the update! glad i'm not crazy. :)

@getify
Copy link
Author

getify commented Dec 14, 2016

Anything I can do to help here?

@jdalton
Copy link
Member

jdalton commented Dec 14, 2016

Naw. Not really happy with the fix so will be kicking it around a bit. It's getting to be that holiday time where I either have zero or tons of down time 😀

@getify
Copy link
Author

getify commented Dec 14, 2016

Can I safely apply this patch temporarily on my local install and move forward, or is it likely that the eventual fix will change behavior and I should just wait?

@jdalton
Copy link
Member

jdalton commented Dec 14, 2016

This patch is fine to apply. The second attempt will just refine and clarify some things.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants