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

Keyboard load is slow because of autocomplete keywords creation #286

Closed
2 tasks done
andrewtavis opened this issue Apr 8, 2023 · 4 comments
Closed
2 tasks done
Assignees
Labels
-next release- Included in the next release bug Something isn't working feature New feature or request help wanted Extra attention is needed

Comments

@andrewtavis
Copy link
Member

andrewtavis commented Apr 8, 2023

Terms

Behavior

Scribe keyboards are loading slowly, with the main issue being the conditional firstKeyboardLoad, the part of loadKeys() that is triggered on the first load of the keyboard. At this point we're doing a few very intensive operations to create the variable autocompleteWords (now renamed autocompleteLexicon). Referencing this variable is intensive in and of itself, but new additions I'm trying to do right now are actually fully crashing the keyboard at start. Removing these operations returns to a smooth load that we had before the addition of autocomplete.

This issue is to document and work on optimizing the firstKeyboardLoad condition so that we can have smoother load times. Along with this is included the addition of emoji keywords as words within the autocomplete lexicon, which as of now is not possible with the current operations.

Device type

iPhone and iPad

Versions

All versions after autocomplete was added

@andrewtavis andrewtavis added bug Something isn't working feature New feature or request help wanted Extra attention is needed -next release- Included in the next release labels Apr 8, 2023
@andrewtavis andrewtavis self-assigned this Apr 8, 2023
@andrewtavis andrewtavis moved this from Todo to In Progress in Scribe Board Apr 8, 2023
@andrewtavis andrewtavis changed the title Keyboard load is slow because of autocomplete set creation Keyboard load is slow because of autocomplete keywords creation Apr 8, 2023
@andrewtavis
Copy link
Member Author

This issue is related to #96 as part of this issue will be solved by loading the JSONs into SQLite databases :)

@andrewtavis
Copy link
Member Author

andrewtavis commented Apr 8, 2023

Closed via 53ef8c4 🚀🔥

@SaurabhJamadagni, this issue was a major boost to the UX :) The keyboard's no longer loading so long — directly changes for keyboards with small/medium data sets, and now Russian with it's 194k nouns seems to be the only one with any lag. Russian is at least loading at this point, which was not the case before. This was definitely a lot of the problem that we had been thinking #96 was going to solve, with that issue now being focussed on the new data infrastructure to speed it up as much as we can :) Big thing is that I at least was really focussed on the JSONs being a problem, which they are, but another major thing that was apparently causing the slowdown at load was the creation of the autosuggestions in the way that it was being done 😊

Lots of changes recently! Just #96 and #284 before v2.2.0 now! 🚀

@github-project-automation github-project-automation bot moved this from In Progress to Done in Scribe Board Apr 8, 2023
@SaurabhJamadagni
Copy link
Collaborator

@andrewtavis this is awesome! How did this occur to you? I was thinking the load of this problem will lie on fixing the data structuring problem. Read through the commit right now. Looking nice. Thank you for this solve, it is going to help out immensely! 😄 🚀

@andrewtavis
Copy link
Member Author

@SaurabhJamadagni, it occurred to me when I tried to add the emoji keys to the autocompletion lexicon in the same way that we were doing it and then the keyboard crashed on load 😅 At that point I removed all the other additions to the lexicon for a test and realized that the keyboard loads normally without overloading the firstKeyboardLoad conditional :)

Another note for you is that in #282 I switched around the way that the emojis are being triggered. Just FYI, that's now being controlled by an instance of the EmojisToShow enum rather than a boolean :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-next release- Included in the next release bug Something isn't working feature New feature or request help wanted Extra attention is needed
Projects
Archived in project
Development

No branches or pull requests

2 participants