PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

The very 1st PDF seems to be generated a bit longer
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3439
Page 1 of 1

Author:  vorobej [ Mon Aug 29, 2016 4:49 pm ]
Post subject:  The very 1st PDF seems to be generated a bit longer

Hi all,

I am developing a Windows service that among other things has to generate the very uniform PDFs: 3-4 pages of plain text, a couple of tiny tables (2-3 columns, 1-2 rows), a single 9kb image in the page header.

It seems that after the service is started, the very 1st PDF takes about 5 seconds to generate, while the rest take about 2-3 seconds.
The difference is very reproducible. If I shut down the service, then the 1st PDF takes longer to RenderDocument().

This is nothing major, but I just want to understand why and what is involved.

Author:  TH-Soft [ Mon Aug 29, 2016 6:44 pm ]
Post subject:  Re: The very 1st PDF seems to be generated a bit longer

Hi!
vorobej wrote:
This is nothing major, but I just want to understand why and what is involved.
I think one factor is the Just In Time compilation (IL to native code).
First invocation may include loading .NET and other one-time tasks.

You wrote "Windows service". Is it a Web service (MVC or such)? In that case there may even be some CS or VB compilation in the background on the first invocation.

Author:  vorobej [ Mon Aug 29, 2016 9:09 pm ]
Post subject:  Re: The very 1st PDF seems to be generated a bit longer

No, just a windows service.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/