@@ -0,0 +1,1182 @@
+//%0A// FileOpsTest.java%0A//%0A%0Aimport java.io.File;%0A%0A/** Tests performance of File.exists() vs File.listFiles(). */%0Apublic class FileOpsTest %7B%0A  public static void main(String%5B%5D args) %7B%0A    int iter = 1000;%0A    if (args.length %3E 0) iter = Integer.parseInt(args%5B0%5D);%0A    long t1, t2;%0A%0A    File dot = new File(%22.%22);%0A    File%5B%5D list = dot.listFiles();%0A%0A    // time File.exists with an existing file%0A    t1 = System.currentTimeMillis();%0A    for (int i=0; i%3Citer; i++) list%5Bi %25 list.length%5D.exists();%0A    t2 = System.currentTimeMillis();%0A    System.out.println(%22File.exists() for existing = %22 + (t2 - t1) + %22 ms%22);%0A%0A    // time File.exists with a non-existent file%0A    File non = new File(%22this-file-is-unlikely-to-exist%22);%0A    t1 = System.currentTimeMillis();%0A    for (int i=0; i%3Citer; i++) non.exists();%0A    t2 = System.currentTimeMillis();%0A    System.out.println(%22File.exists() for non-exist = %22 + (t2 - t1) + %22 ms%22);%0A%0A    // time File.listFiles%0A    t1 = System.currentTimeMillis();%0A    for (int i=0; i%3Citer; i++) dot.listFiles();%0A    t2 = System.currentTimeMillis();%0A    System.out.println(%22File.listFiles() = %22 + (t2 - t1) +%0A      %22 ms (%22 + ((t2 - t1) / list.length) + %22/file)%22);%0A  %7D%0A%7D%0A

Add simple utility for testing performance of file system operations.