Skip to content

Fix cache key issue - #185

Closed
culmat wants to merge 1 commit into
gitblit-org:masterfrom
culmat:patch-1
Closed

culmat wants to merge 1 commit into
gitblit-org:masterfrom
culmat:patch-1

Conversation

@culmat

@culmat culmat commented May 19, 2014

Copy link
Copy Markdown
Contributor

The cache was not finding any repos with upper case letters in repo name. This fix reduces repo page load time on our installation from > 3 sec to 1.5 sec.

The cache was not finding any repos with upper case letters in repo name. This fix reduces repo page load time on our installation from > 3 sec to 1.5 sec.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to be careful when manipulating repository look-ups. The cache lookups should be case-insensitive - but the filesystem lookups are case-sensitive on case-sensitive filesystems.

I think the better fix is to ensure that cache lookups use the proper key, but leave the file system loading as-is. Try the following and let me know if that yields the same time-saving result.

String repositoryKey = repositoryName.toLowerCase();
if (!repositoryListCache.containsKey(repositoryKey)) {
    RepositoryModel model = loadRepositoryModel(repositoryName);
    ...
}

// cached model
RepositoryModel model = repositoryListCache.get(repositoryKey);

@gitblit

gitblit commented May 21, 2014

Copy link
Copy Markdown
Collaborator

@culmat Have you tried my counter proposal?

@culmat

culmat commented May 21, 2014

Copy link
Copy Markdown
Contributor Author

Hi James,
haven't tried yet, but in my understanding it must be the same. When you Alt+Shift+I inline in Eclipse it should yield the exact same code?

@gitblit

gitblit commented May 22, 2014

Copy link
Copy Markdown
Collaborator

I pushed my proposed fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants