polygoat icon indicating copy to clipboard operation
polygoat copied to clipboard

proposal; never throw

Open sonnyp opened this issue 8 years ago • 5 comments

let the consumer throws but catch so that a polygoat function never throws and calls the callback with the exception as first argument instead

related discussion https://github.com/sonnyp/polygoat/issues/9

maybe a new module? (with dezalgoing as well)

sonnyp avatar Apr 18 '16 15:04 sonnyp

in any case I guess it's okay to assume the performance impact is null.

Seriously, why would you do that? You acknowledge that the benchmark doesn't make sense because you introduced a try/catch which is a deopt in v8 and instead of viewing some presentations about it you just assume there is no impact?

benjamingr avatar Apr 18 '16 17:04 benjamingr

Seriously, why would you do that? You acknowledge that the benchmark doesn't make sense because you introduced a try/catch which is a deopt in v8 and instead of viewing some presentations about it you just assume there is no impact?

What I intended to express is that I (as a user and for my current use case and at the moment) didn't really care for the performance impact. Same thing with eval optimisation. (updated my comment on the benchmark to reflect that EDIT: actually removed the section about benchmark)

sonnyp avatar Apr 18 '16 17:04 sonnyp

That's entirely fine, but

a) As a library author I think you should validate that since it's not just your code that's at stake. b) You probably shouldn't post benchmarks if you know they are wrong.

Benchmarking v8 is a lot of fun, I usually don't attempt it myself except for when I absolutely have to. If you want to be serious about performance you have to do that and if you don't that's also entirely fine (most Node libs aren't really performance sensitive)

benjamingr avatar Apr 18 '16 17:04 benjamingr

Let me re-iterate, at this moment I don't care much for polygoat performances although if anyone is and wish to contribute to that end I'm all for it.

I'm interested in your opinion on the content of this PR though.

sonnyp avatar Apr 18 '16 18:04 sonnyp

I'm -1 on it, I think this is not what callback users expect.

benjamingr avatar Apr 18 '16 19:04 benjamingr