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

Improve the annotation code by converting to ES6 syntax and removing duplicate code #8828

Merged
merged 5 commits into from
Aug 30, 2017

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Aug 26, 2017

The annotation code is not performance-sensitive, so we may convert this code to ES6 syntax (see http://logs.glob.uno/?c=mozilla%23pdfjs&s=23+Aug+2017&e=23+Aug+2017#c66446). Refer to the individual commits for more information about each change.

Using https://github.com/mozilla/pdf.js/pull/8828/files?w=1 helps reviewing tremendously.

@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/48b325418f82db2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/48b325418f82db2/output.txt

Total script time: 2.34 mins

Published

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/6bada02823374bb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/45289dbc7a405e6/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/6bada02823374bb/output.txt

Total script time: 16.44 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/45289dbc7a405e6/output.txt

Total script time: 29.34 mins

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

@Snuffleupagus Snuffleupagus self-requested a review August 27, 2017 15:07
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

Really nice diff stats, that's a lot of boilerplate code being removed at once :-D

One thing though: The IRC discussion only seem to explicitly mention src/display/, and this PR would be the first case where we're using ES6 classes in src/core.
Since the annotations, if present, will be always be parsed during the getOperatorList call, I'm not sure if that's a cause for (theoretical) concern?

Although, looking at https://bugzilla.mozilla.org/show_bug.cgi?id=1167472, a number of performance improvements have already landed.
Given that the number of annotations present on any one page is usually not very large, I'd be surprised if these changes made any difference at all (performance wise).

So, tentatively r=me; but I'd like @yurydelendik to confirm that he's OK with this before we land it.

Copy link
Contributor

@yurydelendik yurydelendik left a comment

Choose a reason for hiding this comment

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

Really good, thanks.

@timvandermeij timvandermeij merged commit a4cc85f into mozilla:master Aug 30, 2017
@timvandermeij timvandermeij deleted the es6-annotations branch August 30, 2017 22:02
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Improve the annotation code by converting to ES6 syntax and removing duplicate code
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