-
Notifications
You must be signed in to change notification settings - Fork 684
fix a bug in linked_list memory allocation #720
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
5d14eed
to
7bd9393
Compare
@jiangzidong, great improvement! Raspberry PI 2 measurements
Also, the change revealed an issue in `linked_list_switch_to_next_elem`:
Could you, please, add this fix also? With the fix measurements on Raspberry PI 2 are the following:
|
7bd9393
to
66b2e04
Compare
@jiangzidong nice catch! |
@ruben-ayrapetyan Thanks for your reminding. |
@jiangzidong please add |
66b2e04
to
08e5558
Compare
and Ruben Ayrapetyan fix a bug in linked_list_switch_to_next_elem Related issue: jerryscript-project#720 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
@egavrin ok, done |
Looks good to me |
@galpeter please review this PR. I think we may merge it soon. |
LGTM |
and Ruben Ayrapetyan fix a bug in linked_list_switch_to_next_elem Related issue: #720 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
Merged 3d286b4 |
and Ruben Ayrapetyan fix a bug in linked_list_switch_to_next_elem Related issue: #720 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
and Ruben Ayrapetyan fix a bug in linked_list_switch_to_next_elem Related issue: jerryscript-project#720 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
The correct heap block for linked_list should be like:
| jsp_mm_header | linked_list_header | linked_list_chunk_header | data |
| jsp_mm_header | linked_list_chunk_header | data |
However the linked_list_block_size() shows
| jsp_mm_header | linked_list_header | data |
| jsp_mm_header | linked_list_header | linked_list_chunk_header | data |
it is wrong
it will cause more waste and fragment in mem_heap.
After the patch, the performance and rss data are as follows:
in ubuntu14.04 32bit 3.16.0-30-generic, Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
data is updated after @ruben-ayrapetyan's fix
jzd@jzd32:~/jerryscript$ ./tools/run-perf-test.sh compare_engine/jerry.orig compare_engine/jerry.ll 5 5000 sunspider-1.0.2/
(+ is better)
(+ is better)
the RSS data is coarse and not stable because its minimal unit is 4k.
We can see the mem-stats data for more details.
for 3d-cube:
Peak allocated chunks count: 655 -> 646
Peak waste: 4181 -> 725
for access-fannkuch.js
Peak allocated chunks count: 104 -> 99
Peak waste = 689 -> 237