Current state
The current Gwork allocation stats from:
commit a95a0fde3afb68d2fd4d7af817159c4891db970d
AuthorDate: Mon Aug 15 20:26:21 2016 +0100
Name | Alloc count | Alloc size |
---|---|---|
API test | 9018 | 1566856 (1530.133KB) |
Button | 53 | 11024 (10.766KB) |
Checkbox | 34 | 6088 (5.945KB) |
CollapsibleList | 208 | 39744 (38.812KB) |
ColorPicker | 281 | 32680 (31.914KB) |
ComboBox | 4194 | 755408 (737.703KB) |
CrossSplitter | 54 | 11128 (10.867KB) |
GroupBox | 13 | 3928 (3.836KB) |
ImagePanel | 6 | 1248 (1.219KB) |
Label | 45 | 8168 (7.977KB) |
LabelMultiline | 36 | 8736 (8.531KB) |
ListBox | 252 | 46040 (44.961KB) |
MenuStrip | 817 | 153304 (149.711KB) |
Numeric | 39 | 5056 (4.938KB) |
PageControl | 58 | 11568 (11.297KB) |
ProgressBar | 72 | 9728 (9.500KB) |
Properties | 608 | 83240 (81.289KB) |
RadioButton | 62 | 12072 (11.789KB) |
ScrollControl | 602 | 113640 (110.977KB) |
Slider | 34 | 5040 (4.922KB) |
StatusBar | 10 | 2000 (1.953KB) |
TabControl | 181 | 34016 (33.219KB) |
TextBox | 234 | 23080 (22.539KB) |
TreeControl | 714 | 117984 (115.219KB) |
Window | 14 | 2712 (2.648KB) |
GWEN stats
Name | Alloc count | Alloc size |
---|---|---|
API test | 10051 | 1721899 (1681.542KB) |
Button | 62 | 11736 (11.461KB) |
Checkbox | 35 | 6152 (6.008KB) |
CollapsibleList | 229 | 40952 (39.992KB) |
ColorPicker | 341 | 36256 (35.406KB) |
ComboBox | 4742 | 792208 (773.641KB) |
CrossSplitter | 63 | 15352 (14.992KB) |
GroupBox | 15 | 10264 (10.023KB) |
ImagePanel | 8 | 1408 (1.375KB) |
Label | 53 | 9304 (9.086KB) |
LabelMultiline | 41 | 18920 (18.477KB) |
ListBox | 289 | 66771 (65.206KB) |
MenuStrip | 983 | 203992 (199.211KB) |
Numeric | 44 | 5216 (5.094KB) |
PageControl | 64 | 12096 (11.812KB) |
ProgressBar | 73 | 10016 (9.781KB) |
Properties | 661 | 80348 (78.465KB) |
RadioButton | 68 | 12592 (12.297KB) |
ScrollControl | 574 | 105864 (103.383KB) |
Slider | 34 | 4912 (4.797KB) |
StatusBar | 11 | 2144 (2.094KB) |
TabControl | 182 | 41952 (40.969KB) |
TextBox | 306 | 37552 (36.672KB) |
TreeControl | 727 | 121572 (118.723KB) |
Window | 16 | 2856 (2.789KB) |
As you can see the "unit test" from GWEN use 1681.542KB, with Gwork using 1530.133KB. So that's roughly 160KB smaller. Note, this is from the gwen branch in the Gwork repo.
Comparison
There is a more detailed comparison below.
There is a more detailed comparison below.
Name | Count delta | Size delta | % size |
---|---|---|---|
API test | -1063 | -163051 (-159.229KB) | 90.5% |
Button | -9 | -712 | 93.9% |
Checkbox | -1 | -64 | 99.0% |
CollapsibleList | -21 | -1208 (-1.180KB) | 97.1% |
ColorPicker | -64 | -3752 (-3.664KB) | 89.7% |
ComboBox | -548 | -36800 (-35.938KB) | 95.4% |
CrossSplitter | -9 | -4224 (-4.125KB) | 72.5% |
GroupBox | -2 | -6336 (-6.188KB) | 38.3% |
ImagePanel | -2 | -160 | 88.6% |
Label | -8 | -1136 (-1.109KB) | 87.8% |
LabelMultiline | -5 | -10184 (-9.945KB) | 46.2% |
ListBox | -37 | -20731 (-20.245KB) | 69.0% |
MenuStrip | -166 | -50688 (-49.500KB) | 75.2% |
Numeric | -5 | -160 | 96.9% |
PageControl | -7 | -776 | 93.6% |
ProgressBar | -1 | -288 | 97.1% |
Properties | -53 | 2892 (2.824KB) | 103.6% |
RadioButton | -6 | -520 | 95.9% |
ScrollControl | 4 | 200 | 100.2% |
Slider | 0 | 128 | 102.6% |
StatusBar | -1 | -144 | 93.3% |
TabControl | -1 | -7936 (-7.750KB) | 81.1% |
TextBox | -72 | -14472 (-14.133KB) | 61.5% |
TreeControl | -13 | -3588 (-3.504KB) | 97.0% |
Window | -2 | -144 | 95.0% |
There isn't much detail about where the savings come from but the unicode string changes will have had an effect. GWEN stored every control string as wide unicode and as ASCII. LabelMultiline has a considerable saving, probably due to this. Interesting that a couple are larger than GWEN. Will have to investigate this.
Future Work
Future Work
This gives a reference point on which to compare any future memory saving work. Work here might include:
- Event system refactor. This is pretty inefficient as every control contains listeners and the associated containers whether used or not.
- Type size and reordering. E.g. booleans might be better as chars, enums as chars etc. These might also be more efficient packed in the controls by reordering them.
No comments:
Post a Comment