[comments] added few TODOs remainders

GitOrigin-RevId: a400a18ede477351826c96d421d3549092bd0b93
This commit is contained in:
Ruslan Cheremin
2023-11-28 14:40:45 +00:00
committed by intellij-monorepo-bot
parent 652fdc6960
commit 222ca15f92
2 changed files with 6 additions and 2 deletions
@@ -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<Timestamps> ourTimestampsCache =
ConcurrentCollectionFactory.createConcurrentIntObjectMap();
private static final BlockingQueue<Integer> ourFinishedFiles = new ArrayBlockingQueue<>(INDEXING_STAMP_CACHE_CAPACITY);
@@ -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<ID<*, *>>()
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)