sailfish-keyboard / sailfishos-presage-predictor

Presage based input predictor for the Sailfish OS
https://openrepos.net/content/sailfishkeyboard/maliit-plugin-presage
GNU General Public License v3.0
7 stars 4 forks source link

Predictions using async API #9

Closed rinigus closed 6 years ago

rinigus commented 6 years ago

I have started looking into presage, into it's internals and performance. There is a lot it has to do to get predictions and while I do have ideas on how to make it faster, I suggest to make predictions in separate thread. Namely, QML interface would add changes in context, keyboard processing as it has now, but would get prediction via signal (or just notified via signal that prediction changed).

Such approach would allow us to later use more advanced language models, additional predictors and keep fast response of the keyboard .

rinigus commented 6 years ago

We could use approaches suggested at https://forum.qt.io/topic/15988/how-to-cancel-pending-unprocessed-emitted-signals to process only latest available context by presage worker thread. Since separate thread would use queued signals, that should be rather simple .

martonmiklos commented 6 years ago

Yes I have been thinking about the same previously.

rinigus commented 6 years ago

Adding link to the issue where I will try to improve the performance of presage: https://github.com/rinigus/presage/issues/1

rinigus commented 6 years ago

Hi! I'll start to work on this one on the top of Marisa PR. It shouldn't take long to fix it.

martonmiklos commented 6 years ago

Sounds good!