Performance matters. That's the message we get back from our users whenever we do a survey:
Performance always ends up at the top of the list as the No.1 request for improvement.
Here is some good news:
We have managed to boost the speed of db4o in embedded Client/Server mode by an order of magnitude.
The old code simulated a Client/Server connection with an in-memory communication buffer to ensure transactional and isolated behaviour.
The new code passes objects directly between "client" and "server" instead of marshalling and unmarshalling them. It keeps a local reference system for each transaction and makes sure the correct reference system is used for query processing. Metadata is shared between all transactions.
Embedded Client/Server now works as if an ObjectContainer had multiple transactions - and that was the internal name we used for the project while we were working on it: Multi-Transactional-ObjectContainer ( MTOC )
You can use the new functionality with the normal (old) embedded Client/Server API : by opening an ObjectServer and connecting to it locally with ObjectServer#openClient().
The concrete improvements for you as a user:
- Opening a local client ( a transaction ) with ObjectServer#openClient() now takes less than 1 millisecond. Only a few objects need to be created: a wrapper around the ObjectContainer, a transaction and a reference system. No metadata needs to be created or transferred.
- Storing and loading objects is at least twice as fast for very simple objects. For bigger object graphs, the performance advantage can be 40x or more.
- Query processing can benefit from the new setup because the query processor can operate against objects that may already be in the cache.
- Loading of objects may be faster if parts of an object have already been loaded by the query processor.
- Less memory is used both on the "server" side and on the "client" side.
- Less threads are needed.
We have run the Poleposition benchmark against the latest db4o versions to compare them against eachother.
Here are the results:
http://www.db4o.com/downloads/PpMTOC.pdf
The new embedded C/S mode is the last row in the tables and the dark grey line in the graphics.
Embedded Client/Server is now just as fast as local mode, and that's the obvious result we expected from how we implemented it.
A db4o version with new embedded C/S speed is available for immediate download from our continous build [1] and will shortly be released with db4o 6.4
Enjoy!
[1] Caution: Although the continous build has passed all 3000 regression tests it is ALPHA quality.