From ceb34b362d169984bbff7e16889e2c4dba364c66 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Fri, 22 Jan 2016 13:28:45 +0300 Subject: [PATCH] increase vcs history size when preload enabled (IDEA-CR-7773) --- .../openapi/vcs/history/VcsHistoryCache.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java index 2d9ed544b56e..a6d7787bd1d4 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package com.intellij.openapi.vcs.history; +import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsKey; import com.intellij.openapi.vcs.annotate.VcsAnnotation; @@ -41,8 +42,14 @@ public class VcsHistoryCache { public VcsHistoryCache() { myLock = new Object(); - myHistoryCache = new SLRUMap(10, 10); - myAnnotationCache = new SLRUMap(10, 5); + // increase cache size when preload enabled + boolean preloadEnabled = Registry.is("vcs.annotations.preload"); + myHistoryCache = new SLRUMap( + preloadEnabled ? 50 : 10, + preloadEnabled ? 50 : 10); + myAnnotationCache = new SLRUMap( + preloadEnabled ? 50 : 10, + preloadEnabled ? 50 : 5); //myContentCache = new SLRUMap(20, 20); }