Hey all,
I would like to use db4o as the backend of a custom cache implementation. Normally my program involves loading into memory some 40,000,000 objects and working on them simultaneously. Obviously this requires a lot of memory and I thought of perhaps persisting some of the objects (those not in a cache) to a db4o database. My preliminary tests show db4o to be a bit slower than I would like (about 1,000,000 objects took 17 minutes to persist). However, I was using the most basic setup.
I was doing something like this:
using (var reader = new FileUnitReader(Settings, Dictionary, m_fileNameResolver, ObjectFactory.Resolve<DataValueConverter>(), ObjectFactory.Resolve<UnitFactory>()))
using (var db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), path))
{
var timer = new Stopwatch();
timer.Start();
IUnit unit = reader.GetNextUnit();
while (unit != null)
{
db.Store(unit);
unit = reader.GetNextUnit();
}
timer.Stop()
db.Close();
var elapsed = timer.Elapsed;
}
Can anyone offer advice on how to improve performance in this scenario?