PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 10:50 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Mar 02, 2020 3:07 pm 
Offline

Joined: Tue Aug 06, 2019 10:45 am
Posts: 45
Hello, I have some documents that I am generating that are huge,
Something like all account movements of a company in a given year,.
When I create a pdf for a month the result already creates a table with about 9800 rows and takes about 10-15min to generate, I find this aceptable enough. But now, I'm trying to create a document of all movements in a year, and I don't even know how much data there is in there, but the document is now stuck of the ".RenderDocument" method, and it has been there for about 180min now, and still no pdf was created.

What I want to know now, is if there is anyway to make this faster, decreasing the quality or even using multithreading (I haven't tried multithreading because I saw that its not really supported in migradoc), is there anything I can do?


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 3:31 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
The usual: faster CPU, more RAM, faster SSD, …

Maybe it helps to have more, but smaller tables. Maybe one table per months instead of one table for the whole year, if that is applicable.

Maybe create RTF and use Word to create the PDF.

Maybe run the code in a profiler and identify the routines in MigraDoc that consume most of the time.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 3:38 pm 
Offline

Joined: Tue Aug 06, 2019 10:45 am
Posts: 45
Thanks for the fast reply.

Thomas Hoevel wrote:
The usual: faster CPU, more RAM, faster SSD, …

this program is being run on a azure server, there isn't really any margin for us to improve the server as of now.

Thomas Hoevel wrote:
Maybe it helps to have more, but smaller tables. Maybe one table per months instead of one table for the whole year, if that is applicable.

This could be achieved, but have you tested this before or is there a reason why more tables would be faster?

Thomas Hoevel wrote:
Maybe create RTF and use Word to create the PDF.

Does this mean that generating rtf is faster than pdf? is it beause migradoc has to turn migradoc objects into pdfsharp object and then draw, and rtf just renders?

Thomas Hoevel wrote:
Maybe run the code in a profiler and identify the routines in MigraDoc that consume most of the time.

From what I can tell on my end the only part that is holding back the program is the RenderDocument method, othern than that are you saying I should profile the migradoc code?.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 3:52 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
IRlyDunno wrote:
Does this mean that generating rtf is faster than pdf?
Yes. While creating PDF, MigraDoc will calculate the dimensions of any item in order to make the page layout and the page breaks.
With RTF it just emits the text elements without thinking about dimensions, pages, page breaks, and such.

I don't know how the rendering time for 100,000 rows compares to the rendering time for 10,000 rows.
It'll be factor 10 in the best case, but maybe it is worse than that.
For 10 tables with 10,000 rows each it'll be factor 10.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 4:03 pm 
Offline

Joined: Tue Aug 06, 2019 10:45 am
Posts: 45
Ok then, I'll try this and see if it helps...

I'll update this thread with the result, Thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 147 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group