This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
[[ Perf ]] Array access optimizations #6845
Merged
Merged
Conversation
This file contains hidden or 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 patch adds the MCStringIsInteger method which checks that the given string is a strict integer - i.e. one matching the regex -?(0|[1-9][0-9]*).
This patch ensures that MCNumberParseOffset respects the integer_only flag when the string is unicode.
This patch adds various benchmarks both from user suggestions and internal work.
This patch adds a 'MakeUnique' method to the value-ref auto classes which attempts to uniquify the value held in the auto instance.
This patch adds PE_OUT_OF_MEMORY which is used if parsing a construct results in a memory error.
This patch adds tests which report information about the sizes of each of the libfoundation core (internal) type structures and also attempts to illustrate the actual overhead of small blocks allocated with malloc.
This patch minimises the size of the libfoundatino core value structures. Specifically it shifts the order of some fields in __MCString and __MCData resulting in a reduction in size on 64-bit. Additionally, on 64-bit, the hash field has been removed from __MCName with 28-bits being placed in the flag word, and the remaining 4-bits being split between the lowest two bits of the key and next fields - this means that hash-order is preserved. The effect on this on memory utilization will vary depending on platform and architecture - most critically, the effacy of the implementatin of malloc for small object sizes. However, on 64-bit Mac, it means that __MCName and __MCString will both fit into a 32-byte (no overhead) malloc block, as opposed to a 48-byte (no overhead) malloc block as occurred previously.
Seems to have hit an issue with an IDE test for progress startValue default value... seems odd. |
1079b57
to
1fa7d9e
Compare
This patch modifies MCContainer so that it can hold a short array path as part of itself, rather than requiring a memory allocation. Longer paths will fall back to using a dynamically allocated array.
This patch introduces the concept of an 'index' MCNameRef, one which is generated from an index_t value. Index names have optimized code paths for conversion of the index to a string, hashing and insertion into the name table - all taking advantage of the unique properties integer strings have.
1fa7d9e
to
d40bc41
Compare
@livecode-vulcan review ok d40bc41 |
💙 review by @livecodeali ok d40bc41 |
livecode-vulcan
added a commit
that referenced
this pull request
Jan 14, 2019
[[ Perf ]] Array access optimizations This patch contains a subset of the patches from #6671 - specifically those aimed at improving the performance of array access. Specifically using an optimized code-path when generating an index name (i.e. a strict integer value), and using on-heap storage for short array paths (those up to 6 elements deep).
😞 test failure d40bc41
|
@livecode-vulcan retry d40bc41 |
livecode-vulcan
added a commit
that referenced
this pull request
Jan 14, 2019
[[ Perf ]] Array access optimizations This patch contains a subset of the patches from #6671 - specifically those aimed at improving the performance of array access. Specifically using an optimized code-path when generating an index name (i.e. a strict integer value), and using on-heap storage for short array paths (those up to 6 elements deep).
😎 test success d40bc41
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch contains a subset of the patches from #6671 - specifically those aimed at improving the performance of array access. Specifically using an optimized code-path when generating an index name (i.e. a strict integer value), and using on-heap storage for short array paths (those up to 6 elements deep).