Editor SDK x64, peformance of saving documents  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
tnickel
User
Posts: 7
Joined: Thu Nov 29, 2018 7:52 pm

Editor SDK x64, peformance of saving documents

Post by tnickel »

Hello,

Recently i was tasked with upgrading our usage of the Editor SDK from x86 to x64. We went from version PDFXEditCore.x86.dll version 6.0.321.0 to PDFXEditCore.x64.dll version 7.0.327.1. Everything seems to work fine, however we noticed a large increase in the amount of time it takes to save documents, especially as the documents get larger. I am providing some code snippets that we are using. I have a PDF file I can send you folks that i have been using to test and that i used to gather the below metrics, but it is too large to upload here (~60 MB). The only modification I made to the document while gathering the metrics below was adding a single bookmark to the first page of the document. The 'IPXV_Document.Save()' metric indicates the amount of time spent waiting just that method to evaluate, while the regular 'Save' metric includes the time to evaluate 'IPXV_Document.Save()' + all of our client logic. All code presented below is written in VB.Net

x86 Editor SDK - Loading 1 document, 1969 pages

Code: Select all

AxPDFXEdit.OpenDocFromPath(String file, ICab oReadOnlyParams)
file = a file in the temp folder of logged in user of the server hosting the application (e.g C:\users\{user}\AppData\Local\Temp)
oReadOnlyParams= nothing in most cases, in some circumstances is set before loading the document via the following :

Code: Select all

            oReadOnlyParams = AxPXV_Control.Inst.CreateOpenDocParams()
            Dim pOpenParamsRoot As ICabNode = oReadOnlyParams.Root

            Dim secPerms As Integer = PXC_PermsFlags.PermF_All And Not (PXC_SecurityPermissions.Permit_Copying_And_TextGraphicsExtractions Or
                                                                        PXC_SecurityPermissions.Permit_Printing Or
                                                                        PXC_SecurityPermissions.Permit_HighQualityPrinting)

            pOpenParamsRoot.SetInt("SecPermMask", secPerms)
Perf: Load Time: 00:00:01.2921087, Documents: 1, Pages: 1969, WorkingSet: 736878592, Paged: 673001472

x86 Editor SDK - Saving 1 document, 1969 pages

Code: Select all

                        strPDFFileName = AxPXV_Control.Src
                        destPath = IAFS_Inst.DefaultFileSys.StringToName(strPDFFileName)
                        res = CInt(PDFXEdit.PXV_DocSaveFlags.PXV_DocSave_NoProgress)
                        ' only local file name
                        IPXV_Document.Save(destPath, res)
strPDFFileName/AxPXV_Control.Src are the same file loaded from temp previously

Perf: IPXV_Document.Save() Time: 00:00:01.5471742, Documents: 1, Pages: 1969, WorkingSet: 797863936, Paged: 736317440
Perf: Save Time: 00:00:01.6906228, Documents: 1, Pages: 1969, WorkingSet: 797569024, Paged: 734384128




x64 Editor SDK - Loading 1 document, 1969 pages
The following code is exactly the same as used in the x86 implementation

Code: Select all

AxPDFXEdit.OpenDocFromPath(String file, ICab oReadOnlyParams)
file = a file in the temp folder of logged in user of the server hosting the application (e.g C:\users\{user}\AppData\Local\Temp)
oReadOnlyParams= nothing in most cases, in some circumstances is set before loading the document via the following :

Code: Select all

            oReadOnlyParams = AxPXV_Control.Inst.CreateOpenDocParams()
            Dim pOpenParamsRoot As ICabNode = oReadOnlyParams.Root

            Dim secPerms As Integer = PXC_PermsFlags.PermF_All And Not (PXC_SecurityPermissions.Permit_Copying_And_TextGraphicsExtractions Or
                                                                        PXC_SecurityPermissions.Permit_Printing Or
                                                                        PXC_SecurityPermissions.Permit_HighQualityPrinting)

            pOpenParamsRoot.SetInt("SecPermMask", secPerms)
Perf: Load Time: 00:00:00.1303840, Documents: 1, Pages: 1969, WorkingSet: 194916352, Paged: 160681984

x64 Editor SDK - Saving 1 document, 1969 pages

Code: Select all

                        strPDFFileName = AxPXV_Control.Src
                        destPath = IAFS_Inst.DefaultFileSys.StringToName(strPDFFileName)
                        res = CInt(PDFXEdit.PXV_DocSaveFlags.PXV_DocSave_NoProgress)
                        ' only local file name
                        IPXV_Document.Save(destPath, res)
strPDFFileName/AxPXV_Control.Src are the same file loaded from temp previously


Perf: IPXV_Document.Save() Time: 00:01:19.8353752, Documents: 1, Pages: 1969, WorkingSet: 707674112, Paged: 649527296
Perf: Save Time: 00:01:19.9251770, Documents: 1, Pages: 1969, WorkingSet: 708608000, Paged: 650010624




So for some reason, after the upgrade we are seeing much better results (~10x better) when loading documents, but much worse results (~10x worse) when saving them. I also tried implementing a stream-based saving solution based on your 'FullDemo' for the Editor SDK, however that seems to perform about the same with given our circumstances. Please let me know if i can provide more information or clarify anything. Thanks for your time.
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Editor SDK x64, peformance of saving documents

Post by Sasha - PDF-XChange »

Hello tnickel,

Have you tried the 327.1 x86 dll? If so, how does it behave comparing to the x64 one?
Also, do you have your license key applied? The save can take much more time, when we are putting our demo labels in case of no license or expired key.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
tnickel
User
Posts: 7
Joined: Thu Nov 29, 2018 7:52 pm

Re: Editor SDK x64, peformance of saving documents

Post by tnickel »

Hello,

I have not tried the latest x86 DLL. I will try that today and get back to you on how it performs. The code to register our license key has been running on the development workstations I have been testing on, However, I am seeing the demo watermarks being applied to my documents. I assumed the license key can only be applied to a set number of workstations, and we have them reserved for workstations in a higher environment. I will try to test against a workstation where the license is being applied correctly, but it may take a bit.

Thanks
tnickel
User
Posts: 7
Joined: Thu Nov 29, 2018 7:52 pm

Re: Editor SDK x64, peformance of saving documents

Post by tnickel »

I tested with version 327.1 of the x86 dll, and am seeing a similar performance degredation on saving as with the latest x64 dll

Perf: IPXV_Document.Save() Time: 00:02:07.7230457, Documents: 1, Pages: 1969 WorkingSet: 899588096, Paged: 837390336
Perf: Save Time: 00:02:08.0525254, Documents: 1, Pages: 1969 WorkingSet: 902955008, Paged: 838922240

I will update you about the licensing in a few hours
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Editor SDK x64, peformance of saving documents  SOLVED

Post by Sasha - PDF-XChange »

Hello tnickel,

If you are seeing the watermarks - then the increased save time can be explained with their placement as they are complex objects. If you pass the valid key for the new SDK version - then no watermark will be added and thus the prolonged save won't happen.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
tnickel
User
Posts: 7
Joined: Thu Nov 29, 2018 7:52 pm

Re: Editor SDK x64, peformance of saving documents

Post by tnickel »

Hello,

Thanks for your time. I will check with my supervisor, and we will either use the version of the x64 license that our key is valid for (6.0.321.0) or we will purchase a new key and use the latest DLL. This ticket is resolved from my perspective.

Thanks again
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Editor SDK x64, peformance of saving documents

Post by Sasha - PDF-XChange »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ