-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
async is taking over my stack traces #405
Comments
+1 |
1 similar comment
👍 |
-1 Guys, it isn't worth it to increase complexity of async library (and very likely add bugs) just because Error doesn't filter out all this stuff.
If you care about it, override Error handler just like coffee-script does and remove those lines.
Use
No it's not, because v8 inlines small functions. |
Other than that I can only say, you're right, let's make it the user's problem. |
It's clearing the stack and allowing other IO stuff to slip in if you're doing computationally-intensive stuff. Usually a good thing.
The fact that async is calling multiple functions is not an issue. The issue is that Error prints those functions in the stack trace. Therefore all I'm saying is that it is not this library's issue. Maybe there are libraries out there that fix this behaviour. |
Function smallness is only one out of dozen or so requirements for inlining, likely nothing gets inlined in async library due to heavy use of closures, especially if you are using 64-bit node. |
I created async-error-stack to solve: Problem 1: By default, err stack is limited to 10 lines. Problem 2: the event loop's stack frame context not maintained. Problem 3: the async module cluttering up the stack. Problem 2 is seen in this:
async-error-stack uses longjohn to solve problems 2 and 3, and own code to solve 1. Log after using async-error-stack:
|
Don't get me wrong, I love this project. But whenever I look at a stack trace where async is involved, all I see is async async async, and every once in a while something relevant to my actual code base. I can appreciate that certain things have been implemented with elegant helper functions inside of async, but it creates a horrible penalty on the call stack.
Some things to think about:
Shouldn't async get out of the way as much as possible? I think the footprint is simply too big.
The text was updated successfully, but these errors were encountered: