XPS performance

Hi,
we're trying to replace our OLE compound file based image data storage with XPS documents.
One file contains 1-10000 bitmaps with a total size of up to several GBs..
With OLE compound files we got a data write rate of about 30 MB/s (on a reference machine).
Using XPS document I can't get more than 6 MB/s. Turning off compression doesn't speed things up.

My questions are:
- What causes this - factor 5 - overhead ?
- Is XPS the right technology for this application ?.

Her's the source code for the write - loop

using (XpsDocument document =newXpsDocument(destFileName,FileAccess.ReadWrite,CompressionOption.SuperFast))
{

IXpsFixedDocumentSequenceWriter docSeqWriter = document.AddFixedDocumentSequence();
IXpsFixedDocumentWriter docWriter = docSeqWriter.AddFixedDocument();
IXpsFixedPageWriter pageWriter = docWriter.AddFixedPage();
using (FileStream sourceStream =newFileStream(textImageName.Text,FileMode.Open))
{
int numtimes =int.Parse(textNumTimes.Text);
for (int i = 0; i < numtimes; i++)
{
XpsImage img = pageWriter.AddImage("image/jpeg");
Stream imgStream = img.GetStream();
sourceStream.Seek(0,
SeekOrigin.Begin);
CopyStream(sourceStream, imgStream);
img.Commit();
}
pageWriter.Commit();
document.Close();
}

[2776 byte] By [WolfgangB] at [2008-3-6]
# 1

Why are you XPS? Is it so you can view the images with an Xps Viewer? If this were the case I would suggest putting one per page. If you just want a virtual file system I would recommend you directly use the Package API.

Which version of WinFx do you have? We have done performance enhancements that I believe made it into Beta 2. In the scenario you describe signifigant performance enhancements were added to the Package system to handle very large numbers of parts.

BrianAdelberg at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,XML Paper Specification (XPS)...

Software Development for Windows Vista

Site Classified