-
Notifications
You must be signed in to change notification settings - Fork 686
Reduce memory consumption of property names. #1445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e146594 to
e11ae2e
Compare
jerry-core/ecma/base/ecma-globals.h
Outdated
| lit_magic_string_id_t magic_string_id; /**< identifier of a magic string */ | ||
| lit_magic_string_ex_id_t magic_string_ex_id; /**< identifier of an external magic string */ | ||
| uint32_t magic_string_id; /**< identifier of a magic string */ | ||
| uint32_t magic_string_ex_id; /**< identifier of an external magic string */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the type of magic_string_id and magic_string_ex_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was that their storage size was unknown before. Now uint32_number, magic_string_id, and magic_string_ex_id uses the same storage type (common_uint32_field) and this opens up several optimizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should refer to to their real types. Please update the comments.
e11ae2e to
7c08132
Compare
Property names were always required a string reference which consumed a large amount of memory for arrays. This patch reduces this consumption by directly storing the value part of certain strings. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
7c08132 to
6d67b8d
Compare
LaszloLango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dbatyai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@zherczeg Nice, great improvement! |
Large memory improvements. E.g. bitops-nsieve-bits.js 28%, crypto-sha1.js 26%, crypto-md5.js 23%, ...
Binary size is unchanged (152544 bytes), however unlikely is that with such a big patch.
Performance is decreased because of the increased complexity by 1%. Most tests are not changed much, but bitops-bitwise-and.js is decreased by 9%.