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

Change the loadedChunks property, on ChunkedStream instances, from an Array to a Set #11972

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

In the old code the use of an Array meant that we had to manually track the numChunksLoaded property, given that simply using the Array length wouldn't have worked since there's no guarantee that the data is loaded in order when e.g. range requests are in use.

Tracking closely related state separately in this manner never seem like a good idea, and we can now instead utilize a Set to avoid that.

…m an Array to a Set

In the old code the use of an Array meant that we had to *manually* track the `numChunksLoaded` property, given that simply using the Array `length` wouldn't have worked since there's no guarantee that the data is loaded in order when e.g. range requests are in use.

Tracking closely related state *separately* in this manner never seem like a good idea, and we can now instead utilize a Set to avoid that.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jun 5, 2020

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/59bf4009a40def1/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 5, 2020

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/29994bf8189c2ee/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 5, 2020

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/59bf4009a40def1/output.txt

Total script time: 25.87 mins

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

Image differences available at: http://54.67.70.0:8877/59bf4009a40def1/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Jun 5, 2020

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/29994bf8189c2ee/output.txt

Total script time: 30.19 mins

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

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

@timvandermeij timvandermeij merged commit 039307f into mozilla:master Jun 5, 2020
@timvandermeij
Copy link
Contributor

Less is more when it comes to tracking related state. Thanks!

@Snuffleupagus Snuffleupagus deleted the ChunkedStream-loadedChunks-Set branch June 5, 2020 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants