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

Performance issue with attachComments #114

Open
mamaniv opened this issue Jul 23, 2020 · 0 comments · May be fixed by #115
Open

Performance issue with attachComments #114

mamaniv opened this issue Jul 23, 2020 · 0 comments · May be fixed by #115

Comments

@mamaniv
Copy link

mamaniv commented Jul 23, 2020

I encountered a performance issue using attachComments for large files with many comments.
The issue is related to lines 735 and 768 on estraverse.js that calls comments.splice(cursor, 1);.
Instead of calling splice, which is a very expensive operation that can cause performance issue if the comments array is very big, we can simply call cursor++.

I already tested it for my project and got an enormous performance improvement for attachComments, so it will be nice if we can apply this change too.

Thanks,
Niv

@mamaniv mamaniv linked a pull request Jul 23, 2020 that will close this issue
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 a pull request may close this issue.

1 participant