Community
Participate
Working Groups
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.
No matter what buffer size we decide on I think this is something easy we should consider for 3.2.1.
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.
I released the patch to HEAD. Leaving open for 3.2.1 and further performance testing.
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.
+1
Fixed in 3.2 maintenance stream.