Just a quick update to mention that I’ve merged in develop a pull request that will add the capability to work with Mapless using UnQLite in memory.

The use case is mostly for single-image caching. When you want to cache data but keep the image lean, that’s when you can use this setup.

Have in mind that when you save a mapless in one image, you will not find it from any other one, only from the one that originated that. You also need to be conservative with the instance of the repository because only one UnQLite client will have access to the data you saved on it.

Of course if you need to access from many repository instances and many images, you can use the regular file-based one.

For reference, here is the snippet I was using while developing this:

dbFilename := FileSystem workingDirectory / 'bench.db'.
dbFilename.
dbFilename deleteIfAbsent: [  ].

"File-based repo"
repository := MaplessUnQLiteRepository for: dbFilename pathString.

"In RAM memory repo"
repository := MaplessUnQLiteRepository inMemory.

"To shut down cleanly"
repository shutDown.

"Run the benchmark"
MaplessUnQLiteBenchmark runOn: repository.

"Manually test saving and retrieving"
guy := DummyPerson new
	firstName: 'john';
	lastName: 'q';
	yourself.

"Save a mapless"
repository save: guy.

"Monitor its ids (to access it from another image and things like that)"
id := guy id.

"Retrieve that mapless"
repository findOne: DummyPerson atId: 'ep3affz7h8ecjv3doz91ww1ci'.

When I ran the benchmarks I’ve got:

Benchmarking Mapless on UnQLite in memory...

Saved 1000 instances of MaplessDummyPerson in: 58 ms (~17294 saves per second)
Read 1000 instances of MaplessDummyPerson in: 27 ms (~37626 reads per second)
Saved 10000 instances of MaplessDummyPerson in: 551 ms (~18142 saves per second)
Read 10000 instances of MaplessDummyPerson in: 265 ms (~37698 reads per second)
Saved 1000 instances of MaplessDummyPerson and MaplessDummyUser in: 132 ms (~7577 saves per second)
Read 1000 instances of MaplessDummyPerson and MaplessDummyUser in: 39 ms (~25448 reads per second)
Saved 10000 instances of MaplessDummyPerson and MaplessDummyUser in: 1328 ms (~7527 saves per second)
Read 10000 instances of MaplessDummyPerson and MaplessDummyUser in: 406 ms (~24616 reads per second)

And here is how DummyPerson and DummyUser mapless get created:

guy := DummyPerson new
	firstName: Character alphabet shuffled anyOne asString;
	lastName: Character alphabet shuffled anyOne asString;
	yourself.
user := DummyUser new
	username: guy firstName;
	person: guy;
	yourself.

Happy Eastern to everyone.