Skip to main content

Performance and Size Tests

Introduction

To measure speed, we compare several of the most popular data serialization formats—JSON, MessagePack, and Protobuf—against Encodexx on a few typical tasks:

  • Serializing an object with 10 fields
  • Serializing an array of numeric objects
  • Serializing deeply nested objects (10 levels deep)

Each serialization run is executed 40 times, measuring the expected execution time and standard deviation.

System Specifications

  • CPU: Intel(R) Core(TM) Ultra 7 155H
  • RAM: 16 GB
  • OS: Windows 11

Data Generation

The data was pre-generated and is not included in the performance measurements.

Test Code

Test code is available in the repository on GitHub

Serialization Results

Test 1 Results

Performed 80 runs

FormatE(x) (ms)σ (ms)Size (KB)
Encodexx222.894222.114412 011
Protobuf465.240155.825211 409
MessagePack741.6133137.099222 214
JSON937.818160.789336 005

Test 2 Results

Performed 40 runs

FormatE(x) (ms)σ (ms)Size (KB)
Encodexx330.030537.870297 657
Protobuf9820.2422179.0492120 006
MessagePack1974.9417447.7696200 066
JSON2793.500256.6046337 412

Test 3 Results

Performed 80 runs

FormatE(x) (ms)σ (ms)Size (KB)
Encodexx152.794032.24436 905
Protobuf297.364942.34696 846
MessagePack84.322827.29567 843
JSON45.548710.15849 278

Deserialization Results

Test 1 Results

Performed 80 runs

FormatE(x) (ms)σ (ms)
Encodexx359.248847.0988
Protobuf241.496729.3344
MessagePack635.8366135.4168
JSON357.902338.7211

Test 2 Results

Performed 40 runs

FormatE(x) (ms)σ (ms)
Encodexx1167.3007180.1760
Protobuf1420.4842341.2971
MessagePack2174.5072556.5641
JSON4289.6828241.2971

Test 3 Results

Performed 80 runs

FormatE(x) (ms)σ (ms)
Encodexx82.794017.4066
Protobuf63.646519.1032
MessagePack156.759356.4024
JSON71.156337.5730

Conclusions

As seen, Encodexx demonstrates excellent performance in both serialization and deserialization speed as well as data size. It also offers outstanding support for TypeScript and custom data types.