Bug 150837

Summary: Reading index header is not buffered
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: eric_jodet
Version: 3.2Keywords: performance
Target Milestone: 3.3 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
filemon trace output none

Description John Arthorne CLA 2006-07-17 13:24:23 EDT
Build: Eclipse 3.2

I am doing analysis of Eclipse startup using a tool called "FileMon". This tool hooks into the win32 API and records actual file system accesses.  I see from the filemon trace that the JDT index files have a large number of unbufferred reads occuring. I will attach a filemon trace file that shows each file system access for a particular JDT index file.
Comment 1 John Arthorne CLA 2006-07-17 13:24:47 EDT
Created attachment 46381 [details]
filemon trace output
Comment 2 John Arthorne CLA 2006-07-17 13:30:50 EDT
From a quick look at the source, I think this may be happening in DiskIndex.readHeaderInfo.  Since it uses RandomAccessFile, it is reading using unbuffered input. Most damaging is the Util.readUTF() method that is reading UTF strings one byte at a time.  With unbuffered input this is quite expensive (the disk will likely have a cache, but still costs an OS call, etc). One solution is to use something like BufferedRandomInputStream in org.eclipse.equinox.registry to get buffered random access to this file.
Comment 3 Frederic Fusier CLA 2007-03-16 06:26:27 EDT
Bug 171653 should have been set as duplicate of this one. We missed it while working on it...


*** This bug has been marked as a duplicate of bug 171653 ***
Comment 4 Olivier Thomann CLA 2007-03-20 09:12:49 EDT
Verified for 3.3 M6 using build I20070320-0010