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

Fix "maximum call stack size exceeded" when there are many errors #363

Merged
merged 1 commit into from
May 10, 2022

Conversation

osi-jehrlich
Copy link
Contributor

@osi-jehrlich osi-jehrlich commented Apr 28, 2022

Fixes #344.

Note: The included test simulates one million errors. To keep the tests running fast it does so using a custom keyword to produce all of the errors. This approach was over 7x faster than my efforts to use built-in keywords and large arrays/objects, but it still takes around 300ms on my laptop.

@osi-jehrlich osi-jehrlich changed the title Fix "maximum call stack size exceeded" when there are many errors #344 Fix "maximum call stack size exceeded" when there are many errors Apr 28, 2022
@osi-jehrlich
Copy link
Contributor Author

Is there anything else needed or is there anything I can do to help move this along?

@awwright
Copy link
Collaborator

awwright commented May 8, 2022

Yeah this looks reasonable. I vaguely recall there was a reason we avoided concat... I'll work on this on Monday. There's one other optimization I'd like to look at while I'm in there (see if we can share a pointer to the same errors object, when possible, which should be most cases except not/if/oneOf/anyOf, this should save some additional memory and GC).

@awwright awwright merged commit 8117c85 into tdegrunt:master May 10, 2022
@osi-jehrlich osi-jehrlich deleted the fix-stack-size-exceeded branch May 10, 2022 16:58
@awwright
Copy link
Collaborator

@osi-jehrlich Landed in 1.4.1, please take a look and report how that works.

@awwright awwright added this to the 1.4.1 milestone May 17, 2022
@osi-jehrlich
Copy link
Contributor Author

Will do, thank you!

@osi-jehrlich
Copy link
Contributor Author

Things are looking good so far. I'll let you know or submit a PR if anything comes up. Thanks again.

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.

maximum call stack size exceeded when having a lot of errors
2 participants