Community
Participate
Working Groups
Build 3.0M4 We should do some investigations whether the new IO support of 1.4 could be leveraged in JDT core...
This link could be useful: http://java.sun.com/j2se/1.4.2/docs/guide/nio/index.html
I have implement NIO support for reading chars and bytes array in Util classes and here are time results on jdt-core whole files compilation... Using new IO support: Global Files Time UseNIO Reads Warn Err 37124 936 5748 true 1876 6 0 42242 936 6220 true 1876 6 0 34200 936 5544 true 1876 6 0 33359 936 5519 true 1876 6 0 33209 936 5256 true 1876 6 0 34090 936 5366 true 1876 6 0 33128 936 5189 true 1876 6 0 32798 936 5157 true 1876 6 0 33429 936 5433 true 1876 6 0 33639 936 5237 true 1876 6 0 Using standard IO (current implementation): Global Files Time UseNIO Reads Warn Err 35202 936 4926 false 1876 6 0 33028 936 4283 false 1876 6 0 32928 936 3892 false 1876 6 0 32398 936 3975 false 1876 6 0 32878 936 3879 false 1876 6 0 46068 936 10848 false 1876 6 0 37245 936 5518 false 1876 6 0 32878 936 4253 false 1876 6 0 32828 936 3858 false 1876 6 0 33239 936 4405 false 1876 6 0 Notes - 'Global' is global time to compile all the file and 'Time' is the time spent to get arrays. These times are expressed in milli-seconds, - 'Reads' is the number of time, array input methods were used. Temporary conclusion: Except a strange result for standard IO support (over 10s), it seems that NIO support does not improve performance for input stream reading... I will complete these results with complementary tests on a larger number of files (ie. all eclipse files ~10000 files), to see if this confirm this conclusion.
Here are time results on eclipse whole files compilation... Using new IO support: Global Files Time UseNIO Reads Warn Err 1087684 12759 323316 true 27634 929 3732 1126960 12759 337178 true 27634 929 3732 984626 12759 278012 true 27634 929 3732 Using standard IO (current implementation): 1092130 12759 330279 false 27634 929 3732 1148231 12759 335248 false 27634 929 3732 1072332 12759 308716 false 27634 929 3732 Weird result as now, NIO seems to be a little bit better than IO one...!? Whatever, doubt about performance is too high (forum discussions also agreed on this point) to take the risk to use this new I/O support for 3.0... [jdt-core-internal] I've released methods using NIO support as comments in class org.eclipse.jtd.internal.compiler.util.Util in case of future JDK release would address this performance issue...
Additional tests which confirm that NIO support does not improve performance: Using standard IO (current implementation): Global Files Time UseNIO Reads Warn Err 918130 12759 280730 false 28035 1955 3732 1038413 12759 251827 false 28035 1955 3732 788013 12759 212366 false 28035 1955 3732 905191 12759 240371 false 28035 1955 3732 988512 12759 284554 false 28035 1955 3732 Using new IO support: Global Files Time UseNIO Reads Warn Err 954843 12759 267408 true 28035 1955 3732 961543 12759 268510 true 28035 1955 3732 987750 12759 266897 true 28035 1955 3732 996703 12759 284859 true 28035 1955 3732 985867 12759 273312 true 28035 1955 3732