Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal usage of guava and caffeine Cache seems inconsistent #3759

Closed
XN137 opened this issue Feb 6, 2023 · 2 comments
Closed

Internal usage of guava and caffeine Cache seems inconsistent #3759

XN137 opened this issue Feb 6, 2023 · 2 comments

Comments

@XN137
Copy link

XN137 commented Feb 6, 2023

In e1acde9 caffeine was added to the build:

This adds a new dependency on Caffeine; I considered using a Guava
Cache since we already depend on Guava, but Caffeine's version is 3
times as fast for this use case.

however on master a guava cache is also used in a few places:

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;

so i was wondering:
is this intentional or would there be value in unifying this?

  • using caffeine could (allegedly) give a performance boost
  • dropping caffeine would remove the extra dependency
@cushon
Copy link
Collaborator

cushon commented Feb 6, 2023

We are slowly moving towards caffeine, PRs to migrate those usages of common.cache are welcome

@Sineaggi
Copy link
Contributor

@cushon I've god a pr that should fix existing usages of common.cache here #3796

copybara-service bot pushed a commit that referenced this issue Feb 28, 2023
Resolves #3759

Fixes #3796

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3796 from Sineaggi:fixes fffb316
PiperOrigin-RevId: 512664621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants