sageserpent-open / plutonium

CQRS providing bitemporal object modelling for Java POJOs and Scala too.
MIT License
5 stars 0 forks source link

Benchmark the memory footprint. #41

Closed sageserpent-open closed 6 years ago

sageserpent-open commented 6 years ago

Does the current efficient world implementation suffer from massive memory creep when a revision is made? My worry is that each revision of a world piles up previous timelines in order to support creating experimental worlds from prior revisions. In theory, there should be enough structural sharing between timelines for separate revisions to keep the scaling linear, but let's check this by experiment first.

sageserpent-open commented 6 years ago

The good news is that memory usage scales linearly with the number of events booked into a world:

memory

sageserpent-open commented 6 years ago

The bad news is that for each event, there is an 11Kbyte memory cost. Ouch! Oh well, the blob storage implementation is entirely in memory (as is the rest of a 'TimelineImplementation' instance), so perhaps that shouldn't be a surprise, nor cause for concern when persistence is introduced - at least the snapshots won't be in memory, even if the rest of 'TimelineImplementation' is.