restate icon indicating copy to clipboard operation
restate copied to clipboard

Cache frequently accessed structures in `PartitionStore`

Open tillrohrmann opened this issue 1 year ago • 4 comments

To avoid the serialization cost when accessing data stored in the PartitionStore, we could add an LRU cache for frequently accessed data. Prime candidates could be the deduplication table and the InvocationStatus.

tillrohrmann avatar Aug 20 '24 17:08 tillrohrmann

Could this LRU cache be completely hidden behind the InvocationStatusTable impl? In particular once we get rid of these https://github.com/restatedev/restate/issues/276

slinkydeveloper avatar Aug 20 '24 20:08 slinkydeveloper

I've ran some simple experiments and caching of the InvocationStatus didn't have a measurable impact on throughput.

tillrohrmann avatar Aug 21 '24 17:08 tillrohrmann

I've ran some simple experiments and caching of the InvocationStatus didn't have a measurable impact on throughput.

Did you by any chance tried with the neo invocation status to see if the new protobuf layout has any either positive or negative impact?

slinkydeveloper avatar Aug 21 '24 19:08 slinkydeveloper

Did you by any chance tried with the neo invocation status to see if the new protobuf layout has any either positive or negative impact?

No, I only tried it with the old InvocationStatus. Given that reading the InvocationStatus took ~1.5% of time in the flamegraphs, I wouldn't expect a super noticeable change. This doesn't mean that the we shouldn't optimize these things, though.

tillrohrmann avatar Aug 22 '24 07:08 tillrohrmann