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

Issue 2859033002: [sync] Add constexpr to EnumSet (Closed)

Created:
3 years, 7 months ago by Patrick Noland
Modified:
3 years, 6 months ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, sync-reviews_chromium.org, droger+watchlist_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[sync] Add constexpr to EnumSet constexpr allows the programmer to assert their intention that a particular function or variable should be evaluatable at compile time given the correct circumstances. If one adheres to the restrictions imposed by constexpr, the compiler can often aggressively optimize away code, leading to smaller binary size and improved performance. This cl makes ModelTypeSet's varargs constructor as well as All() and FromRange() constexpr. It leverages this to make several of model_type.h's Types() functions contexpr as well. In my testing, this saves about 34 kb from the release binary. A synthetic performance test that calls UserTypes(), CoreTypes() etc. in a loop ran 3-4x faster on both debug and release builds, although the magnitude of the difference was obviously smaller in the release builds. Review-Url: https://codereview.chromium.org/2859033002 Cr-Commit-Position: refs/heads/master@{#478847} Committed: https://chromium.googlesource.com/chromium/src/+/4d8a7c16ddb43b19a0768c68ccb2c72400879485

Patch Set 1 : Add constexpr to EnumSet #

Total comments: 23

Patch Set 2 : [sync] Add constexpr to EnumSet #

Total comments: 2

Patch Set 3 : Move reading list switches and buildflag to /features #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -196 lines) Patch
M components/browser_sync/BUILD.gn View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/browser_sync/DEPS View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/browser_sync/profile_sync_components_factory_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/browser_sync/profile_sync_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/reading_list/core/BUILD.gn View 1 2 3 chunks +2 lines, -22 lines 0 comments Download
D components/reading_list/core/reading_list.gni View 1 2 1 chunk +0 lines, -9 lines 0 comments Download
D components/reading_list/core/reading_list_switches.h View 1 2 1 chunk +0 lines, -15 lines 0 comments Download
M components/reading_list/core/reading_list_switches.cc View 1 2 1 chunk +0 lines, -17 lines 0 comments Download
A components/reading_list/features/BUILD.gn View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
A + components/reading_list/features/reading_list.gni View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + components/reading_list/features/reading_list_switches.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
A + components/reading_list/features/reading_list_switches.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M components/sync/BUILD.gn View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/sync/base/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/base/enum_set.h View 1 3 chunks +39 lines, -22 lines 0 comments Download
M components/sync/base/enum_set_unittest.cc View 2 chunks +17 lines, -0 lines 0 comments Download
M components/sync/base/model_type.h View 1 2 3 chunks +73 lines, -14 lines 0 comments Download
M components/sync/driver/data_type_manager_impl.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/engine_impl/sync_encryption_handler_impl_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/syncable/DEPS View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/syncable/model_type.cc View 1 2 4 chunks +0 lines, -83 lines 0 comments Download

Messages

Total messages: 81 (71 generated)
Patrick Noland
Sky, PTAL I think the trybot failures are infra flakiness, but I will retry them ...
3 years, 7 months ago (2017-05-05 22:49:12 UTC) #34
skym
lgtm https://codereview.chromium.org/2859033002/diff/140001/components/sync/base/enum_set.h File components/sync/base/enum_set.h (right): https://codereview.chromium.org/2859033002/diff/140001/components/sync/base/enum_set.h#newcode129 components/sync/base/enum_set.h:129: // constexpr construct our bitset. This packing is ...
3 years, 7 months ago (2017-05-05 23:15:42 UTC) #35
Patrick Noland
+noyau for added reading_list dependency; the new use of the build flag is the same ...
3 years, 7 months ago (2017-05-08 20:29:20 UTC) #41
noyau (Ping after 24h)
https://codereview.chromium.org/2859033002/diff/160001/components/sync/base/DEPS File components/sync/base/DEPS (right): https://codereview.chromium.org/2859033002/diff/160001/components/sync/base/DEPS#newcode7 components/sync/base/DEPS:7: "+components/reading_list/core", I'm not a big fan of sync/base having ...
3 years, 7 months ago (2017-05-09 13:10:02 UTC) #42
Patrick Noland
noyau@, PTAL https://codereview.chromium.org/2859033002/diff/160001/components/sync/base/DEPS File components/sync/base/DEPS (right): https://codereview.chromium.org/2859033002/diff/160001/components/sync/base/DEPS#newcode7 components/sync/base/DEPS:7: "+components/reading_list/core", On 2017/05/09 13:10:02, noyau (Ping after ...
3 years, 6 months ago (2017-06-07 17:40:29 UTC) #70
noyau (Ping after 24h)
Thanks for the changes, way better dependency graph. lgtm
3 years, 6 months ago (2017-06-07 20:35:14 UTC) #71
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2859033002/240001
3 years, 6 months ago (2017-06-07 20:39:19 UTC) #74
commit-bot: I haz the power
CQ cannot get SignCLA result. Please try later.
3 years, 6 months ago (2017-06-07 20:40:05 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2859033002/240001
3 years, 6 months ago (2017-06-12 21:24:56 UTC) #78
commit-bot: I haz the power
3 years, 6 months ago (2017-06-13 00:52:31 UTC) #81
Message was sent while issue was closed.
Committed patchset #3 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/4d8a7c16ddb43b19a0768c68ccb2...

Powered by Google App Engine
This is Rietveld 408576698