void () { final String filename = "A.java"; myFixture.addFileToProject("foo/bar/" + filename, "class A {}"); PlatformTestUtil.startPerformanceTest("Vfs Event Processing By Index", 1000, () -> { PsiFile[] files = FilenameIndex.getFilesByName(getProject(), filename, GlobalSearchScope.moduleScope(getModule())); assert files.length == 1; VirtualFile file = files[0].getVirtualFile(); String filename2 = "B.java"; int max = 100000; List<VFileEvent> eventList = new ArrayList<>(max); int len = max / 2; for (int i = 0; i < len; ++i) { eventList.add(new VFilePropertyChangeEvent(null, file, VirtualFile.PROP_NAME, filename, filename2)); eventList.add(new VFilePropertyChangeEvent(null, file, VirtualFile.PROP_NAME, filename2, filename)); eventList.add(new VFileDeleteEvent(null, file)); eventList.add(new VFileCreateEvent(null, file.getParent(), filename, false, null, null, null)); } AsyncFileListener.ChangeApplier applier = ((FileBasedIndexImpl)FileBasedIndex.getInstance()).getChangedFilesCollector().prepareChange(eventList); applier.beforeVfsChange(); applier.afterVfsChange(); files = FilenameIndex.getFilesByName(getProject(), filename, GlobalSearchScope.moduleScope(getModule())); assertEquals(1, files.length); }).assertTiming(); }