Skip to content

fix maximum call stack size reached issue#119929

Merged
joaomoreno merged 2 commits into
microsoft:mainfrom
aasimkhan30:main
Jul 16, 2021
Merged

fix maximum call stack size reached issue#119929
joaomoreno merged 2 commits into
microsoft:mainfrom
aasimkhan30:main

Conversation

@alanrenmsft

@alanrenmsft alanrenmsft commented Mar 26, 2021

Copy link
Copy Markdown
Contributor

noticed this while investigating: microsoft/azuredatastudio#14744

when there are large number of items in the array, using the spread operator might exceed the maximum call stack size as there are too many parameters, the fix is to use alternative safe ways to delete and insert.

while implementing the push/insert methods, I picked the approach of setting array length and then updating the values since it is faster comparing to other in place alternatives, it becomes more obvious as the number of items grow. here are the perf numbers, the test was done on https://jsbench.me/

2 array with 1000 items
image
2 array with 10,000 items
image
2 array with 100,000 items
image
2 array with 1,000,000 items
image

@alanrenmsft alanrenmsft reopened this Mar 27, 2021
@alanrenmsft alanrenmsft marked this pull request as ready for review March 27, 2021 02:48
@joaomoreno

Copy link
Copy Markdown
Member

Thanks! 🍻

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

list-widget List widget issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants