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

Rename fromCallback to bindCallback #876

Closed
benlesh opened this issue Dec 3, 2015 · 5 comments · Fixed by #881
Closed

Rename fromCallback to bindCallback #876

benlesh opened this issue Dec 3, 2015 · 5 comments · Fixed by #881
Assignees

Comments

@benlesh
Copy link
Member

benlesh commented Dec 3, 2015

Per the discussion here #787. I think we're in agreement that fromCallback's behavior differs enough from the other fromX methods that we can change the name.

@benlesh benlesh added the help wanted Issues we wouldn't mind assistance with. label Dec 3, 2015
@benlesh benlesh self-assigned this Dec 3, 2015
@benlesh benlesh removed the help wanted Issues we wouldn't mind assistance with. label Dec 3, 2015
@benjamingr
Copy link
Contributor

lgtm.

Although I'd still rather see a generated function avoiding the closure, and all the objects/created and copying around here. I'd also like to see a benchmark with it - preferably https://github.com/petkaantonov/bluebird/tree/master/benchmark since it simulates exactly the sort of use case we're discussing here (which is why bluebird used it in the first place) that measures the overhead. If it's 2x slower than callbacks I can take the penalty but if it's an order of magnitude slower that might be a problem.

@benlesh
Copy link
Member Author

benlesh commented Dec 4, 2015

Although I'd still rather see a generated function avoiding the closure, and all the objects/created and copying around here.

Can you elaborate here?

@benjamingr
Copy link
Contributor

Yes - look at how promisify is implemented in bluebird. A function is generated for the new function and then the JIT gets to optimize it. Meaning bluebird promisifies at almost zero overhead while other libraries typically are a lot slower.

This is important if we expect it to be called per-request in servers. On the client it's insignificant though.

@benlesh
Copy link
Member Author

benlesh commented Dec 4, 2015

Although I'd still rather see a generated function avoiding the closure

Ah, I see, Bluebird is actually building function via strings. That's what you meant by "generated function". That's an interesting approach, actually. Totally worth investigating for something like this. Thanks @benjamingr for pointing me to that. Hopefully I'll have time soon to try it with some perf tests.

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants