use of com.intellij.openapi.vfs.newvfs.events.VFileEvent in project intellij-community by JetBrains.
the class VirtualFilePointerTest method testManyPointersUpdatePerformance.
public void testManyPointersUpdatePerformance() throws IOException {
LoggingListener listener = new LoggingListener();
final List<VFileEvent> events = new ArrayList<>();
final File ioTempDir = createTempDirectory();
final VirtualFile temp = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(ioTempDir);
for (int i = 0; i < 100000; i++) {
myVirtualFilePointerManager.create(VfsUtilCore.pathToUrl("/a/b/c/d/" + i), disposable, listener);
events.add(new VFileCreateEvent(this, temp, "xxx" + i, false, true));
}
PlatformTestUtil.startPerformanceTest("vfp update", 10000, () -> {
for (int i = 0; i < 100; i++) {
// simulate VFS refresh events since launching the actual refresh is too slow
myVirtualFilePointerManager.before(events);
myVirtualFilePointerManager.after(events);
}
}).useLegacyScaling().assertTiming();
}
Aggregations