Bug 45047 - Investigate using new I/O support of 1.4 in JDT Core
Summary: Investigate using new I/O support of 1.4 in JDT Core
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-16 15:49 EDT by Philipe Mulet CLA
Modified: 2004-05-19 12:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-10-16 15:49:21 EDT
Build 3.0M4

We should do some investigations whether the new IO support of 1.4 could be 
leveraged in JDT core...
Comment 1 Olivier Thomann CLA 2003-10-16 22:56:43 EDT
This link could be useful:
http://java.sun.com/j2se/1.4.2/docs/guide/nio/index.html
Comment 2 Frederic Fusier CLA 2004-04-26 11:15:55 EDT
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.
Comment 3 Frederic Fusier CLA 2004-04-27 13:19:25 EDT
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...
Comment 4 Frederic Fusier CLA 2004-04-27 16:54:00 EDT
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