Skip to content

Commit

Permalink
Expand types in fromEntries benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
meded7 committed Mar 27, 2024
1 parent f69c680 commit 2bd8210
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions port/js/benchmarks/fromEntries.benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ let srcStruct = new Struct({
{ name: 'type_Uint64', type: 'Uint64' },
{ name: 'type_String', type: 'String' },
{ name: 'type_Double', type: 'Double' },
{ name: 'type_Char', type: 'Char' }
{ name: 'type_Char', type: 'Char' },
{ name: '_type_Int8', type: 'Int8' },
{ name: '_type_Uint8', type: 'Uint8' },
{ name: '_type_Int16', type: 'Int16' },
{ name: '_type_Uint16', type: 'Uint16' },
{ name: '_type_Int32', type: 'Int32' },
{ name: '_type_Uint32', type: 'Uint32' },
{ name: '_type_Int64', type: 'Int64' },
{ name: '_type_Uint64', type: 'Uint64' },
{ name: '_type_String', type: 'String' },
{ name: '_type_Double', type: 'Double' },
{ name: '_type_Char', type: 'Char' }
]
});

Expand All @@ -34,14 +45,25 @@ let srcData = {
type_Uint64: BigInt(8),
type_String: 'This is test string',
type_Double: -Math.PI,
type_Char: 'A'
type_Char: 'A',
_type_Int8: 8,
_type_Uint8: 8,
_type_Int16: 8,
_type_Uint16: 8,
_type_Int32: 8,
_type_Uint32: 8,
_type_Int64: BigInt(8),
_type_Uint64: BigInt(8),
_type_String: 'This is test string',
_type_Double: -Math.PI,
_type_Char: 'A'
};
srcData.__SIZE__ = Buffer.calcSize(Buffer.createValueArray(srcStruct.fields, srcData));
let b = Buffer.serializeObj(srcStruct.schema.fields, srcData);



describe('Object.fromEntries vs mutation Object ', () => {
describe('Buffer(b).deserialize ', () => {

beforeEach(() => {
srcData = {
Expand Down

0 comments on commit 2bd8210

Please sign in to comment.