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

Issue 1651433002: Replace the id<-->key hashmap in SkImageFilter by a SkTArray (Closed)

Created:
4 years, 10 months ago by xidachen
Modified:
4 years, 10 months ago
CC:
reviews_skia.org, Justin Novosad
Base URL:
https://chromium.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Replace the id<-->key hashmap in SkImageFilter by a SkTArray In the current implementation, SkImageFilter::Cache maintains a hash map that maps SkImageFilter's uniqueID to an array of keys, and its purpose is to remove the values in Cache that are associated with this array of keys that are indexed by uniqueID. However, maintaining this hash map causes perf regression to smoothness.tough_filters_cases. This CL removes the id<-->key hashmap. Instead, we maintain an array of keys in SkImageFilter. Whenever there is a new key, we push it into the array. In ~SkImageFilter(), we call Cache::purgeByKeys to remove all the values that are associated with the keys that are maintained by SkImageFilter. BUG=571655 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1651433002 Committed: https://skia.googlesource.com/skia/+/23526963135bd15737505bd560d41b0d5a41439e

Patch Set 1 #

Total comments: 5

Patch Set 2 : using a mutex when write to the Key array #

Total comments: 1

Patch Set 3 : remove unused parameters in header #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -21 lines) Patch
M include/core/SkImageFilter.h View 1 2 3 chunks +5 lines, -1 line 0 comments Download
M src/core/SkImageFilter.cpp View 1 7 chunks +7 lines, -20 lines 0 comments Download

Messages

Total messages: 29 (14 generated)
xidachen
PTAL. This CL crashes the smoothness.tough_filters_cases. I tried to drag the svg file directly to ...
4 years, 10 months ago (2016-01-29 15:31:00 UTC) #3
mtklein
We're sure the benchmark reflects real-world usage enough to care? https://codereview.chromium.org/1651433002/diff/1/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.chromium.org/1651433002/diff/1/include/core/SkImageFilter.h#newcode46 ...
4 years, 10 months ago (2016-01-29 16:01:35 UTC) #5
Stephen White
https://codereview.chromium.org/1651433002/diff/1/src/core/SkImageFilter.cpp File src/core/SkImageFilter.cpp (right): https://codereview.chromium.org/1651433002/diff/1/src/core/SkImageFilter.cpp#newcode261 src/core/SkImageFilter.cpp:261: fAllKeys.push_back(key); On 2016/01/29 16:01:35, mtklein wrote: > Without running ...
4 years, 10 months ago (2016-01-29 16:26:28 UTC) #6
mtklein
On 2016/01/29 16:26:28, Stephen White wrote: > https://codereview.chromium.org/1651433002/diff/1/src/core/SkImageFilter.cpp > File src/core/SkImageFilter.cpp (right): > > https://codereview.chromium.org/1651433002/diff/1/src/core/SkImageFilter.cpp#newcode261 ...
4 years, 10 months ago (2016-01-29 17:56:27 UTC) #7
xidachen
PTAL. senorblanco@: with the new patch, I observed a ~1% perf improvement locally on the ...
4 years, 10 months ago (2016-01-29 20:30:04 UTC) #9
Stephen White
https://codereview.chromium.org/1651433002/diff/20001/src/core/SkImageFilter.cpp File src/core/SkImageFilter.cpp (right): https://codereview.chromium.org/1651433002/diff/20001/src/core/SkImageFilter.cpp#newcode255 src/core/SkImageFilter.cpp:255: fCacheKeys.push_back(key); Hmmm.. it looks like the array fCacheKeys could ...
4 years, 10 months ago (2016-01-29 20:55:37 UTC) #10
Stephen White
On 2016/01/29 20:30:04, xidachen wrote: > PTAL. > > senorblanco@: with the new patch, I ...
4 years, 10 months ago (2016-01-29 20:56:18 UTC) #11
reed1
api lgtm
4 years, 10 months ago (2016-01-29 21:01:02 UTC) #12
mtklein
lgtm!
4 years, 10 months ago (2016-01-29 21:06:36 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1651433002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1651433002/20001
4 years, 10 months ago (2016-01-29 21:17:48 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-Clang-x86_64-Debug-Trybot/builds/5739) Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, ...
4 years, 10 months ago (2016-01-29 21:19:00 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1651433002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1651433002/40001
4 years, 10 months ago (2016-01-29 21:26:36 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1651433002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1651433002/40001
4 years, 10 months ago (2016-01-29 21:49:44 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1651433002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1651433002/40001
4 years, 10 months ago (2016-02-01 13:12:19 UTC) #27
commit-bot: I haz the power
4 years, 10 months ago (2016-02-01 13:27:19 UTC) #29
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/23526963135bd15737505bd560d41b0d5a41439e

Powered by Google App Engine
This is Rietveld 408576698