-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1284 from svaarala/rework-object-hash
Rework object hash part algorithm
- Loading branch information
Showing
24 changed files
with
366 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
config/config-options/DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 13 additions & 0 deletions
13
config/config-options/DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 8 additions & 0 deletions
8
config/config-options/DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 8 additions & 0 deletions
8
config/config-options/DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
config/config-options/DUK_USE_HOBJECT_HASH_PROP_LIMIT.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.