Skip to content

Commit

Permalink
feat(models): heap size performance optimization
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Blaginov <stefan@blaginov.com>
Signed-off-by: Stefan Blaginov <stefan.blaginov@docusign.com>
  • Loading branch information
Stefan Blaginov authored and Stefan Blaginov committed Feb 1, 2024
1 parent 204d0ed commit f5b02eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/common/benchmarkModelGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class BenchmarkModelGenerator {
propertiesSizeBudget = propertiesSizeBudget - this.jsonSize(generatedProperty);
if (propertiesSizeBudget >= 0) {
propertyI++;
properties = [ ...properties, generatedProperty ];
properties.push(generatedProperty);
} else {
oversized = true;
}
Expand Down Expand Up @@ -234,7 +234,7 @@ class BenchmarkModelGenerator {
declarationsSizeBudget = declarationsSizeBudget - this.jsonSize(generatedDeclaration);
if (declarationsSizeBudget >= 0) {
declarationI++;
declarations = [...declarations, generatedDeclaration];
declarations.push(generatedDeclaration);
} else {
oversized = true;
}
Expand Down Expand Up @@ -262,13 +262,13 @@ class BenchmarkModelGenerator {
declarationsSizeBudget - this.jsonSize(declarations)
) / (nDeclarations - declarationI);

const declaration = this.generateDeclarationToSize({
const generatedDeclaration = this.generateDeclarationToSize({
modelI,
declarationI,
declarationSizeBudget: remainingDeclarationSizeBudget,
});
declarationI++;
declarations = [ ...declarations, declaration ];
declarations.push(generatedDeclaration);
}

return declarations;
Expand Down

0 comments on commit f5b02eb

Please sign in to comment.