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

[api-minor] Sort PopupAnnotations already on the worker-thread (PR 11535 follow-up) #15283

Merged
merged 1 commit into from
Aug 6, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

By doing this in the worker-thread this code will only need to run once, whereas currently re-rendering of a page forces this to be repeated (e.g. after it's been scrolled out-of-view and then back into view again).

…535 follow-up)

By doing this in the worker-thread this code will only need to run *once*, whereas currently re-rendering of a page forces this to be repeated (e.g. after it's been scrolled out-of-view and then back into view again).
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Aug 6, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/90980c0f93a2643/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Aug 6, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/4e9ff5acf599168/output.txt

@@ -656,7 +656,32 @@ class Page {
}

return Promise.all(annotationPromises).then(function (annotations) {
return annotations.filter(annotation => !!annotation);
if (annotations.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be simplified in using sort function.
I just tried:

["a",1, 2, "d", "e", 3, "aa"].sort((a, b) => typeof a === typeof b ? 0 : (typeof a === "string" ? -1 : +1))

and it works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm not finding such a code-snippet particularly easy to read/understand at a glance.
Also, wouldn't you still need to filter out any empty entries first? If so, that'd effectively require two loops through the Array rather than just the one.

@pdfjsbot
Copy link

pdfjsbot commented Aug 6, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/90980c0f93a2643/output.txt

Total script time: 25.89 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 10
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/90980c0f93a2643/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Aug 6, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/4e9ff5acf599168/output.txt

Total script time: 30.22 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 3

Image differences available at: http://54.193.163.58:8877/4e9ff5acf599168/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@timvandermeij timvandermeij merged commit 2a84a30 into mozilla:master Aug 6, 2022
@timvandermeij
Copy link
Contributor

Looks good!

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.

4 participants