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

Issue 69123002: Generic version of caching cc switches to avoid searching of switches on each function call (Closed)

Created:
7 years, 1 month ago by sivag
Modified:
6 years, 11 months ago
CC:
chromium-reviews, cc-bugs_chromium.org, vivekg_samsung
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Generic version of caching cc switches to avoid searching of switches on each function call CC functions like CheckImplSidePaintingStatus will cycle through all the switches every time the function is called. Initial patch is avoiding it only for IsImplSidePaintingEnabled. So we need a generic way for all the switches, for future use. This patch provides a one time initialization of all the switches in its first encounter (InitializeSwitchesIfRequired) and later on will just read the updated data of the corresponding switches, when required. Declared a seperate structure for holding the switch enable/disable data and saving memory by using bit fields. BUG=313193 TEST=None; no behavior changes; Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=237068

Patch Set 1 #

Total comments: 5

Patch Set 2 : Created a static class to hold the switch initialization! #

Patch Set 3 : Adding the default case for MapImageEnabled #

Total comments: 3

Patch Set 4 : Reworked as per comments! #

Total comments: 2

Patch Set 5 : Reworked on old patch to avoid regression caused due to global pod variable. #

Total comments: 3

Patch Set 6 : Modified patch as per comments #

Patch Set 7 : Removed logging header file. #

Patch Set 8 : Merged with latest code base. #

Patch Set 9 : Modified GPU Rasterization switch accordingly. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -34 lines) Patch
M AUTHORS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M cc/base/switches.cc View 1 2 3 4 5 6 7 8 1 chunk +53 lines, -34 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
sivag
PTAL.
7 years, 1 month ago (2013-11-11 17:03:11 UTC) #1
Tom Hudson
Thanks for writing this. It looks like the kind of pattern we want. Is there ...
7 years, 1 month ago (2013-11-11 17:11:08 UTC) #2
danakj
Some style comments. LCD text does look like another good candidate. https://codereview.chromium.org/69123002/diff/1/cc/base/switches.cc File cc/base/switches.cc (right): ...
7 years, 1 month ago (2013-11-11 17:57:53 UTC) #3
jamesr
What is "stl cycle churn"? Is doing init once per flag really a problem?
7 years, 1 month ago (2013-11-11 19:20:53 UTC) #4
sivag
On 2013/11/11 17:11:08, Tom Hudson wrote: > Thanks for writing this. It looks like the ...
7 years, 1 month ago (2013-11-12 08:57:34 UTC) #5
sivag
On 2013/11/11 19:20:53, jamesr wrote: > What is "stl cycle churn"? Is doing init once ...
7 years, 1 month ago (2013-11-12 09:01:36 UTC) #6
Tom Hudson
On 2013/11/11 19:20:53, jamesr wrote: > What is "stl cycle churn"? Is doing init once ...
7 years, 1 month ago (2013-11-12 10:48:29 UTC) #7
sivag
On 2013/11/11 17:57:53, danakj wrote: > Some style comments. LCD text does look like another ...
7 years, 1 month ago (2013-11-12 12:08:10 UTC) #8
danakj
https://codereview.chromium.org/69123002/diff/130001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/130001/cc/base/switches.cc#newcode154 cc/base/switches.cc:154: class CCSwitchHandler { you're already in the cc:: namespace. ...
7 years, 1 month ago (2013-11-13 19:37:40 UTC) #9
sivag
On 2013/11/13 19:37:40, danakj wrote: > I don't really see the point of the class ...
7 years, 1 month ago (2013-11-14 10:46:14 UTC) #10
danakj
LGTM
7 years, 1 month ago (2013-11-20 01:32:59 UTC) #11
danakj
Can you update the description of the CL as "for avoiding stl cycle." is not ...
7 years, 1 month ago (2013-11-20 01:33:54 UTC) #12
vivekg
https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc#newcode167 cc/base/switches.cc:167: static Switches g_switches; How about moving this global variable ...
7 years, 1 month ago (2013-11-20 01:50:14 UTC) #13
danakj
https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc#newcode167 cc/base/switches.cc:167: static Switches g_switches; On 2013/11/20 01:50:15, vivekg__ wrote: > ...
7 years, 1 month ago (2013-11-20 01:55:21 UTC) #14
vivekg
On 2013/11/20 01:55:21, danakj wrote: > https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc > File cc/base/switches.cc (right): > > https://codereview.chromium.org/69123002/diff/210001/cc/base/switches.cc#newcode167 > ...
7 years, 1 month ago (2013-11-20 02:01:30 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/69123002/210001
7 years ago (2013-11-25 09:13:35 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/69123002/210001
7 years ago (2013-11-25 09:17:28 UTC) #17
commit-bot: I haz the power
Change committed as 237068
7 years ago (2013-11-25 13:44:01 UTC) #18
Roger Tawa OOO till Jul 10th
A revert of this CL has been created in https://codereview.chromium.org/85753003/ by rogerta@chromium.org. The reason for ...
7 years ago (2013-11-25 15:01:01 UTC) #19
Roger Tawa OOO till Jul 10th
A revert of this CL has been created in https://codereview.chromium.org/85903002/ by rogerta@chromium.org. The reason for ...
7 years ago (2013-11-25 15:01:03 UTC) #20
sivag
On 2013/11/25 15:01:03, Roger Tawa wrote: > A revert of this CL has been created ...
7 years ago (2013-11-26 06:25:13 UTC) #21
danakj
https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newcode157 cc/base/switches.cc:157: typedef enum { This is a lot of work. ...
7 years ago (2013-11-26 15:55:50 UTC) #22
sivag
https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newcode157 cc/base/switches.cc:157: typedef enum { On 2013/11/26 15:55:50, danakj wrote: > ...
7 years ago (2013-11-26 17:28:49 UTC) #23
danakj
https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc File cc/base/switches.cc (right): https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newcode157 cc/base/switches.cc:157: typedef enum { On 2013/11/26 17:28:49, Sikugu wrote: > ...
7 years ago (2013-11-26 17:35:16 UTC) #24
sivag
On 2013/11/26 15:55:50, danakj wrote: > https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc > File cc/base/switches.cc (right): > > https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newcode157 > ...
7 years ago (2013-11-26 17:36:45 UTC) #25
sivag
On 2013/11/26 17:35:16, danakj wrote: > https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc > File cc/base/switches.cc (right): > > https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newcode157 > ...
7 years ago (2013-11-26 17:43:56 UTC) #26
enne (OOO)
Whoa whoa, this is a lot of complication for some functions that appear to only ...
7 years ago (2013-11-26 18:59:49 UTC) #27
sivag
7 years ago (2013-11-28 13:30:56 UTC) #28
On 2013/11/26 17:35:16, danakj wrote:
> https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc
> File cc/base/switches.cc (right):
> 
>
https://codereview.chromium.org/69123002/diff/590001/cc/base/switches.cc#newc...
> cc/base/switches.cc:157: typedef enum {
> On 2013/11/26 17:28:49, Sikugu wrote:
> > On 2013/11/26 15:55:50, danakj wrote:
> > > This is a lot of work. Can we just have 4 static bools without a struct?
> > As you know we cannot maintain the static bool global variables, so the only
> way
> > is to maintain the static bool local variables, for this we have to write
two
> > functions for getting every switch value , like  CheckImplSidePaintingStatus

> > and IsImplSidePaintingEnabled.
> > Instead of this we are trying to getswitch value from a single function just
> by
> > adding a extra enum.
> > 
> > 
> > 
> 
> Why can't we have global static bools? We do this all the time with primitive
> types such as bool or pointers. The issue was a static class.

#Siva:: Hi Dana, Please review this i added new code as per the comments.

Powered by Google App Engine
This is Rietveld 408576698