Skip to content
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

API-553 Compact serialization and Generic Records #1172

Merged
merged 154 commits into from
Apr 22, 2022

Conversation

srknzl
Copy link
Member

@srknzl srknzl commented Jan 14, 2022

Compact Serialization

This PR adds the compact serialization support to Node.js client. This new method is more efficient and easier to use. For Java it even works with zero config. In Node.js it is not possible and needs a portable-like configuration.

Benchmark of Eager deserialization + Controlled Serialization vs Master

The async toData/toObject issue is solved using eager deserialization when reading and controlled serialization when writing. I did a benchmark as requested by the team.

Environment

Client and Server commits

Client master: e695651
Client eager deserialization: 9cf2299
Server commit: hazelcast/hazelcast@151c683

Lab environment

1 client 1 server on lab 116 117

command on 116:
node Benchmark.js -t 15000000 -c 1024

command on 117:
docker run --rm --net=host -p 10.212.1.117:5701:5701 hazelcast/hazelcast:5.1-SNAPSHOT

Results

Master

Starting warm-up with 1500000 operations
Warm-up finished
Took 237.587670114 seconds for 15000000 operations
Ops/s: 63134.589403577455
Benchmark finished

Eager deserialization

Starting warm-up with 1500000 operations
Warm-up finished
Took 240.487756286 seconds for 15000000 operations
Ops/s: 62373.237755028385
Benchmark finished

Another run to see deviation of the result:

Starting warm-up with 1500000 operations
Warm-up finished
Took 233.191881556 seconds for 15000000 operations
Ops/s: 64324.70933340712
Benchmark finished

So the deviation is high and about 1-2k. The %1 difference is normal and I conclude that performance did not change. Runs on local also is the same.

END RESULT

There is no difference.

@srknzl srknzl added this to the 5.1 milestone Jan 14, 2022
@srknzl srknzl changed the title Compact deserialzation Compact serialization Jan 14, 2022
src/core/HazelcastError.ts Show resolved Hide resolved
src/core/ReadOnlyLazyList.ts Show resolved Hide resolved
src/core/ReadOnlyLazyList.ts Show resolved Hide resolved
src/invocation/InvocationService.ts Show resolved Hide resolved
src/invocation/InvocationService.ts Outdated Show resolved Hide resolved
src/config/ConfigBuilder.ts Show resolved Hide resolved
src/core/ReadOnlyLazyList.ts Outdated Show resolved Hide resolved
src/core/ReadOnlyLazyList.ts Show resolved Hide resolved
src/invocation/InvocationService.ts Show resolved Hide resolved
src/invocation/InvocationService.ts Outdated Show resolved Hide resolved
@srknzl srknzl requested a review from zpqrtbnk April 13, 2022 09:54
src/nearcache/NearCache.ts Outdated Show resolved Hide resolved
src/invocation/InvocationService.ts Outdated Show resolved Hide resolved
src/proxy/BaseProxy.ts Outdated Show resolved Hide resolved
src/proxy/MapProxy.ts Show resolved Hide resolved
Copy link

@zpqrtbnk zpqrtbnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have reviewed and tried to add meaningful comments. Let's discuss.

src/PartitionService.ts Show resolved Hide resolved
src/config/CompactSerializationConfig.ts Show resolved Hide resolved
src/core/ReadOnlyLazyList.ts Show resolved Hide resolved
src/PartitionService.ts Show resolved Hide resolved
src/invocation/InvocationService.ts Show resolved Hide resolved
src/serialization/compact/Schema.ts Show resolved Hide resolved
this.putIfAbsent(schema);
this.logger.trace('SchemaService', `Found schema id ${schemaId} on the cluster`);
} else {
this.logger.trace('SchemaService', `Did not find schema id ${schemaId} on the cluster`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET also throws an exception in this situation

src/serialization/generic_record/FieldKind.ts Show resolved Hide resolved
Copy link

@yuce yuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link

@zpqrtbnk zpqrtbnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@srknzl srknzl merged commit e1123a5 into hazelcast:master Apr 22, 2022
harunalpak pushed a commit to harunalpak/hazelcast-nodejs-client that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants