Skip to content

Simple fixes to reduce memory consumption. #935

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

VadimZhestikov
Copy link
Contributor

@VadimZhestikov VadimZhestikov commented Jun 27, 2025

As primary test was used following test-fill-array script, and bench4 script:

function init(size) {
    var o = {};
    for (var i=0; i<size; i++) {
        o[`some_property${i}`] = i;
    }
}

function handler() {
    var size = ("undefined" == typeof scriptArgs) ? Number(process.argv[2]):
       Number(scriptArgs[1]);

    console.log('init size='+size);

    init(size);
}

handler();

As additional test was used bench4 testsuite.

############### test-fill-array 1000000

qjs
init size=1000000
RSS:91452kb

njs (this patch)
init size=1000000
RSS:239024kb

njs (before this patch)
init size=1000000
RSS:607508kb

njs v0.8.9 (before "atomic patch")
init size=1000000
RSS:499816kb

############### bench4

qjs
Richards: 898
Crypto: 1060
RayTrace: 1003
NavierStokes: 1913
----
Score (version 9): 1162
RSS:6420kb

njs (this patch)
Richards: 634
Crypto: 1014
RayTrace: 501
NavierStokes: 1553
----
Score (version 9): 841
RSS:2697088kb

njs (before this patch)
Richards: 564
Crypto: 952
RayTrace: 494
NavierStokes: 1440
----
Score (version 9): 786
RSS:2830720kb

njs v0.8.9 (before "atomic patch")
Richards: 361
Crypto: 853
RayTrace: 363
NavierStokes: 1309
----
Score (version 9): 618
RSS:3026688kb

Fixes for memory consumption in flathsh will be added soon.

@VadimZhestikov VadimZhestikov changed the title Simple fixes to reduce memory consumption, Simple fixes to reduce memory consumption. Jun 27, 2025
@VadimZhestikov VadimZhestikov requested a review from xeioex June 27, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant