-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
feat(web): optimization via lazy construction of OSK layers ⏩ #11264
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
Current build-failure cause:
Right, some of the tools will want access to that. |
b231b4d
to
44c178f
Compare
c90e6a3
to
1fccce5
Compare
…' into feat/web/osk-layer-deferral
if(!layer) { | ||
layer = this.buildLayer(id); | ||
if(layer) { | ||
this._layers[id] = layer; |
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.
This line seems unnecessary since that's already done in buildLayer
.
Build failure seen for "Test: Language Modeling Layer (Common)":
The worker's "test mode" is on, so we shouldn't be exiting early... but perhaps recent changes from #11784 and its predecessors have had an unintended consequence here. |
Changes in this pull request will be available for download in Keyman version 18.0.60-alpha |
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.
Do you have any stats on improvement in performance?
let oskHeight = 0; | ||
|
||
// In case the keyboard's layers have differing row counts, we check them all for the maximum needed oskHeight. | ||
for (const layerID in layers) { | ||
const layer = layers[layerID]; | ||
let nRows = layer.rows.length; | ||
let nRows = layer.row.length; |
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.
Why this change?
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.
Took a bit to find it, but the reason is on line 1319. It shifts from using the set of pre-built OSK layers (which have a .rows
property) to using the underlying touch-layout specification (which uses .row
, not .rows
) as the basis for our calculations here.
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.
Understood. A bit squidgy, but make sense!
Not in isolation. I did collect stats for the set of three it was a part of though, and that can be found on #11265. Note the last bit before the "User Testing" section in particular - that's the group stats. |
Continues from #11263, addressing part of #11166.
One particularly easy way to load and display the OSK more quickly is to simply... not make the parts you don't need yet. We can do just-in-time (JIT) construction of OSK layers when they're needed.
While the
default
layer is pretty much always needed, and some keyboards will sometimes start in one or two other layers... a large number of keyboards have extra layers that can wait.As there's one more followup on this set of PRs...
@keymanapp-test-bot skip