-
Notifications
You must be signed in to change notification settings - Fork 129
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
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 callscomments.splice(cursor, 1);
.Instead of calling
splice
, which is a very expensive operation that can cause performance issue if thecomments
array is very big, we can simply callcursor++
.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
The text was updated successfully, but these errors were encountered: