Bug 215052 - Make GlyphBuffers required in the fast text codepath
Summary: Make GlyphBuffers required in the fast text codepath
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: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks: 206208
  Show dependency treegraph
 
Reported: 2020-08-01 00:19 PDT by Myles C. Maxfield
Modified: 2020-08-08 22:14 PDT (History)
19 users (show)

See Also:


Attachments
Patch (20.21 KB, patch)
2020-08-01 00:29 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (21.78 KB, patch)
2020-08-01 12:18 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (21.81 KB, patch)
2020-08-01 12:27 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (23.75 KB, patch)
2020-08-04 20:08 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (23.06 KB, patch)
2020-08-04 21:04 PDT, Myles C. Maxfield
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2020-08-01 00:19:55 PDT
Make GlyphBuffers required in the fast text codepath
Comment 1 Myles C. Maxfield 2020-08-01 00:29:21 PDT
Created attachment 405771 [details]
Patch
Comment 2 Myles C. Maxfield 2020-08-01 02:31:49 PDT
Comment on attachment 405771 [details]
Patch

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

> Source/WebCore/platform/graphics/WidthIterator.cpp:84
>      if (m_run.length() <= 1 || !(m_enableKerning || m_requiresShaping))

if (m_run.length() <= 1)
Comment 3 Myles C. Maxfield 2020-08-01 12:18:57 PDT
Created attachment 405789 [details]
Patch
Comment 4 Myles C. Maxfield 2020-08-01 12:27:15 PDT
Created attachment 405790 [details]
Patch
Comment 5 Simon Fraser (smfr) 2020-08-03 10:11:45 PDT
Is this going to be a perf regression?
Comment 6 Myles C. Maxfield 2020-08-04 20:08:51 PDT
Created attachment 405977 [details]
Patch
Comment 7 Myles C. Maxfield 2020-08-04 21:04:03 PDT
Created attachment 405981 [details]
Patch
Comment 8 Myles C. Maxfield 2020-08-04 21:05:00 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Is this going to be a perf regression?

I'm still testing. Will comment here when I know more.
Comment 9 Myles C. Maxfield 2020-08-06 14:41:09 PDT
% compare-results -a plt-results-Vanilla -b plt-results-RequiredGlyphBuffers 
a mean = 740.41311
b mean = 743.70648
pValue = 0.7209862553
(Smaller means are better.)
1.004 times worse
Results ARE NOT significant
Comment 10 Myles C. Maxfield 2020-08-06 15:33:20 PDT
The design test of MotionMark shows this to be a progression

With patch: 156pt
Without patch: 153pt
Comment 11 Radar WebKit Bug Importer 2020-08-08 00:20:17 PDT
<rdar://problem/66718097>
Comment 12 Darin Adler 2020-08-08 11:40:39 PDT
Comment on attachment 405981 [details]
Patch

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

> Source/WebCore/platform/graphics/FontCascade.cpp:450
> +    // This is needed only to match the result of the slow path. Same glyph widths but different floating point arithmentics can
> +    // produce different run width.

Existing comment just moving but:

- Would look nicer if line break was at sentence break.
- "arithmentics"

> LayoutTests/ChangeLog:8
> +        * platform/win/fast/events/selectstart-by-drag-expected.txt: Test progressed on Windows.

Do you know why?
Comment 13 Myles C. Maxfield 2020-08-08 21:40:11 PDT
Comment on attachment 405981 [details]
Patch

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

>> LayoutTests/ChangeLog:8
>> +        * platform/win/fast/events/selectstart-by-drag-expected.txt: Test progressed on Windows.
> 
> Do you know why?

I don't have a Windows development environment, so I can't say for sure, but requiring GlyphBuffers is a slight behavior change. When GlyphBuffers aren't specified, shaping doesn't occur at all, so making them mandatory performs shaping when shaping didn't always used to occur.  (This is why I made sure to check performance numbers before making this patch as r?.)

Because this is a progression, and aligns Windows with Mac and iOS, I didn't look too hard at it.
Comment 14 Myles C. Maxfield 2020-08-08 22:14:46 PDT
Committed r265413: <https://trac.webkit.org/changeset/265413>