diff --git a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java index f2d9a781512f..b90ff635a1ef 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java @@ -68,6 +68,9 @@ public final class IndexingStamp { } private static final int INDEXING_STAMP_CACHE_CAPACITY = SystemProperties.getIntProperty("index.timestamp.cache.size", 100); + //MAYBE RC: do we still need in-memory cache (fileId->Timestamps)? With new fast-attributes + fast enumerator + // access may be fast enough even without caching -- or, at least, it may be worth to cache enumerator + // records (which is 100-1000 records at max) only private static final ConcurrentIntObjectMap ourTimestampsCache = ConcurrentCollectionFactory.createConcurrentIntObjectMap(); private static final BlockingQueue ourFinishedFiles = new ArrayBlockingQueue<>(INDEXING_STAMP_CACHE_CAPACITY); diff --git a/platform/lang-impl/src/com/intellij/util/indexing/TimestampsImmutable.kt b/platform/lang-impl/src/com/intellij/util/indexing/TimestampsImmutable.kt index 8f1e666cf874..fb6fb9369ebb 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/TimestampsImmutable.kt +++ b/platform/lang-impl/src/com/intellij/util/indexing/TimestampsImmutable.kt @@ -33,6 +33,8 @@ class TimestampsImmutable { } companion object { + //FIXME RC: this call to application makes us use ApplicationRule in tests for TimestampsImmutable -- which + // introduce completely superficial coupling, because TimestampsImmutable logic has nothing to do with application private val IS_UNIT_TEST = ApplicationManager.getApplication().isUnitTestMode() @JvmField @@ -117,7 +119,7 @@ class TimestampsImmutable { assert(dominatingIndexStamp == DataInputOutputUtil.timeBase) { "dominatingIndexStamp=$dominatingIndexStamp != timeBase=${DataInputOutputUtil.timeBase}" } - dominatingIndexStamp = 0 + dominatingIndexStamp = 0 //MAYBE RC: return EMPTY? } return TimestampsImmutable(dominatingIndexStamp, outdatedIndices, upToDateIndexIds) } @@ -200,7 +202,6 @@ class TimestampsImmutable { val indexStamps = Object2LongOpenHashMap>() upToDateIndexIds.forEach { indexUniqueId -> - //RC: .findById() takes 1/4 of total the method time -- mostly spent on CHMap lookup. val id = ID.findById(indexUniqueId) if (id != null && id !is StubIndexKey<*, *>) { val stamp = IndexVersion.getIndexCreationStamp(id)