-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV #5713
Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV #5713
Conversation
… IdentityH/IdentityV Currently if a font contains a `toUnicode` entry, we always create a new `ToUnicodeMap` in evaluator.js. This is done even for `IdentityV/IdentityH`, despite to possibility to use the much more compact `IdentityToUnicodeMap` representation. This patch refactors the `IdentityH/IdentityV` cases, to: - Avoid calling `IdentityCMap.getMap`, since this prevents allocating and iterating through an array with 65536 elements. - Ensure that the handling of `toUnicode` is actually correct in fonts.js. We rely on `toUnicode instanceof IdentityToUnicodeMap` in a few places, and currently this does not work correctly for `IdentityH/IdentityV`.
sweet, looks ok. do you have a pdf where this results in a performance improvement? would help me checking. |
I didn't have a particular test-case when writing the patch; it's the result of reading various parts of the font code while debugging. In practice these kinds of |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/199f8a02d306a46/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e5f7260747eca7f/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/199f8a02d306a46/output.txt Total script time: 17.12 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/e5f7260747eca7f/output.txt Total script time: 22.90 mins
Image differences available at: http://107.21.233.14:8877/e5f7260747eca7f/reftest-analyzer.html#web=eq.log |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2c626360dd5032c/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/42d0f067a4e1de2/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/2c626360dd5032c/output.txt Total script time: 17.86 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/42d0f067a4e1de2/output.txt Total script time: 22.06 mins
Image differences available at: http://107.21.233.14:8877/42d0f067a4e1de2/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ed774d8f502d211/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c933b2d11cd7767/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ed774d8f502d211/output.txt Total script time: 17.88 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c933b2d11cd7767/output.txt Total script time: 21.94 mins
|
…deMap Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV
Currently if a font contains a
toUnicode
entry, we always create a newToUnicodeMap
in evaluator.js. This is done even forIdentityV/IdentityH
, despite to possibility to use the much more compactIdentityToUnicodeMap
representation.This patch refactors the
IdentityH/IdentityV
cases, to:IdentityCMap.getMap
, since this prevents allocating and iterating through an array with 65536 elements.toUnicode
is actually correct in fonts.js.We rely on
toUnicode instanceof IdentityToUnicodeMap
in a few places, and currently this does not work correctly forIdentityH/IdentityV
.