JID
| License: LGPL | GitHub: Commits, Issues | Free (Code): All Releases, All Announcements | Google Group |
Fast deserialization/reserialization is critical for databases. The key is to deserialize only what you need and to keep the serialized data for items that have not been changed for reserialization after an update.
Applications are built by subclassing existing JID actors and then composing more complex structures from them. The JID project includes a number of actors which support different types of persistent data.
Benchmarks:
| Entries | Balanced List Jid (BListJid) | Balanced Map Jid (BMapJid) |
| 1,000 | .014 ms | .027 ms |
| 10,000 | 035 ms | 056 ms |
| 100,000 | .24 ms | .48 ms |
| 1,000,000 | 2.9 ms | 6.9ms |
Times given above were for updating a byte array containing a serialized list or table, i.e. the time to deserialize, insert a new value (in the case of a list) and reserialize. (Test Machine: i7-3770 @ 3.40 GHz, ASUS P8Z77-M Motherboard, 16 GB Corsair DDR3 1600 MHz RAM and Vertex 3 SATA III SSD)
Maven:
Available on The (Maven) Central Repository, so Maven users just need to add this to their POM file:
<dependency>
<groupId>org.agilewiki.jid</groupId>
<artifactId>jid</artifactId>
<version>2.0.5.2</version>
</dependency>
(Be sure to update the version number appropriately, of course.)
Dependencies: Java 6, slf4j, JActor
Dependent Projects
Documentation
- The problem with Java Serialization
There are a number of problems with Java serialization and numerous alternatives have been developed. But my focus here is on a particular use case, databases, and a single issue, performance… more - Introducing JID
Java Incremental Deserialization/reserialization (JID) provides a near-ideal solution for updating serialized data structures… more - Getting Started with JID
How to set up a test environment for working with JID and the RootJid API… more - Custom Jid Classes
How to create application classes that are serializable with JID… more - BListJid, ActorJid and UnionJid
For high-performance, array-backed data structures are generally recommended. On the other hand, inserting into a large array isn’t the fastest thing. BListJid uses small arrays… more - BMapJid
BMapJid is the base class for balanced tree maps which, like bListJid, provide for super-fast incremental deserialization and reserialization… more - Jid Objects are Actors
All Jid objects have the same superclass, Jid, which in turn is a subclass of JLPCActor, which means that all Jid objects are actors… more - Deep Copy
When deserialization and reserialization are reasonably fast, their use to make deep copies of data structures becomes a reasonable approach. And Jid provides the CopyJid request, which is supported by all Jid actors… more
Wiki
Slides Incremental Java Deserialization/Reserialization Incremental Java Deserialization/Reserialization from laforge49
