maxbundscherer / akka-serialization-comparison

This project compares different serializers can be used in akka projects (for example in persistence or cluster)

Home Page:https://bundscherer-online.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Akka Serialization Comparison

shields.io

Author: Maximilian Bundscherer

Overview

This project compares different serializers can be used in akka projects (for example in Akka Persistence or Akka Cluster).

Which serializer does this work compares?

  • Java Serialization (should not be used in production)
  • JSON Serialization (with Circe)
  • Protobuf Serialization (with ScalaPB)

Requirements

  • Java JDK (JDK 8)
  • Scala (v. 2.12.7 or higher - normally shipped with sbt)
  • Sbt (v. 1.2.6 or higher)

Included dependencies

Let´s get started

You can run this project in two modes:

  • ExperimentMode: Test different serializers by timekeeping with complete Akka Actors System etc.
  • BenchmarkMode: Only test different serializers by ScalaMeter

First of all you should read and understand the test params. They are located in ./src/main/resources/params.conf

Start ExperimentMode

  1. Checkout project
  2. Go to ./ (project root folder)
  3. Run command sbt clean run (clean database)
  4. Or run command sbt run (non clean database)

Important: There are thrown RuntimeExceptions (Simulate crash): This behavior is desirable.

Start BenchmarkMode

  1. Checkout project
  2. Go to ./ (project root folder)
  3. Run command sbt clean test

Advanced

To run both modes after each other you can run command sbt mixedMode.

To run both modes after each other and pipe outputs to files you can run command ./autoRunner.sh (check script before you do that).

Increase default sbt memory-params

To get better results increase your default sbt memory-params with: export SBT_OPTS="-Xms1G -Xmx8G"

  • Xms specifies the initial memory allocation pool.
  • Xmx specifies the maximum memory allocation pool.

About

This project compares different serializers can be used in akka projects (for example in persistence or cluster)

https://bundscherer-online.de/

License:Apache License 2.0


Languages

Language:Scala 92.4%Language:Java 7.2%Language:Shell 0.4%