void () { //RC: adding .warmupIterations(1-2) reduce execution time 5-10x! Probably, // because of JITing -- if that is true, then times after warm up are // better represent real-life performance? int N = 30_000; List<VFileEvent> events = new ArrayList<>(N); VirtualDirectoryImpl temp = createTempFsDirectory(); EdtTestUtil.runInEdtAndWait(() -> { PlatformTestUtil.startPerformanceTest("many files creations", 3_000, () -> { assertEquals(N, events.size()); processEvents(events); assertEquals(N, temp.getCachedChildren().size()); }) .setup(() -> { eventsForDeleting(events, temp); if (!events.isEmpty()) { processEvents(events); } eventsForCreating(events, N, temp); assertEquals(N, TempFileSystem.getInstance().list(temp).length); // do not call getChildren which caches everything }) .assertTiming(); PlatformTestUtil.startPerformanceTest("many files deletions", 3_300, () -> { assertEquals(N, events.size()); processEvents(events); assertEquals(0, temp.getCachedChildren().size()); }) .setup(() -> { if (temp.getCachedChildren().size() != N) { eventsForDeleting(events, temp); if (!events.isEmpty()) { processEvents(events); } eventsForCreating(events, N, temp); processEvents(events); } eventsForDeleting(events, temp); assertEquals(N, TempFileSystem.getInstance().list(temp).length); // do not call getChildren which caches everything }) .assertTiming(); } ); }