Bug 150711 - StateReader should use smaller file buffers
Summary: StateReader should use smaller file buffers
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2006-07-14 16:04 EDT by John Arthorne CLA
Modified: 2006-08-10 11:50 EDT (History)
0 users

See Also:


Attachments
patch (2.43 KB, patch)
2006-07-17 17:03 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2006-07-14 16:04:57 EDT
StateReader reads various files, and always uses a 64KB buffer.  A smaller buffer may be more appropriate if less data is being read on average.  I tested various buffer sizes for the lazy file (StateReader.openLazyFile), and recorded the number of bytes read from disk in each case using FileMon:

2KB buffer - 39 reads for a total of 67,632 bytes
4KB buffer - 28 reads for a total of 86,072 bytes
64KB buffer - 18 reads for a total of 655,424 bytes

Clearly there is a trade-off that a large buffer minimizes the total number of reads, but will read many extra unnecessary bytes. It would be useful to run startup performance tests with different buffer sizes to observe the effect.
Comment 1 Thomas Watson CLA 2006-07-17 14:54:22 EDT
No matter what buffer size we decide on I think this is something easy we should consider for 3.2.1.
Comment 2 Thomas Watson CLA 2006-07-17 17:03:11 EDT
Created attachment 46398 [details]
patch

This patch uses a buffer size of 4KB for the lazy loaded files an 16 KB for the files that are completely read from start to end.

It looks like 4KB may be a happy medium since a vast majority of the bundles have a lazy data size < 4KB.
Comment 3 Thomas Watson CLA 2006-07-17 17:05:20 EDT
I released the patch to HEAD.  Leaving open for 3.2.1 and further performance testing.
Comment 4 John Arthorne CLA 2006-07-25 13:09:33 EDT
I tried running a large Eclipse-based product with this patch, and there was a significant reduction in disk reads on startup.  Definitely worth considering for 3.2.1.
Comment 5 Jeff McAffer CLA 2006-08-10 11:02:32 EDT
+1
Comment 6 Thomas Watson CLA 2006-08-10 11:50:40 EDT
Fixed in 3.2 maintenance stream.