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

Issue 102733006: Use bit fields inside cc to reduce memory usage. (Closed)

Created:
7 years ago by vivekg_samsung
Modified:
7 years ago
Reviewers:
danakj, vivekg, Nico, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Use bit fields inside cc to reduce memory usage. Using bitfields we get the memory usage as follows +-----+---------------------------+------------------------+---------+ |.No..|.Class/Structure/File......|.Size.of.object.(bytes).|.Memory..| |.....|...........................+------------------------+.Reduced.| |.....|...........................|...Before..|...After....|.........| +-----+---------------------------+-----------+------------+---------+ |..1..|.cc::Layer.................|......840..|.....824....|......16.| +-----+---------------------------+-----------+------------+---------+ |..2..|.cc::LayerImpl.............|......880..|.....864....|......16.| +-----+---------------------------+-----------+------------+---------+ |..3..|.cc::RenderSurfaceImpl.....|......408..|.....400....|.......8.| +-----+---------------------------+-----------+------------+---------+ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=239682

Patch Set 1 #

Patch Set 2 : Modified after the review comments! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -59 lines) Patch
M cc/layers/layer.h View 2 chunks +16 lines, -16 lines 0 comments Download
M cc/layers/layer.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M cc/layers/layer_impl.h View 2 chunks +24 lines, -25 lines 0 comments Download
M cc/layers/layer_impl.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M cc/layers/render_surface_impl.h View 1 chunk +7 lines, -7 lines 0 comments Download
M cc/layers/render_surface_impl.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
vivekg
Using the bitfields has got the memory sizes as depicted in above table. I understand ...
7 years ago (2013-12-09 12:34:17 UTC) #1
danakj
Given those numbers, in practice I could see this saving about 1KB of memory. That ...
7 years ago (2013-12-09 18:10:34 UTC) #2
enne (OOO)
Let's do this only for Layer/LayerImpl/RenderSurfaceImpl since many of those are active at once per ...
7 years ago (2013-12-09 18:26:05 UTC) #3
vivekg
On 2013/12/09 18:10:34, danakj wrote: > Given those numbers, in practice I could see this ...
7 years ago (2013-12-09 20:53:17 UTC) #4
vivekg
On 2013/12/09 18:26:05, enne wrote: > Let's do this only for Layer/LayerImpl/RenderSurfaceImpl since many of ...
7 years ago (2013-12-09 20:55:54 UTC) #5
enne (OOO)
Thanks! Can you also update the description to reflect the changes?
7 years ago (2013-12-09 20:58:10 UTC) #6
vivekg
On 2013/12/09 20:58:10, enne wrote: > Thanks! Can you also update the description to reflect ...
7 years ago (2013-12-09 20:59:43 UTC) #7
enne (OOO)
Thanks, lgtm.
7 years ago (2013-12-09 21:03:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vivek.vg@samsung.com/102733006/20001
7 years ago (2013-12-10 01:24:56 UTC) #9
commit-bot: I haz the power
Failed to apply the patch. Sending cc/layers/layer.cc Sending cc/layers/layer.h Sending cc/layers/layer_impl.cc Sending cc/layers/layer_impl.h Sending cc/layers/render_surface_impl.cc ...
7 years ago (2013-12-10 05:40:31 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vivek.vg@samsung.com/102733006/20001
7 years ago (2013-12-10 05:45:37 UTC) #11
commit-bot: I haz the power
Change committed as 239682
7 years ago (2013-12-10 05:48:54 UTC) #12
Nico
7 years ago (2013-12-10 06:37:31 UTC) #13
Message was sent while issue was closed.
I happened to see this fly by. I'd like to echo Dana's concerns that unless this
saves hundreds of kB of memory, this doesn't seem worth it (gcc 4.6 generates
invalid implicit move constructors for bitfields in c++11 mode for example, so
it's not a completely academic concern).

Powered by Google App Engine
This is Rietveld 408576698