Skip to content

Commit

Permalink
Optimize array creation and rename benchmark files
Browse files Browse the repository at this point in the history
  • Loading branch information
meded7 committed Mar 28, 2024
1 parent 2bd8210 commit 38c8bc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions port/js/benchmarks/src-variant/messgen-fromEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export class Buffer {

let fields = struct.fields,
dv = this._dataView,
resEntries = [];
resEntries = new Array(struct.fields.length );


let currOffset = 0
Expand All @@ -528,7 +528,7 @@ export class Buffer {


let value = new ArrayType(length)
resEntries.push([fi.name, value])
resEntries[f]=([fi.name, value])

let currOffset_dyn = DYN_TYPE_SIZE + currOffset

Expand Down Expand Up @@ -568,7 +568,7 @@ export class Buffer {
//Static size array
//
let value = new ArrayType(p.length)
resEntries.push([fi.name, value])
resEntries[f]=([fi.name, value])


if (p.typeIndex === typeIndex.String) {
Expand Down Expand Up @@ -600,9 +600,9 @@ export class Buffer {
}
} else {
if (p.isComplex) {
resEntries.push([fi.name, this.__deserialize__(p.typeIndex, currOffset, sizeOffset)])
resEntries[f]=([fi.name, this.__deserialize__(p.typeIndex, currOffset, sizeOffset)])
} else {
resEntries.push([fi.name, readFunc[p.typeIndex](dv, currOffset + this._dynamicOffset)])
resEntries[f]=([fi.name, readFunc[p.typeIndex](dv, currOffset + this._dynamicOffset)])

if (p.typeIndex === typeIndex.String) {
this._dynamicOffset += dv.getUint32(currOffset + this._dynamicOffset, true)
Expand Down

0 comments on commit 38c8bc7

Please sign in to comment.