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

Remove the only remaining Dict_getAll usage (in evaluator.js) and the method itself #6982

Merged
merged 3 commits into from
Feb 13, 2016
Merged

Remove the only remaining Dict_getAll usage (in evaluator.js) and the method itself #6982

merged 3 commits into from
Feb 13, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

  • Add a linked load test for issue 6549
  • Remove getAll from EvaluatorPreprocessor_read

For the operators that we currently support, the arguments are not Dicts, which means that it's not really necessary to use Dict_getAll in EvaluatorPreprocessor_read.
Also, I do think that if/when we support operators that use Dicts as arguments, that should be dealt with in the corresponding case in PartialEvaluator_getOperatorList which handles the operator.

The only reason that I can find for using Dict_getAll like that, is that prior to PR #6550 we would just append certain (currently unsupported) operators without doing any further processing/checking. But as issue #6549 showed, that can lead to issues in practice, which is why it was changed.

In an effort to prevent possible issues with unsupported operators, this patch simply ignores operators with Dict arguments in PartialEvaluator_getOperatorList.

  • Remove Dict_getAll since it is now unused

    Dict_getAll is problematic for a number of reasons. First of all, as issue Major performance issues for a simple PDF file #6961 shows, it can be really bad for performance, since it dereferences all indirect objects.
    Second of all, all the derefencing can lead to data being unncessarily requested when ranged/chunked loading is used, thus unnecessarily delaying rendering.

    Note: For cases where Dict_getAll was previously used, Dict_getKeys in combination with Dict_get can be used instead. This has the advantage that data isn't requested until it's actually needed.

For the operators that we currently support, the arguments are not `Dict`s, which means that it's not really necessary to use `Dict_getAll` in `EvaluatorPreprocessor_read`.
Also, I do think that if/when we support operators that use `Dict`s as arguments, that should be dealt with in the corresponding `case` in `PartialEvaluator_getOperatorList` which handles the operator.

The only reason that I can find for using `Dict_getAll` like that, is that prior to PR 6550 we would just append certain (currently unsupported) operators without doing any further processing/checking. But as issue 6549 showed, that can lead to issues in practice, which is why it was changed.

In an effort to prevent possible issue with unsupported operators, this patch simply ignores operators with `Dict` arguments in `PartialEvaluator_getOperatorList`.
`Dict_getAll` is problematic for a number of reasons. First of all, as issue 6961 shows, it can be really bad for performance, since it dereferences all indirect objects.
Second of all, all the derefencing can lead to data being unncessarily requested when ranged/chunked loading is used, thus unnecessarily delaying rendering.

Note: For cases where `Dict_getAll` was previously used, `Dict_getKeys` in combination with `Dict_get` can be used instead. This has the advantage that data isn't requested until it's actually needed.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/0977d53272f1075/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/b4594262b93d9b9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/0977d53272f1075/output.txt

Total script time: 20.08 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/b4594262b93d9b9/output.txt

Total script time: 21.94 mins

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

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/a9c84a63fe5648e/output.txt

timvandermeij added a commit that referenced this pull request Feb 13, 2016
Remove the only remaining `Dict_getAll` usage (in evaluator.js) and the method itself
@timvandermeij timvandermeij merged commit e9a1a47 into mozilla:master Feb 13, 2016
@timvandermeij
Copy link
Contributor

Thank you!

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.

None yet

3 participants