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

Promise Rejections and Performance #6

Open
matt4530 opened this issue Nov 20, 2021 · 0 comments
Open

Promise Rejections and Performance #6

matt4530 opened this issue Nov 20, 2021 · 0 comments

Comments

@matt4530
Copy link
Member

Because NodeJS still has a performance hit for rejected promises, it may be wise to move away from a success or throwing a fail.

The current work around in Quartermaster is to set metronome.realSleepFrequency to some appropriate number, which allows the rejected promises to be processed multiple times during the simulation instead of after or after they have already piled up to a large number.

A fix like this would involve always having promises succeed and instead returning some response object, for which we can act on. The logic in each stage moves from try ... catch blocks to if ... else statements.

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

No branches or pull requests

1 participant