@@ -78,28 +78,33 @@ public void testNativeFileNotExistsNegative(Blackhole blackhole) throws Exceptio
7878 runNativeFileExists ("ThisFileNotExists3.txt" , false );
7979 }
8080
81- // @Benchmark
81+ @ Benchmark
8282 public void testDirectoryStream (Blackhole blackhole ) throws Exception {
83- runDirStream ("cpw/mods/jarhandling" , 5 , blackhole ); //jar 1
84- runDirStream ("net/minecraftforge/common" , 72 , blackhole ); //jar 2
85- runDirStream ("cpw/mods/modlauncher/api" , 34 , blackhole ); //jar 3
83+ runDirStream (fileSystem , "cpw/mods/jarhandling" , 5 , blackhole ); //jar 1
84+ runDirStream (fileSystem , "net/minecraftforge/common" , 72 , blackhole ); //jar 2
85+ runDirStream (fileSystem , "cpw/mods/modlauncher/api" , 34 , blackhole ); //jar 3
8686 }
8787
88- // @Benchmark
88+ @ Benchmark
89+ public void testDirectoryStreamDir (Blackhole blackhole ) throws Exception {
90+ runDirStream (dirFileSystem , "/" , 4 , blackhole ); //jar 1
91+ }
92+
93+ @ Benchmark
8994 public void testByteChannel (Blackhole blackhole ) throws Exception {
9095 runByteChannel ("cpw/mods/niofs/union/UnionPath.class" , blackhole ); //jar 1
9196 runByteChannel ("net/minecraftforge/client/event/GuiOpenEvent.class" , blackhole ); //jar 2
9297 runByteChannel ("cpw/mods/modlauncher/Launcher.class" , blackhole ); //jar 3
9398 }
9499
95- // @Benchmark
100+ @ Benchmark
96101 public void testReadAttributes (Blackhole blackhole ) throws Exception {
97102 runReadAttributes ("cpw/mods/niofs/union/UnionPath.class" , 9550 , blackhole ); //jar 1
98103 runReadAttributes ("net/minecraftforge/client/event/GuiOpenEvent.class" , 782 , blackhole ); //jar 2
99104 runReadAttributes ("cpw/mods/modlauncher/Launcher.class" , 12648 , blackhole ); //jar 3
100105 }
101106
102- // @Benchmark
107+ @ Benchmark
103108 public void testCommonPathUtilities (Blackhole blackhole ) throws Exception {
104109 var path = fileSystem .getPath ("net/minecraftforge/client/event/GuiOpenEvent.class" );
105110 blackhole .consume (path .getFileName ());
@@ -126,9 +131,9 @@ private static void runExists(String pathString, boolean expected) throws Except
126131 }
127132 }
128133
129- private static void runDirStream (String pathString , int expectedEntries , Blackhole blackhole ) throws Exception {
134+ private static void runDirStream (UnionFileSystem fs , String pathString , int expectedEntries , Blackhole blackhole ) throws Exception {
130135 int count = 0 ;
131- try (var dirStream = Files .newDirectoryStream (fileSystem .getPath (pathString ))) {
136+ try (var dirStream = Files .newDirectoryStream (fs .getPath (pathString ))) {
132137 for (Path subpath : dirStream ) {
133138 count ++;
134139 blackhole .consume (subpath );
0 commit comments