-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Right-size the array in getSampleArray(). #5191
Right-size the array in getSampleArray(). #5191
Conversation
This allows the JS engine to do a better job of allocating the right number of elements for the array, avoiding some resizings. For the PDF in mozilla#2504, this avoids 100s of MiBs of allocations in Firefox.
great. This makes usually sense in places where you know the size beforehand. Especially when the number of elements is high. |
Exactly! |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 1 Live output at: http://107.22.172.223:8877/ecea16b2192c0fd/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 1 Live output at: http://107.21.233.14:8877/1cacac80a2c7db9/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ecea16b2192c0fd/output.txt Total script time: 19.53 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/1cacac80a2c7db9/output.txt Total script time: 22.46 mins
|
Right-size the array in getSampleArray().
Really good; thank you! |
This allows the JS engine to do a better job of allocating the right
number of elements for the array, avoiding some resizings. For the PDF
in #2504, this avoids 100s of MiBs of allocations in Firefox.