summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-20 15:14:58 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-20 19:47:04 +0100
commit9ff2f03c35f46461eb654a6a85483ac0d587d871 (patch)
treed19ced575ca0a036c235e21d16d813d5c9fe4d0b
parent79d9b20aabfd77279d42d4d029504b672d29ef54 (diff)
eo-files: reorder some functionsdevs/bu5hm4n/work_eo_final
this started earlier today in IRC, the idea was that now, that we are having a denser memory layout in the vtables, we could simply reorder the functions in the .eo files into groups that are often called next to each other, that rises the chance that the Vtable nodes as well as the chains are still in the cache. After searching a bit for these groups, the below changed .eo files came up. When a object is constructed, we call a lot parent set constructor finalizer and provider find stuff. So moving these together seems logical. During rendering we also call a lot of gfx hints, which is also paying off, our cache miss number goes down quite a bit. cache misses averages: (Messured on a Dell XPS i7-7700HQ) without this: 8945471 with this: 8014886 Differential Revision: https://phab.enlightenment.org/D11548
-rw-r--r--src/lib/efl/interfaces/efl_gfx_hint.eo182
-rw-r--r--src/lib/eo/efl_object.eo214
2 files changed, 198 insertions, 198 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_hint.eo b/src/lib/efl/interfaces/efl_gfx_hint.eo
index d60ee1b297..2394c11f78 100644
--- a/src/lib/efl/interfaces/efl_gfx_hint.eo
+++ b/src/lib/efl/interfaces/efl_gfx_hint.eo
@@ -23,6 +23,97 @@ interface Efl.Gfx.Hint
23 ]] 23 ]]
24 event_c_prefix: efl_gfx_entity; 24 event_c_prefix: efl_gfx_entity;
25 methods { 25 methods {
26 @property hint_size_max {
27 [[Hints on the object's maximum size.
28
29 This is not a size enforcement in any way, it's just a hint
30 that should be used whenever appropriate.
31
32 The object container is in charge of fetching this property and
33 placing the object accordingly.
34
35 Values -1 will be treated as unset hint components, when
36 queried by managers.
37
38 Note: Smart objects (such as elementary) can have their own
39 hint policy. So calling this API may or may not affect
40 the size of smart objects.
41
42 Note: It is an error for the @.hint_size_max to be smaller in either axis
43 than @.hint_size_min. In this scenario, the max size hint will be
44 prioritized over the user min size hint.
45 ]]
46 values {
47 sz: Eina.Size2D; [[Maximum size (hint) in pixels, (-1, -1) by
48 default for canvas objects).]]
49 }
50 }
51 @property hint_margin {
52 [[Hints for an object's margin or padding space.
53
54 This is not a size enforcement in any way, it's just a hint
55 that should be used whenever appropriate.
56
57 The object container is in charge of fetching this property and
58 placing the object accordingly.
59
60 Note: Smart objects (such as elementary) can have their own
61 hint policy. So calling this API may or may not affect
62 the size of smart objects.
63 ]]
64 /*
65 @image html padding-hints.png
66 */
67 values {
68 l: int; [[Integer to specify left padding.]]
69 r: int; [[Integer to specify right padding.]]
70 t: int; [[Integer to specify top padding.]]
71 b: int; [[Integer to specify bottom padding.]]
72 }
73 }
74 @property hint_align {
75 [[Hints for an object's alignment.
76
77 These are hints on how to align this object inside the
78 boundaries of its container/manager.
79
80 This is not a size enforcement in any way, it's just a hint
81 that should be used whenever appropriate.
82 ]]
83 /*
84 @image html alignment-hints.png
85 */
86 values {
87 x: Efl.Gfx.Align(0.5); [[Controls the horizontal alignment.]]
88 y: Efl.Gfx.Align(0.5); [[Controls the vertical alignment.]]
89 }
90 }
91 @property hint_weight {
92 [[Hints for an object's weight.
93
94 This is a hint on how a container object should resize a given
95 child within its area. Containers may adhere to the simpler
96 logic of just expanding the child object's dimensions to fit
97 its own (see the @Efl.Gfx.Hint_Expand helper weight macro) or
98 the complete one of taking each child's weight hint as real
99 weights to how much of its size to allocate for them in each
100 axis. A container is supposed to, after normalizing the
101 weights of its children (with weight hints), distribut
102 the space it has to layout them by those factors -- most
103 weighted children get larger in this process than the least
104 ones.
105
106 Accepted values are zero or positive values. Some containers might
107 use this hint as a boolean, but some others might consider it as a
108 proportion, see documentation of each container.
109
110 Note: Default weight hint values are 0.0, for both axis.
111 ]]
112 values {
113 x: double; [[Non-negative double value to use as horizontal weight hint.]]
114 y: double; [[Non-negative double value to use as vertical weight hint.]]
115 }
116 }
26 @property hint_aspect { 117 @property hint_aspect {
27 [[Defines the aspect ratio to respect when scaling this object. 118 [[Defines the aspect ratio to respect when scaling this object.
28 119
@@ -50,31 +141,6 @@ interface Efl.Gfx.Hint
50 */ 141 */
51 } 142 }
52 } 143 }
53 @property hint_size_max {
54 [[Hints on the object's maximum size.
55
56 This is not a size enforcement in any way, it's just a hint
57 that should be used whenever appropriate.
58
59 The object container is in charge of fetching this property and
60 placing the object accordingly.
61
62 Values -1 will be treated as unset hint components, when
63 queried by managers.
64
65 Note: Smart objects (such as elementary) can have their own
66 hint policy. So calling this API may or may not affect
67 the size of smart objects.
68
69 Note: It is an error for the @.hint_size_max to be smaller in either axis
70 than @.hint_size_min. In this scenario, the max size hint will be
71 prioritized over the user min size hint.
72 ]]
73 values {
74 sz: Eina.Size2D; [[Maximum size (hint) in pixels, (-1, -1) by
75 default for canvas objects).]]
76 }
77 }
78 @property hint_size_restricted_max { 144 @property hint_size_restricted_max {
79 [[Internal hints for an object's maximum size. 145 [[Internal hints for an object's maximum size.
80 146
@@ -187,72 +253,6 @@ interface Efl.Gfx.Hint
187 sz: Eina.Size2D; [[Minimum size (hint) in pixels.]] 253 sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
188 } 254 }
189 } 255 }
190 @property hint_margin {
191 [[Hints for an object's margin or padding space.
192
193 This is not a size enforcement in any way, it's just a hint
194 that should be used whenever appropriate.
195
196 The object container is in charge of fetching this property and
197 placing the object accordingly.
198
199 Note: Smart objects (such as elementary) can have their own
200 hint policy. So calling this API may or may not affect
201 the size of smart objects.
202 ]]
203 /*
204 @image html padding-hints.png
205 */
206 values {
207 l: int; [[Integer to specify left padding.]]
208 r: int; [[Integer to specify right padding.]]
209 t: int; [[Integer to specify top padding.]]
210 b: int; [[Integer to specify bottom padding.]]
211 }
212 }
213 @property hint_weight {
214 [[Hints for an object's weight.
215
216 This is a hint on how a container object should resize a given
217 child within its area. Containers may adhere to the simpler
218 logic of just expanding the child object's dimensions to fit
219 its own (see the @Efl.Gfx.Hint_Expand helper weight macro) or
220 the complete one of taking each child's weight hint as real
221 weights to how much of its size to allocate for them in each
222 axis. A container is supposed to, after normalizing the
223 weights of its children (with weight hints), distribut
224 the space it has to layout them by those factors -- most
225 weighted children get larger in this process than the least
226 ones.
227
228 Accepted values are zero or positive values. Some containers might
229 use this hint as a boolean, but some others might consider it as a
230 proportion, see documentation of each container.
231
232 Note: Default weight hint values are 1.0, for both axis.
233 ]]
234 values {
235 x: double; [[Non-negative double value to use as horizontal weight hint.]]
236 y: double; [[Non-negative double value to use as vertical weight hint.]]
237 }
238 }
239 @property hint_align {
240 [[Hints for an object's alignment.
241
242 These are hints on how to align this object inside the
243 boundaries of its container/manager.
244
245 This is not a size enforcement in any way, it's just a hint
246 that should be used whenever appropriate.
247 ]]
248 /*
249 @image html alignment-hints.png
250 */
251 values {
252 x: Efl.Gfx.Align(0.5); [[Controls the horizontal alignment.]]
253 y: Efl.Gfx.Align(0.5); [[Controls the vertical alignment.]]
254 }
255 }
256 @property hint_fill { 256 @property hint_fill {
257 [[Hints for an object's fill property that used to specify "justify" 257 [[Hints for an object's fill property that used to specify "justify"
258 or "fill" by some users. @.hint_fill specify whether to fill 258 or "fill" by some users. @.hint_fill specify whether to fill
diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo
index b336a4ee65..26181240b7 100644
--- a/src/lib/eo/efl_object.eo
+++ b/src/lib/eo/efl_object.eo
@@ -75,6 +75,50 @@ abstract Efl.Object
75 c_prefix: efl; 75 c_prefix: efl;
76 76
77 methods { 77 methods {
78 constructor {
79 [[Implement this method to provide optional initialization code for your object.
80
81 See the Life Cycle section in this class' description.]]
82 return: Efl.Object; [[The new object, can be $NULL if aborted.]]
83 }
84 destructor {
85 [[Implement this method to provide deinitialization code for your object if you need it.
86
87 Will be called once @.invalidate has returned.
88 See the Life Cycle section in this class' description.]]
89 }
90 finalize {
91 [[Implement this method to finish the initialization of your object
92 after all (if any) user-provided configuration methods have been
93 executed.
94
95 Use this method to delay expensive operations until user configuration
96 has finished, to avoid building the object in a "default" state in the
97 constructor, just to have to throw it all away because a user
98 configuration (a property being set, for example) requires a different
99 state.
100 This is the last call inside efl_add() and will set @.finalized to $true
101 once it returns.
102 This is an optimization and implementing this method is optional if you
103 already perform all your initialization in the @.constructor method.
104 See the Life Cycle section in this class' description.]]
105 return: Efl.Object; [[The new object. Return $NULL to abort object creation.]]
106 }
107 invalidate {
108 [[Implement this method to perform special actions when your object loses
109 its parent, if you need to.
110
111 It is called when the parent reference is lost or set to $NULL. After this
112 call returns, @.invalidated is set to $true.
113 This allows a simpler tear down of complex hierarchies, by performing
114 object destruction in two steps, first all object relationships are
115 broken and then the isolated objects are destroyed. Performing everything
116 in the @.destructor can sometimes lead to deadlocks, but implementing
117 this method is optional if this is not your case.
118 When an object with a parent is destroyed, it first receives a call to
119 @.invalidate and then to @.destructor.
120 See the Life Cycle section in this class' description.]]
121 }
78 @property parent { 122 @property parent {
79 [[The parent of an object. 123 [[The parent of an object.
80 124
@@ -103,55 +147,6 @@ abstract Efl.Object
103 parent: Efl.Object; [[The new parent.]] 147 parent: Efl.Object; [[The new parent.]]
104 } 148 }
105 } 149 }
106 @property name {
107 [[The name of the object.
108
109 Every EFL object can have a name. Names may not contain the
110 following characters: / ? * [ ] ! \ :
111 Using any of these in a name will result in undefined behavior
112 later on. An empty string is considered the same as a $NULL string
113 or no string for the name.
114 ]]
115 set {
116 }
117 get {
118 }
119 values {
120 name: string; [[The name.]]
121 }
122 }
123 @property comment {
124 [[A human readable comment for the object.
125
126 Every EFL object can have a comment. This is intended for developers
127 and debugging. An empty string is considered the same as a $NULL
128 string or no string for the comment.
129 ]]
130 set {
131 }
132 get {
133 }
134 values {
135 comment: string; [[The comment.]]
136 }
137 }
138 debug_name_override {
139 [[Build a read-only name for this object used for debugging.
140
141 Multiple calls using efl_super() can be chained in order to build
142 the entire debug name, from parent to child classes. In C the usual
143 way to build the string is as follows:
144
145 efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
146 eina_strbuf_append_printf(sb, "new_information");
147
148 Usually more debug information should be added to $sb after
149 calling the super function.
150 ]]
151 params {
152 @in sb: strbuf; [[A string buffer, must not be $null.]]
153 }
154 }
155 @property event_global_freeze_count @static { 150 @property event_global_freeze_count @static {
156 [[Return the global count of freeze events. 151 [[Return the global count of freeze events.
157 152
@@ -224,64 +219,6 @@ abstract Efl.Object
224 } 219 }
225 return : Efl.Object; [[Object from the provider list.]] 220 return : Efl.Object; [[Object from the provider list.]]
226 } 221 }
227 constructor {
228 [[Implement this method to provide optional initialization code for your object.
229
230 See the Life Cycle section in this class' description.]]
231 return: Efl.Object; [[The new object, can be $NULL if aborted.]]
232 }
233 destructor {
234 [[Implement this method to provide deinitialization code for your object if you need it.
235
236 Will be called once @.invalidate has returned.
237 See the Life Cycle section in this class' description.]]
238 }
239 finalize {
240 [[Implement this method to finish the initialization of your object
241 after all (if any) user-provided configuration methods have been
242 executed.
243
244 Use this method to delay expensive operations until user configuration
245 has finished, to avoid building the object in a "default" state in the
246 constructor, just to have to throw it all away because a user
247 configuration (a property being set, for example) requires a different
248 state.
249 This is the last call inside efl_add() and will set @.finalized to $true
250 once it returns.
251 This is an optimization and implementing this method is optional if you
252 already perform all your initialization in the @.constructor method.
253 See the Life Cycle section in this class' description.]]
254 return: Efl.Object; [[The new object. Return $NULL to abort object creation.]]
255 }
256 invalidate {
257 [[Implement this method to perform special actions when your object loses
258 its parent, if you need to.
259
260 It is called when the parent reference is lost or set to $NULL. After this
261 call returns, @.invalidated is set to $true.
262 This allows a simpler tear down of complex hierarchies, by performing
263 object destruction in two steps, first all object relationships are
264 broken and then the isolated objects are destroyed. Performing everything
265 in the @.destructor can sometimes lead to deadlocks, but implementing
266 this method is optional if this is not your case.
267 When an object with a parent is destroyed, it first receives a call to
268 @.invalidate and then to @.destructor.
269 See the Life Cycle section in this class' description.]]
270 }
271 name_find @const @beta {
272 [[Find a child object with the given name and return it.
273
274 The search string can be a glob (shell style, using *). It can also
275 specify class name in the format of "class:name" where ":"
276 separates class and name. Both class and name can be globs.
277 If the class is specified but the name is empty like "class:" then
278 the search will match any object of that class.
279 ]]
280 params {
281 @in search: string; [[The name search string.]]
282 }
283 return: Efl.Object; [[The first object found.]]
284 }
285 event_thaw { 222 event_thaw {
286 [[Thaw events of object. 223 [[Thaw events of object.
287 224
@@ -355,6 +292,20 @@ abstract Efl.Object
355 @in new_obj: Efl.Object; [[The object to emit events from]] 292 @in new_obj: Efl.Object; [[The object to emit events from]]
356 } 293 }
357 } 294 }
295 name_find @const @beta {
296 [[Find a child object with the given name and return it.
297
298 The search string can be a glob (shell style, using *). It can also
299 specify class name in the format of "class:name" where ":"
300 separates class and name. Both class and name can be globs.
301 If the class is specified but the name is empty like "class:" then
302 the search will match any object of that class.
303 ]]
304 params {
305 @in search: string; [[The name search string.]]
306 }
307 return: Efl.Object; [[The first object found.]]
308 }
358 children_iterator_new { 309 children_iterator_new {
359 [[Get an iterator on all children.]] 310 [[Get an iterator on all children.]]
360 return: iterator<Efl.Object> @move @no_unused; [[Children iterator]] 311 return: iterator<Efl.Object> @move @no_unused; [[Children iterator]]
@@ -429,6 +380,55 @@ abstract Efl.Object
429 } 380 }
430 return: bool; [[$true if successfully unregistered, $false otherwise.]] 381 return: bool; [[$true if successfully unregistered, $false otherwise.]]
431 } 382 }
383 @property name {
384 [[The name of the object.
385
386 Every EFL object can have a name. Names may not contain the
387 following characters: / ? * [ ] ! \ :
388 Using any of these in a name will result in undefined behavior
389 later on. An empty string is considered the same as a $NULL string
390 or no string for the name.
391 ]]
392 set {
393 }
394 get {
395 }
396 values {
397 name: string; [[The name.]]
398 }
399 }
400 @property comment {
401 [[A human readable comment for the object.
402
403 Every EFL object can have a comment. This is intended for developers
404 and debugging. An empty string is considered the same as a $NULL
405 string or no string for the comment.
406 ]]
407 set {
408 }
409 get {
410 }
411 values {
412 comment: string; [[The comment.]]
413 }
414 }
415 debug_name_override {
416 [[Build a read-only name for this object used for debugging.
417
418 Multiple calls using efl_super() can be chained in order to build
419 the entire debug name, from parent to child classes. In C the usual
420 way to build the string is as follows:
421
422 efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
423 eina_strbuf_append_printf(sb, "new_information");
424
425 Usually more debug information should be added to $sb after
426 calling the super function.
427 ]]
428 params {
429 @in sb: strbuf; [[A string buffer, must not be $null.]]
430 }
431 }
432 } 432 }
433 implements { 433 implements {
434 class.constructor; 434 class.constructor;