Re: Print invoice very slow
We've been doing some query/data access optimization in the latest builds that I think should fix the problem. Are you printing multiple invoices or just a a single one?
Re: Print invoice very slow
I'm printing just one single invoice.
If this helps at all I uploaded an Xdebug function trace file:
http://teambeyond.com/contao295.xt (almost 19MB)
The setup is as follows:
WampServer Version 2.0 (PHP 5.3.0)
Contao 2.9.5
Isotope 0.2.9 b5
Without Xdebug running it takes 15 seconds with about 90% CPU load, with Xdebug running it takes about 20 seconds with same 90% CPU utilization until the PDF is ready, just to show that it isn't Xdebug that makes it too slow for use.
As noted before, the same problem is happening on hosted servers as well.
TCPDF runs these 2 functions many times and most of the time is spent there:
TCPDF->_getULONG() 10820 times
TCPDF->_getULONG() 2709 times
The constructed PDF contains 407 characters and one logo image.
Sadly I don't really remember what version on Contao and Isotope I had on my developement/test computer when the PDF rendering was fast (about 1 second). Perhaps it was Contao 2.9.1 or 2.9.2 and Isotope 0.2.5 or some similar.
Re: Print invoice very slow
That function has to do with font-embedding. So I did some experimenting and if you do the following it should speed things up. However, you will likely fallback to the standard freeserif font:
For Isotope 2.9.5 > In dca > tl_iso_orders.php line 632. Comment out this line:
Code:
$pdf->SetFont(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN);
That should speed things up dramatically. I just tested it out on the demo store and it worked like a charm.
Note that in future Isotope versions (1.3, available as a beta via SVN) this function is moved into IsotopeProductCollection.php.
Re: Print invoice very slow
Thank you for your fast reply.
Now the rendering is back to 1 second or so. And I can't notice any difference in the look of the invoice, so I'm happy with this :)
Hopefully others get help by this thread, as I have had the same problems on 3 hosted servers and my own computer. So I think others must have had the same problem too.
Re: Print invoice very slow
Yeah... I didn't look too much into WHY it was happening, that just happened to fix it. I'll do some more digging and see if it is something on the Contao or Isotope side but I have a feeling it's related to the way tcpdf handles font embedding.
Re: Print invoice very slow
Hiya, folks! Sorry for the late response, but I was curious to know if this particular invoice issue was resolved. I was having the same type of issue as Tomo here and I still can't seem to fix the problem. As someone who works in billing and payroll, one can see how this would be a tad frustrating. Ha!
Anyway, ANY help would be super appreciated. Feel free to PM me. Thanks! :D