Skip to content

Feature/cheaper long stack trace#300

Merged
papandreou merged 6 commits intomasterfrom
feature/cheaperLongStackTrace
Apr 4, 2016
Merged

Feature/cheaper long stack trace#300
papandreou merged 6 commits intomasterfrom
feature/cheaperLongStackTrace

Conversation

@papandreou
Copy link
Member

Attach a stack to all non-oathbreakable promises so that (a patched) Bluebird will render a long stack trace.

Perf. penalty seems to be about 3-4% according to chewbacca, whereas always forcing BLUEBIRD_DEBUG=yes regresses 22-25%.

@papandreou
Copy link
Member Author

Breaks when running the tests with Phantom.js, looking into it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 97.927% when pulling bca0d9f on feature/cheaperLongStackTrace into 79a8149 on master.

@papandreou
Copy link
Member Author

Note that the full versions of the traces that are captured this way won't be identical to the ones Bluebird would do with BLUEBIRD_DEBUG=yes, but I'm pretty sure that the trimmed versions of the two will be identical.

On that note -- how about letting UNEXPECTED_FULL_TRACE=yes imply BLUEBIRD_DEBUG=yes? Then we're down to exposing one stack-related parameter, which hopefully won't ever be needed unless you're debugging Unexpected itself or a non-npm linked plugin.

@papandreou
Copy link
Member Author

Implemented that idea on the branch as well.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.929% when pulling 1686e61 on feature/cheaperLongStackTrace into 79a8149 on master.

});
});

it('should magically change', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this test be run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via test/external.spec.js

@sunesimonsen
Copy link
Member

This seems like at really good tradeoff, I also like the idea of having one debug flag - it is not a hard contract, we can change that without a major version.

@papandreou
Copy link
Member Author

The drop in coverage was due to another coveralls fluke (lemurheavy/coveralls-public#750). It looks good again after I restarted it.

@sunesimonsen
Copy link
Member

👍

@papandreou papandreou merged commit 5ca5b38 into master Apr 4, 2016
@papandreou papandreou deleted the feature/cheaperLongStackTrace branch April 4, 2016 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants