Search UI Input Responsiveness with Many Flashcards

Shun

状元
Hello Mike,

on an iPad running the .17 beta and using a 900,000-card flashcard database, I noticed that the handwriting input interface in Search sometimes reacted to my input only with a delay of three or more seconds, probably because it continually searched for dictionary definitions of the current input field, including all of my flashcards.

Would it perhaps be doable to decouple the search input from the searching for definitions and put these tasks into separate threads? At the moment, the dictionary search seems to halt the handwriting input, which indicates to me that they're waiting for each other. I think it would be nice to place whatever is input into a queue, with the searching happening in a different background thread which reads from the queue whenever it's ready for additional input. Intermediate inputs could then also be skipped (only the last contents of the user input field would count). This should make user input feel very responsive. The difference should also be noticeable with just 100,000 cards on an older device, though I'd have to experiment.

I left searching inside flashcards at the default setting. In the attached screen recording, I tapped on the character 间 on the left side multiple times before my tapping input was processed.

Thanks, Shun
 

Attachments

  • iPad jerky HWR.mp4.zip
    2 MB · Views: 175
Last edited:

mikelove

皇帝
Staff member
That's odd - searches do occur in a separate background thread already, so they shouldn't be interfering with handwriting or otherwise making the interface lag. My guess is that somehow under certain circumstances the handwriting recognizer is ending up in the same thread pool as the search engine and so is stuck waiting for one of those threads to be free; either that or something slow is happening in the main thread in the definition screen that's supposed to be in a background thread.
 

Shun

状元
Thanks for these interesting insights. I'm going to try searches with databases of progressively smaller sizes (not forgetting to compact them and restart the app each time for maximum performance) and see if I'll detect any pattern.

Edit: Trying again after a while, I can't get it to slow down anymore. Perhaps something needed to be initialized first. Sorry about the false alarm.
 
Last edited:
Top