Bug 171986 - Mail spins launching spell checker when typing
Summary: Mail spins launching spell checker when typing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-11 13:34 PDT by Tim Horton
Modified: 2017-05-12 11:27 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.61 KB, patch)
2017-05-11 13:35 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (5.64 KB, patch)
2017-05-11 13:53 PDT, Tim Horton
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2017-05-11 13:34:56 PDT
Mail spins launching spell checker when typing
Comment 1 Tim Horton 2017-05-11 13:35:28 PDT
Created attachment 309767 [details]
Patch
Comment 2 Tim Horton 2017-05-11 13:53:59 PDT
Created attachment 309775 [details]
Patch
Comment 3 Beth Dakin 2017-05-11 16:45:38 PDT
Comment on attachment 309775 [details]
Patch

r=me, but obviously take a look at those Mac bots.
Comment 4 Tim Horton 2017-05-11 16:56:47 PDT
https://trac.webkit.org/changeset/216704/webkit
Comment 5 Alexey Proskuryakov 2017-05-11 20:11:30 PDT
Comment on attachment 309775 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=309775&action=review

> Source/WebKit2/ChangeLog:15
> +        Asynchronously pre-warm the spell checker when a WKWebView becomes editable.

This is asynchronous, but still blocks the main thread just as much. What tracks a better fix?
Comment 6 Tim Horton 2017-05-11 20:33:52 PDT
In my testing (and instruction from others), that is not true. It's still not perfect, but does not block the main thread for the launch time of the spell checking process. There's a test app attached to the radar if you want to experiment...

I do plan to experiment with actual async spell checking in the future but I don't think there's a bug about that yet.
Comment 7 Alexey Proskuryakov 2017-05-12 10:50:15 PDT
If that's the case, why do it in dispatch_async, and not right away?
Comment 8 Tim Horton 2017-05-12 11:27:20 PDT
(In reply to Alexey Proskuryakov from comment #7)
> If that's the case, why do it in dispatch_async, and not right away?

While *most* of the blocked time is now avoided, the first call to sharedSpellChecker in a process is still quite a bit more expensive than doing nothing (but on the order of tens of milliseconds instead of hundreds). I didn't want to regress time-to-first-paint.