Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Hi, We are processing PDF documents in background worker threads (with background priority), as well as upon user request in its own thread. When background processing is off, everything is fast, but when it is on, everything slows down to a crawl. One of the culprits was in this code of the background workers: Code:using(var d = PdfDocument.Load(bytes)) {
/// do something with document (reading text runs, etc.)
}
In this case, most of the time is spent in the implicit Dispose(), like this  screenshot from a profiler shows. The other thread spends a lot of time in getting BoundingBoxes, Locations, Matrices of PdfTextRun objects. Are we doing something wrong? Or is it a bug in pdfium?
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Are you using latest version of SDK?
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Originally Posted by: Paul Rayman  Are you using latest version of SDK? No, we had 4.7.2704. I updated it now to the latest 4.11.2704, and will ask a tester to check if the problem is still there. Was something related to threading fixed recently?
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Originally Posted by: Paul Rayman  Are you using latest version of SDK? Strange... We saw the problem on one computer (DELL Intel machine), but we could not reproduce it in our testing environment (not the same kind of machine). The problem is, that the guy on the problem-machine is on vacation now, and will be back on August 12th. :( So, we will not be able to confirm if updating SDK fixed the problem until then. Have a nice summer!
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Originally Posted by: Paul Rayman  Are you using latest version of SDK? Hi Paul, The problem is still reproducible with the latest SDK. I have made a short repro project, see PdfiumNetParallelism.zip (697kb) downloaded 43 time(s).. Just drop Patagames.Pdf.dll and pdfium.dll from the SDK to the ParallelPdfTest folder - the project is referencing those (had to remove them, as zip was too big for this forum). The code is simple, you do not need explanations. Just run it, and you will see that in multithreaded scenario SDK is about 10 times slower.
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Originally Posted by: Paul Rayman  Are you using latest version of SDK? By the way, the same approx. 10x slowdown occurs when processing pages of one document in parallel.
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Hi
Paul Rayman
, Any news on the subject? Did you manage to reproduce those problems? Edited by user Wednesday, August 21, 2019 6:39:57 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
I apologize for the delay in responding. This problem requires additional research on the capabilities of the Pdfium engine.
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Hi Paul, Originally Posted by: Paul Rayman  I apologize for the delay in responding. This problem requires additional research on the capabilities of the Pdfium engine. Any success on the topic? This issue is biting us quite badly at the moment. We already thought about using pdfium to read PDFs, and then old library to write. But, it seems, that even on "normal" read some documents can have 20 seconds long .Dispose() calls, which makes parallelism the only possible solution.
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Hi Paul, Originally Posted by: Paul Rayman  I apologize for the delay in responding. This problem requires additional research on the capabilities of the Pdfium engine. Any hope for a solution? We are heading towards release, and this issue is slowly becoming a blocker.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Hello,
I apologize for the delay in responding. Currently, a stable working solution has not yet been found.
|
|
|
|
|
|
Rank:: Advanced Member
Groups: Registered
Joined: 4/30/2019(UTC) Posts: 48   Location: Raisio Thanks: 11 times Was thanked: 3 time(s) in 2 post(s)
|
Originally Posted by: Paul Rayman  Hello,
I apologize for the delay in responding. Currently, a stable working solution has not yet been found. :(
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close