Community
Participate
Working Groups
We are reading input streams provided by clients for content description too eagerly. We should read only when a describer actually requests bytes to be interpreted. For content types that do not have a content describer, file reads could be avoided. It would be even better if the input streams handed by clients did not do any work before read was called (FileInputStreams open the file in the constructor, for instance). We could do that at least for the client we control: IFile#getContentDescription, which BTW is currently the heaviest one.
Adding Jeff, the performance police.
Actually, in practice this would be a rather rare scenario (empty files, or no corresponding content type, or content types without describers). Deferring.
Reopening.
Created attachment 15027 [details] patch against org.eclipse.core.resources The patch changes the way IFile#getContentDescription to that it postpones the file opening until bytes are actually requested. This happens in cases such as content types with no content describers (file name association only) or files with names for which there are no content types associated.
Fix reviewed by DJ. Released to HEAD.