Forum How do I...?

Any way to transform faster when using lots of images?

Ben
Hi,
I'm transforming about 10,000 lines of xml into around 100 pages of pdf, which isn't a *lot* (I wouldn't think), but it's substantial. The issue I'm having is that when I transform the pdf without images (I'm using Prince 5.0 Beta) it takes about 35 seconds on a machine here at work (P4 @ 1.7 and half a gig ram I think). When I run it with images (there are about 50 images, all of them except for 4 are .jpg, the others are .png, for a total of 25 MB), it takes about 20-25 minutes, depending on what other applications I'm running at the time.
I am using the CSS
content: attr("print", url);
to bring the image into the xml.
I understand the machine is a little on the "low end", any way I could speed up the transform with images? Anyone else have this problem?
Ben
Ben
I've noticed that other transforms using .png seem to go much faster. They take about 5 minutes total. However, I haven't run the same transform using both .jpg and .png to see if there is a correlation... anyone can clarify this?
Ben
mikeday
Hi Ben,

I suspect that the limiting factor here is the total size of all the images compared to the amount of memory available on the machine. If a program exceeds available memory the operating system will "thrash" using the hard disk as temporary storage, which is exceedingly slow.

Currently, Prince loads all of the images included in the document and keeps them all in memory, when really it only needs to load one into memory at a time. This would greatly reduce the memory usage when formatting documents with lots of images and hence increase the speed. We may be able to change this behaviour in the next release of Prince.

(I am not sure why you are experiencing different results with PNG images, I can only surmise that there are fewer images in that document?)
pbreslin
Hi Mike,

I am also experiencing disk thrashing for documents with lots of images. Is this fixed in the new Prince 5.0 release? If not, will it be considered for the 6 release?

Thanks,

Pat Breslin
mikeday
The image loading behaviour has not changed in the Prince 5.0 release, although one other different bug that was affecting documents with many images has been fixed.

We are planning to release an updated version of Prince 5.0 perhaps next month with improved performance and reduced memory usage for documents with many images. It will be available as a free upgrade for existing Prince 5.0 customers.
mikeday
Hi Ben and Pat,

We have uploaded a maintenance build of Prince 5.0 that has reduced memory usage when processing documents that use many images. (It also includes some other performance improvements and bug fixes).

You can download it from our website:

prince-5.0r2-setup.exe (Windows)
prince-5.0r2-macosx.tar.gz (MacOS X)
prince-5.0r2-linux.tar.gz (Linux)
prince_5.0-3_i386.deb (Debian)

Please let us know how it goes and whether this fixes the problem! :D

Best regards,

Michael