Slow files viewer

Hello,

We have facing problem for Group Doc, in particular with the function GetViewerInfo which remains very slow even with the latest version 22.9 ( about 7 seconds ).
Is this normal?
Is there a faster function to use for document viewing?

Thank you for your answer

@clemence.prv

It can be slow due to a bug or because of file size and contents. Can you please share the file and a sample code or sample app to reproduce this issue?

@vladimir.litvinchik

embedded.pdf (3.0 KB)
Bug .pdf (207.0 KB)

Hello,
Thank you for your reactivity, here is an extract of the code in the bug.pdf file and a document with text file for the test

Thank you for your help :pray:

@clemence.prv

Thank you for attaching the sample file and a code snippets. Unfortunately, I can’t reproduce this issue. It takes 1 - 1.5 seconds to run the sample-app.zip (2.5 KB) on my side. Can you please try running the app and modify it so we could reproduce the issue.

@vladimir.litvinchik

Hello, thank you for your answer. Here is the sample-app file slightly modified :
sample-app.zip (70.0 KB)
I also attach a file with the times I obtained : TimeTaken.pdf (35.0 KB)

As you can see, the times remain relatively long with 3/4 seconds to load the document.

Thanking you for your help

@clemence.prv

I’m sorry for the delayed response. I’ve got the following results when running the app when calling GetViewInfo three times for embedded.pdf

Portable Document Format File (.pdf) with 2 page(s)
Time taken with GetViewInfo : 1.1038707 s
Time taken with View : 1.3965584 s

Portable Document Format File (.pdf) with 2 page(s)
Time taken with GetViewInfo : 0.0047094 s
Time taken with View : 0.1244726 s

Portable Document Format File (.pdf) with 2 page(s)
Time taken with GetViewInfo : 0.0040388 s
Time taken with View : 0.0958531 s

The first run is expected to be slower but the next one is quite faster.
Can you please attach Rapport_de_stage.pdf so we could take a look?

@vladimir.litvinchik

Thank you very much for your answer. Do you know why you get 1.4s with the View function while I get on average 3.2s when I run this same program. I get this average of 3.2s even when using the embedded.pdf file, I don’t understand why :thinking:

image.png (6.1 KB)

@clemence.prv

It could be due to system resources and system load. I run the app on my laptop:

  • Intel® Core™ i7-8665U CPU @ 1.90GHz 2.11 GHz
  • 16.0 GB RAM
  • SSD

Most of the operations are CPU bound, so it can be the reason.

@vladimir.litvinchik

Thank you for your answer, here is a document which gathers the times and the CPU consumption of the program, can you give me your opinion, because I do not see what would explain this time difference.
timeTaken.pdf (114.2 KB)

Thank you for your help :pray:

@clemence.prv

Thank you for sharing the results that you’ve got in your environment. I’ll take a look an update you.

@vladimir.litvinchik

Hello, have you had a chance to look at the document I sent you ? :relieved:

@clemence.prv

I did a couple of tests on my local machine and on VM on AWS (Intel Xeon E5-2620 v3 @ 2.4GHz with 8GB RAM). I was running the same app in Debug and Release configurations and used embedded.pdf. On the VM I’ve got the following results

> dotnet run --configuration Release

Iteration # 1
Time taken with GetViewInfo : 1.7045308 s
Time taken with View : 4.584989 s

Iteration # 2
Time taken with GetViewInfo : 0.0164519 s
Time taken with View : 0.266873 s

Iteration # 3
Time taken with GetViewInfo : 0.0068188 s
Time taken with View : 0.2171652 s

Iteration # 4
Time taken with GetViewInfo : 0.0154291 s
Time taken with View : 0.2504463 s

Iteration # 5
Time taken with GetViewInfo : 0.037022 s
Time taken with View : 0.2658995 s

Iteration # 6
Time taken with GetViewInfo : 0.0165835 s
Time taken with View : 0.2549866 s

Iteration # 7
Time taken with GetViewInfo : 0.0181568 s
Time taken with View : 0.2907364 s

Iteration # 8
Time taken with GetViewInfo : 0.0179644 s
Time taken with View : 0.2721063 s

Iteration # 9
Time taken with GetViewInfo : 0.0144616 s
Time taken with View : 0.2890615 s

Iteration # 10
Time taken with GetViewInfo : 0.0150013 s
Time taken with View : 0.2622031 s

The first iteration would be always slower and in my case it is 4.584989 s on VM when on my local machine it is more than two times faster.

Can you please try running the same app on your environment and share the results one more time?

The app that I was running: sample-app.zip (2.9 KB)

@vladimir.litvinchik

Hello Vladimir,
Thank you for your answer. I get approximately the same results as you. However I am not on a virtual machine, is it normal that my results are slow at the first launch ?
Is there a way to make it faster?

@clemence.prv

Yes, the first iteration is expected to be slower compared to the subsequent iterations. As a performance optimization, you can try using Native Image Generator (Ngen.exe) to precompile the app.