Browse Source

Config options for hobject resize controls

pull/1284/head
Sami Vaarala 8 years ago
parent
commit
f64a50944e
  1. 14
      config/config-options/DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT.yaml
  2. 13
      config/config-options/DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT.yaml
  3. 8
      config/config-options/DUK_USE_HOBJECT_ARRAY_MINGROW_ADD.yaml
  4. 8
      config/config-options/DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR.yaml
  5. 8
      config/config-options/DUK_USE_HOBJECT_ENTRY_MINGROW_ADD.yaml
  6. 8
      config/config-options/DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR.yaml
  7. 2
      config/config-options/DUK_USE_HOBJECT_HASH_PART.yaml
  8. 20
      config/config-options/DUK_USE_HOBJECT_HASH_PROP_LIMIT.yaml
  9. 4
      config/examples/low_memory.yaml

14
config/config-options/DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT.yaml

@ -0,0 +1,14 @@
define: DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT
introduced: 2.1.0
default: 2
tags:
- performance
- lowmemory
description: >
Abandon array part if its density is below L. The limit L is expressed as
a .3 fixed point point, e.g. 2 means 2/8 = 25%.
The default limit is quite low: one array entry with packed duk_tval is 8
bytes whereas one normal entry is 4+1+8 = 13 bytes without a hash entry,
and 17-21 bytes with a hash entry (load factor 0.5-1.0). So the array part
shouldn't be abandoned very easily from a footprint point of view.

13
config/config-options/DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT.yaml

@ -0,0 +1,13 @@
define: DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT
introduced: 2.1.0
default: 9
tags:
- performance
- lowmemory
description: >
Skip abandon check in object array part resize if new_size < L * old_size.
The limit L is expressed as a .3 fixed point value, e.g. 9 means 9/8 =
112.5% of current size.
This is rather technical and you should only change the parameter if you've
looked at the internals.

8
config/config-options/DUK_USE_HOBJECT_ARRAY_MINGROW_ADD.yaml

@ -0,0 +1,8 @@
define: DUK_USE_HOBJECT_ARRAY_MINGROW_ADD
introduced: 2.1.0
default: 16
tags:
- performance
description: >
Technical internal parameter, see sources for details. Only adjust if
you've looked at the internals.

8
config/config-options/DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR.yaml

@ -0,0 +1,8 @@
define: DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR
introduced: 2.1.0
default: 8
tags:
- performance
description: >
Technical internal parameter, see sources for details. Only adjust if
you've looked at the internals.

8
config/config-options/DUK_USE_HOBJECT_ENTRY_MINGROW_ADD.yaml

@ -0,0 +1,8 @@
define: DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR
introduced: 2.1.0
default: 8
tags:
- performance
description: >
Technical internal parameter, see sources for details. Only adjust if
you've looked at the internals.

8
config/config-options/DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR.yaml

@ -0,0 +1,8 @@
define: DUK_USE_HOBJECT_ENTRY_MINGROW_ADD
introduced: 2.1.0
default: 16
tags:
- performance
description: >
Technical internal parameter, see sources for details. Only adjust if
you've looked at the internals.

2
config/config-options/DUK_USE_HOBJECT_HASH_PART.yaml

@ -9,5 +9,3 @@ description: >
enabled unless the target is very low on memory.
If DUK_USE_OBJSIZES16 is defined, this option must not be defined.
# FIXME: expose property limit for hash table as a DUK_USE_xxx flag?

20
config/config-options/DUK_USE_HOBJECT_HASH_PROP_LIMIT.yaml

@ -0,0 +1,20 @@
define: DUK_USE_HOBJECT_HASH_PROP_LIMIT
introduced: 2.1.0
default: 8
tags:
- performance
- lowmemory
description: >
Minimum number of properties needed for a hash part to be included in the
object property table. This limit is checked whenever an object is resized.
A hash part improves property lookup performance even for small objects,
starting from roughly 4 properties. However, this ignores the cost of
setting up and managing the hash part, which is offset only if property
lookups made through the hash part can offset the setup cost. A hash part
is worth it for heavily accessed small objects or large objects (even those
accessed quite infrequently). The limit doesn't take into account property
access frequency, so it is necessarily a compromise.
A lower value improves performance (a value as low a 4-8 can be useful)
while a higher value conserves memory.

4
config/examples/low_memory.yaml

@ -55,6 +55,10 @@ DUK_USE_STRTAB_RESIZE_CHECK_MASK: 255 # -""-
DUK_USE_HSTRING_ARRIDX: false
# Only add a hash table for quite large objects to conserve memory. Even
# lower memory targets usually drop hash part support entirely.
DUK_USE_HOBJECT_HASH_PROP_LIMIT: 64
# Consider using pointer compression, see doc/low-memory.rst.
#DUK_USE_REFCOUNT16: true
#DUK_USE_STRHASH16: true

Loading…
Cancel
Save