Bug 101310 - PDF export time is quadratic in size of document
Summary: PDF export time is quadratic in size of document
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf, perf
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2016-08-04 23:01 UTC by jmmorlan
Modified: 2023-07-03 15:34 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmmorlan 2016-08-04 23:01:02 UTC
Exporting large documents to PDF is disproportionally slow. Something is taking time quadratic in the size of the document:

$ python -c 'for i in xrange(50000): print "%06d" % i' > 50k.csv
$ python -c 'for i in xrange(100000): print "%06d" % i' > 100k.csv
$ python -c 'for i in xrange(150000): print "%06d" % i' > 150k.csv
$ python -c 'for i in xrange(200000): print "%06d" % i' > 200k.csv
$ python -c 'for i in xrange(250000): print "%06d" % i' > 250k.csv
$ time soffice --headless --convert-to pdf 50k.csv
convert /home/jeffrey/tmp/50k.csv -> /home/jeffrey/tmp/50k.pdf using filter : calc_pdf_Export

real	0m7.732s
user	0m7.635s
sys	0m0.115s
$ time soffice --headless --convert-to pdf 100k.csv
convert /home/jeffrey/tmp/100k.csv -> /home/jeffrey/tmp/100k.pdf using filter : calc_pdf_Export

real	0m25.060s
user	0m24.969s
sys	0m0.108s
$ time soffice --headless --convert-to pdf 150k.csv
convert /home/jeffrey/tmp/150k.csv -> /home/jeffrey/tmp/150k.pdf using filter : calc_pdf_Export

real	0m52.982s
user	0m52.864s
sys	0m0.132s
$ time soffice --headless --convert-to pdf 200k.csv
convert /home/jeffrey/tmp/200k.csv -> /home/jeffrey/tmp/200k.pdf using filter : calc_pdf_Export

real	1m28.181s
user	1m28.037s
sys	0m0.154s
$ time soffice --headless --convert-to pdf 250k.csv
convert /home/jeffrey/tmp/250k.csv -> /home/jeffrey/tmp/250k.pdf using filter : calc_pdf_Export

real	2m18.007s
user	2m17.835s
sys	0m0.167s
Comment 1 Buovjaga 2016-08-07 16:10:55 UTC
Reproduced.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.4
Build ID: 5.2.0-1
CPU Threads: 8; OS Version: Linux 4.6; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Comment 2 QA Administrators 2017-11-16 09:22:43 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-12-03 13:51:25 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2021-12-03 04:20:22 UTC Comment hidden (obsolete)
Comment 5 ⁨خالد حسني⁩ 2023-07-03 15:34:10 UTC
I can't reproduce on several systems. The numbers look reasonable to me:

$ for i in *.csv; do time ./instdir/program/soffice --headless --convert-to pdf $i; done
convert /home/khaled/libreoffice/050k.csv as a Calc document -> /home/khaled/libreoffice/050k.pdf using filter : calc_pdf_Export

real    0m23.477s
user    0m22.234s
sys     0m1.031s
convert /home/khaled/libreoffice/100k.csv as a Calc document -> /home/khaled/libreoffice/100k.pdf using filter : calc_pdf_Export

real    0m46.097s
user    0m44.422s
sys     0m1.578s
convert /home/khaled/libreoffice/150k.csv as a Calc document -> /home/khaled/libreoffice/150k.pdf using filter : calc_pdf_Export

real    1m13.204s
user    1m11.500s
sys     0m1.531s
convert /home/khaled/libreoffice/200k.csv as a Calc document -> /home/khaled/libreoffice/200k.pdf using filter : calc_pdf_Export

real    1m41.823s
user    1m39.625s
sys     0m2.047s
convert /home/khaled/libreoffice/250k.csv as a Calc document -> /home/khaled/libreoffice/250k.pdf using filter : calc_pdf_Export

real    2m3.249s
user    2m1.047s
sys     0m1.953s