in reply to Re: Java vs. Perl file I/O benchmarks; valid test?
in thread Java vs. Perl file I/O benchmarks; valid test?
Also, you do realize that the java "version" is actually 2 different methods? So it's not really as long as it appears. Additionally, condensing the JDK 1.4 version I gave below down to some hideuos anonymous objects it gets pretty short. Not on par with the perl version, but hey, that's one of perl's features.
Cheers,import java.io.*; import java.nio.*; import java.nio.channels.*; public class X2 { public static void main (String [] args) throws Exception { FileChannel in = new FileInputStream(args[0]).getChannel(); new FileOutputStream(args[1]).getChannel().write(in.map( FileChannel.MapMode.READ_ONLY, 0, in.size())); } }
- danboo
|
---|