-
Notifications
You must be signed in to change notification settings - Fork 683
Remove ECMA_STRING_CONTAINER_CONCATENATION type from ecma_string #635
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
Remove ECMA_STRING_CONTAINER_CONCATENATION type from ecma_string #635
Conversation
JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkosztyo.u-szeged@partner.samsung.com
See also: #548 |
@LaszloLango, could you, please, describe memory footprint changes related to the patch? Also, could you, please, provide memory footprints comparision on some "concatenation-only" tests to make changes, related to the patch, more clear? |
|
Measured on RaspberryPi:
|
It's strange that there are different number of files measured on intel/rpi |
@galpeter, jerry fails on crypto-aes.js (exit code is 1), so we don't use it for testing. |
@sand1k, thanks for the RPi results. The crypto-aes.js does not fail for me (intel/release.linux). What cause the fail? Shouldn't we fix the sunspider tests to be able to run as much tests as possible? IMHO results on a subset of any benchmark could be misleading. |
Nice improvement! |
Looks good to me. |
@LaszloLango, what do you think about the following test? var i = '0123456789ABCDEF';
for (j = 0; j < 12; j++)
{
i += i;
}
print (i[124]); Please, see memory statistics for the following versions:
Are there any considerations on how the regression is planned to be fixed? |
thanks for your comment. Both implementation have advantages and disadvantages. In the new solution, if you concatenate the exact same string, then it will use more memory than before. This usecase is less frequent. I think that because of the benchmark results. I could suggest three solutions after your comment:
|
This is not the only case. Please, see the following examples: var i = '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF';
var j = 'abcdefghijklmnopabcdefghijklmnopabcdefghijklmnopabcdefghijklmnop';
var a = '';
for (k = 0; k < 16; k++)
{
if (k % 4 == 0)
{
a += (i + j);
}
else if (k % 2 == 0)
{
i += a;
}
else
{
j += a;
}
}
print (a[124]);
var i = '01';
var j = 'ab';
var a = '';
for (k = 0; k < 16; k++)
{
if (k % 4 == 0)
{
a += (i + j);
}
else if (k % 2 == 0)
{
i += a;
}
else
{
j += a;
}
}
print (a[124]);
|
@LaszloLango, considering #635 (comment), what do you think of the fourth - to perform investigation of ways to improve / optimize concatenation representation and processing routines for various cases, producing a comprehensive solution? |
@ruben-ayrapetyan, OK. Give me some time to investigate this. I have some ideas for the issue. Could you raise a GitHub issue for this conversation? |
JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkosztyo.u-szeged@partner.samsung.com
Base rev: 6697523
(+ is better)
(+ is better)