Skip to content

Memoize $name_includes? methods for set caches

Sean McGivern requested to merge memoize-redis-set-includes into master

What does this MR do?

RepositoryCacheAdapter.cache_method_as_redis_set defines two methods:

  1. $name - for getting the whole set.
  2. $name_include? - for checking membership of an individual item.

The first was already memoized. The second wasn't, but can be, and that will save some round-trips for what should be a fast operation as we already know the answer.

Noticed while I was working on gitlab-com/gl-infra/scalability#514 (closed).

Merge request reports