-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Restructured EvaluatorPreprocessor_read to be more natural. #4976
Restructured EvaluatorPreprocessor_read to be more natural. #4976
Conversation
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/40017ebbf320d88/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/3291b98669297d1/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/3291b98669297d1/output.txt Total script time: 21.13 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/40017ebbf320d88/output.txt Total script time: 23.63 mins
|
Any benchmark/profile results? |
no, from an optimization perspective this is pure micro optimization (it saves on method invocation, which is most likely inlines, and one check). |
@CodingFabian Could you rebase the PR? |
rebased |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/9728bf6c07d2540/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/c22f87559474054/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/c22f87559474054/output.txt Total script time: 21.23 mins
|
var numArgs = opSpec.numArgs; | ||
|
||
if (!opSpec.variableArgs) { | ||
// Some post script commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/core/evaluator.js: line 2120, col 81, Line is too long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps changing post script
to PostScript
is already enough :)
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/9728bf6c07d2540/output.txt Total script time: 23.62 mins
|
i had fixed that. got lost in the rebase :) |
Restructured EvaluatorPreprocessor_read to be more natural.
Thanks |
As pointed out previously, the read method is invoked frequently (thousands to millions). In that loop always checking for EOF and than for not Command.
These are two checks for figuring out the most common case.
By changing it to a check for a command, the EOF check is implicitly done.
It also saves the continue logic as the valid command case sits safely inside an if block.
for easier review use:
https://github.com/mozilla/pdf.js/pull/4976/files?w=1