Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Issue 615853007: Stay in floats as much as possible in SkTileGrid, particularly in insert. (Closed)

Created:
6 years, 2 months ago by mtklein_C
Modified:
6 years, 2 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Stay in floats as much as possible in SkTileGrid, particularly in insert. SkTileGrid::insert() is about 15% of recording time before this CL, which reduces it to ~10%. Next steps are looking into some of the TODOs I've left myself, and vectorizing the math. Most of the win here comes from converting integer divisions into float multiplies. BUG=skia:1021 Committed: https://skia.googlesource.com/skia/+/65be97d1a1eb5923b078bd1e7ec1e7da6e6427e2

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : note #

Patch Set 4 : rebase #

Patch Set 5 : extract userToGrid #

Patch Set 6 : fix ordering here too #

Patch Set 7 : rebase #

Patch Set 8 : start on a new approach #

Patch Set 9 : start reverting tests #

Patch Set 10 : tests passing #

Patch Set 11 : explain sort #

Patch Set 12 : only sort on query, with TODO to clean up #

Patch Set 13 : explain better #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -64 lines) Patch
M src/core/SkTileGrid.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -1 line 0 comments Download
M src/core/SkTileGrid.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +61 lines, -63 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/615853007/240001
6 years, 2 months ago (2014-10-07 18:27:08 UTC) #2
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
6 years, 2 months ago (2014-10-07 18:27:09 UTC) #3
mtklein
Mind taking a look to see if I've got things straight?
6 years, 2 months ago (2014-10-07 18:29:05 UTC) #5
robertphillips
lgtm but I defer to Justin on this one.
6 years, 2 months ago (2014-10-07 18:45:42 UTC) #6
commit-bot: I haz the power
Committed patchset #13 (id:240001) as 65be97d1a1eb5923b078bd1e7ec1e7da6e6427e2
6 years, 2 months ago (2014-10-07 18:46:44 UTC) #7
mtklein
On 2014/10/07 18:46:44, I haz the power (commit-bot) wrote: > Committed patchset #13 (id:240001) as ...
6 years, 2 months ago (2014-10-07 18:47:53 UTC) #8
Justin Novosad
On 2014/10/07 18:47:53, mtklein wrote: > On 2014/10/07 18:46:44, I haz the power (commit-bot) wrote: ...
6 years, 2 months ago (2014-10-09 20:19:17 UTC) #9
mtklein
> The code you changed is very sensitive. I think this change is okay, but ...
6 years, 2 months ago (2014-10-10 15:28:51 UTC) #10
Justin Novosad
6 years, 2 months ago (2014-10-14 19:02:26 UTC) #11
Message was sent while issue was closed.
On 2014/10/10 15:28:51, mtklein wrote:
> > The code you changed is very sensitive. I think this change is okay, but to
be
> > sure you'd have to test the interactions with the Chromium Compositor to
> verify
> > compositor tiles that are supposed to be grid-aligned enter the "if
(tilesHit
> ==
> > 1)" branch in search()
> 
> Yeah, I was somewhat startled to see that we're regularly not hitting that
fast
> path, 
> even before this CL.  Depending on the window size, seems my slow merges
> outnumber my
> fast paths by about 5 to 1.  But when we do hit the slow path, they seem to
> always be
> 2 or 4 tiles, which a good sign that we're very close to querying 1 tile but
got
> off
> by a little somewhere.
> 
> I tested this out at a few time points: ToT, ToT just before my CL, and M38:
all
> have
> a lousy fast path hit rate, with M38 the worst.  I haven't been able to sync
> back
> before M38.

As long as this patch doe not affect that hit rate, it confirms that it's doing
the right thing.

It does not surprise me that the hit rate is not perfect.  The compositors
easily strays from its default tile size, in particular for skinny rects and
areas that are less that 2x2 tiles.  5-to-1 is worse than I thought though. 
Perhaps something changed on the compositor side that diverged the margin
arithmetic (so we'd only get 1:1 hits only on 1st row and/or first column).

Still, queries that hit 2 or 4 tiles are not that bad.

Powered by Google App Engine
This is Rietveld 408576698