mmap-cache: drop ret_size from mmap_cache_get()
The ret_size result is a bit of an awkward optimization that in a sense enables bypassing the mmap-cache API, while encouraging duplication of logic it already implements. It's only utilized in one place; journal_file_move_to_object(), apparently to avoid the overhead of remapping the whole object again once its header, and thus its actual size, is known. With mmap-cache's context cache, the overhead of simply re-getting the object with the now known size should already be negligible. So it's not clear what benefit this brings, unless avoiding some function calls that do very little in the hot context-cache hit case is of such a priority. There's value in having all object-sized gets pass through mmap_cache_get(), as it provides a single entrypoint for instrumentation in profiling/statistics gathering. When journal_file_move_to_object() bypasses getting the full object size, you don't capture the full picture on the mmap-cache side in terms of object sizes explicitly loaded from a journal file. I'd like to see additional accounting in mmap_cache_get() in a future commit, taking advantage of this change.
Loading
Please register or sign in to comment