-
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
Avoid creating intermediate strings in the PostScriptLexer #5063
Avoid creating intermediate strings in the PostScriptLexer #5063
Conversation
/botio unittest |
From: Bot.io (Linux)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a3ff73cf1ab91b2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/86ece2e864b2d57/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/86ece2e864b2d57/output.txt Total script time: 0.62 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a3ff73cf1ab91b2/output.txt Total script time: 1.08 mins
|
Thanks, looks good to me. |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/f032cffc00c317f/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/58575683d359566/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/f032cffc00c317f/output.txt Total script time: 21.11 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/58575683d359566/output.txt Total script time: 23.27 mins
|
@@ -177,11 +177,12 @@ var PostScriptLexer = (function PostScriptLexerClosure() { | |||
return PostScriptToken.RBRACE; | |||
} | |||
// operator | |||
var str = String.fromCharCode(ch); | |||
var charBuf = [ch]; |
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.
[ch]
creates a new array. will moving charBuf to the scope above and using charBuf.length = 0; be better.
See example at https://github.com/mozilla/pdf.js/blob/master/src/core/parser.js#L555
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.
Addressed in the new commit; also based on #5074 (comment) I've reverted the usage of bytesToString
.
/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/8cfe5b4ae1e47d7/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/36b080f959a9f0c/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/36b080f959a9f0c/output.txt Total script time: 21.12 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/8cfe5b4ae1e47d7/output.txt Total script time: 22.99 mins
|
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f865425121d2fa8/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f865425121d2fa8/output.txt Total script time: 0.73 mins Published
|
…ate-string-creation Avoid creating intermediate strings in the PostScriptLexer
Looks good, thanks. |
No description provided.