shared-indexes tests: speedup "compareIndices" command: resolve files only once.
authorSergey Patrikeev <Sergey.Patrikeev@jetbrains.com>
Thu, 13 Aug 2020 08:38:57 +0000 (11:38 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 08:39:23 +0000 (08:39 +0000)
GitOrigin-RevId: 0e83e3fbe5a817c940041a0a589eca6ddf9b585e

platform/lang-impl/src/com/intellij/util/indexing/diagnostic/dump/IndexContentDiagnostic.kt
platform/lang-impl/src/com/intellij/util/indexing/diagnostic/dump/IndexContentDiagnosticDumper.kt

index a121a9861aa274630f34480cdb68561a3c450e44..3e595b979bcb3d26e41b2fade0f78bd8bd7bd46b 100644 (file)
@@ -5,11 +5,6 @@ import com.intellij.util.indexing.diagnostic.dump.paths.IndexedFilePath
 data class IndexContentDiagnostic(
   val allIndexedFilePaths: List<IndexedFilePath>,
   /**
-   * Keys - IDs that have provided (shared) indexes.
-   * Values - IDs of files that have provided indexes.
-   */
-  val providedIndexIdToFileIds: Map<String, Set<Int>>,
-  /**
    * Paths to indexed files from *unsupported* file systems (currently, only local and archive file systems are supported).
    */
   val filesFromUnsupportedFileSystems: List<IndexedFilePath>,
index 90709f2f2048bc477249c4af661e181ba178f7bc..58464115cc8f109d69a92d6ae96be0e72d6a4475 100644 (file)
@@ -25,12 +25,6 @@ object IndexContentDiagnosticDumper {
     val indexedFilePaths = arrayListOf<IndexedFilePath>()
     val providerNameToOriginalFileIds = hashMapOf<String, MutableSet<Int>>()
     val filesFromUnsupportedFileSystem = arrayListOf<IndexedFilePath>()
-    val fileBasedIndexExtensions = FileBasedIndexExtension.EXTENSION_POINT_NAME.extensionList
-    val infrastructureExtensions = FileBasedIndexInfrastructureExtension.EP_NAME.extensions().asSequence()
-      .mapNotNull { it.createFileIndexingStatusProcessor(project) }
-      .toList()
-
-    val providedIndexIdToIndexedFiles = hashMapOf<String, MutableSet<Int>>()
 
     for ((index, provider) in providers.withIndex()) {
       indicator.text2 = provider.debugName
@@ -38,13 +32,6 @@ object IndexContentDiagnosticDumper {
       providerNameToOriginalFileIds[provider.debugName] = providerFileIds
       provider.iterateFiles(project, { fileOrDir ->
         if (!fileOrDir.isDirectory) {
-          val fileId = FileBasedIndex.getFileId(fileOrDir)
-          for (extension in fileBasedIndexExtensions) {
-            if (infrastructureExtensions.any { it.hasIndexForFile(fileOrDir, fileId, extension) }) {
-              providedIndexIdToIndexedFiles.getOrPut(extension.name.name) { hashSetOf() } += fileId
-            }
-          }
-
           val indexedFilePath = createIndexedFilePath(fileOrDir, project)
           if (PortableFilePaths.isSupportedFileSystem(fileOrDir)) {
             indexedFilePaths += indexedFilePath
@@ -62,7 +49,6 @@ object IndexContentDiagnosticDumper {
     }
     return IndexContentDiagnostic(
       indexedFilePaths,
-      providedIndexIdToIndexedFiles,
       filesFromUnsupportedFileSystem,
       providerNameToOriginalFileIds
     )