Overview

Odin is a Java library that can be used for object serialization, configuration files, network transfers or whatever you want.


This library comes with a new data format: odn ( Object Data Notation ), specially designed to remove the limitations of current serialization formats like JSON or XML.



The odn format has been created with multiple objectives:

  • Being able to serialize all POO patterns without any code modification.

  • Being usable for all the needs in terms of text files: properties, i18n, data...

  • Being easy to read and modify.

Why you should use Odin

Odin is the best choice you can make if you need to save objects in very few lines of code and without any object modifications ( no annotations or adapters are required even for complex object ).

This is a light-weighed library that comes without any dependencies and in a .jar of approximately 150KB.


Odin also has the fastest object serialization for Java.

Benchmark

In order to test and compare Odin's performance, a simple model using 2 classes has been created. Each run saves and reads the model using StringWriter and StringReader to simulate a file serialization.


With 1,000,000 FooElement instances inside the model, Odin takes 620ms to write and 534ms to read on average.

public class FooRoot {
    private UUID id;
    private String name;
    private ArrayList<FooElement> elements;
}
 
public class FooElement {
    private int x;
    private int y;
    private int z;
    private long value;
    private String txt;
    private boolean[] attributes;
}
benchmark for 1 million elements

Test realized on i7-8700K and 2x8Go (3200 Mhz) Ram using Windows 10 and Java 11.