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

Re-use, rather than re-creating, some Arrays when resetting them in src/display/api.js #10872

Merged
merged 1 commit into from
May 31, 2019

Conversation

Snuffleupagus
Copy link
Collaborator

Calling someArray = [] will create a new Array, which seems completely unnecessary when it's sufficient to just call someArray.length = 0 to achieve the same effect.

Even though I cannot imagine these particular cases having any noticeable performance impact, similar changes were made in core/ code years ago since it's apparently more efficient memory wise.

… `src/display/api.js`

Calling `someArray = []` will create a new Array, which seems completely unnecessary when it's sufficient to just call `someArray.length = 0` to achieve the same effect.

Even though I cannot imagine these particular cases having any noticeable performance impact, similar changes were made in `core/` code years ago since it's apparently more efficient memory wise.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.67.70.0:8877/a5a62ae1d311ce9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.215.176.217:8877/83834bd005891b3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/a5a62ae1d311ce9/output.txt

Total script time: 17.77 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/83834bd005891b3/output.txt

Total script time: 25.48 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/83834bd005891b3/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 3b58863 into mozilla:master May 31, 2019
@timvandermeij
Copy link
Contributor

Thank you for improving this!

@Snuffleupagus Snuffleupagus deleted the api-clear-arrays branch May 31, 2019 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants