Meta issue for the global cache.
Thank you for tracking this!
@markus2330 as I mentioned earlier, the very rough numbers for the cache are: 10x faster than no cache (with dump and no weird edge cases).
I investigated, why the improvement is not at its highest potential (we saw mmapstorage read is >70x faster than dump). It seems that other global plugins take up most of the time. (spec, list and stuff in PREGETSTORAGE, PROCGETSTORAGE, POSTGETSTORAGE).
When disabling these positions which are always called, even with cache, we would get an improvement of >80x. Maybe it would be interesting to think about going this direction.
A big thanks that you investigated this!
Yes, we absolutely should do that. In my mind the cache plugin would always immediately exit for cache hits and not call any further plugins, maybe except some unlock, logging or notification plugins. But spec definitely is not needed when we have a cache hit.
Nice, I think that will be a huge performance improvement then.
The drawback is that we'll need additional position(s) for that case (logging, unlock, ..). Currently PREGETSTORAGE, PROCGETSTORAGE and POSTGETSTORAGE are always called (whether cache hit, or no update as it was before we had a cache). I'm just not sure what this means for the semantics.
Yes, the idea is to bypass everything that builds up the KeySet on a cachehit. As logging/notification for kdbGet is not really important and locking currently is not implemented (semlock is disabled) you can simply start by ignoring the semantics of the global plugins on cache hits (not executing anything for now).
Two things came up regarding this:
Now NO_UPDATE is ~10x slower than CACHE_HIT. For consistency, we should disable the same global positions for NO_UPDATE too.
We either need a workaround or the POSTGETSTORAGE needs to skip the default split (user supplied KeySet not coming from a backend). The reason is that we can not cache uncomitted data. The test-suite seems to work fine if we simply skip it.