Enhance startup performance - Aspose DLLs

Hello,
we noticed that if we reference only a GroupDocs assembly like GroupdDocs.Viewer, on using the Viewer object also some Aspose DLLs are loaded/extracted (which for sure makes sense). But this seems to be time consuming and slows down the startup performance for us.

Questions:
Where are these DLLs coming from (downloaded/copied from another directory/extracted from the DLL)?
Can we prevent this by deploying those dlls ourselves on setup? Which additional DLLs would we need to deploy for GroupDocs?

Thanks!

1 Like

@wolfgang.gogg,

Can you please share the sample code or project and steps using that we can see the additional DLLs that are loaded/extracted? You can also share a screenshot.

Hello,
i used your basic sample application. It seems like the aspose dlls are embedded resources in your groupdocs.dll and extracted and loaded at runtime at first use from it. This is a reasonable approach for an log running application, but for an application that should have a short startup time like a viewer, this is an issue as it takes some seconds to complete.
I created a video for you to see this process.

bandicam 2019-12-19 08-35-02-409.zip (3.0 MB)

Hope this helps!

1 Like

Hello,
additionally we notices that the references to Aspose DLLs are using pretty old aspose versions, f.ex. Aspose.CAD (18.3.0)? The latest version of Aspose.CAD is 19.9.0. Any reasons for using this pretty old versions? Any plans to keep this up to date to the latest versions?
Thanks!

1 Like

@wolfgang.gogg,

Thanks for sharing the details. We are now investigating this scenario at our end. Your investigation ticket ID is VIEWERNET-2256. As we have any further update, you’ll be notified.

@wolfgang.gogg,

Please note that all these Aspose DLLs are embedded in GroupDocs.Viewer for .NET. When GroupDocs.Viewer is called, all the embedded Aspose DLLs are loaded into the process. The total size of loaded DLLs is approximately ~60Mb. So all the time that is being consumed is to load/extract ~60MBs.

We’re trying to keep up with the Aspose releases. The latest version of GroupDocs.Viewer 19.11 uses latest version of Aspose.CAD which is 19.9.

There is no reason to deploy these DLLs manually as they are already part of GroupDocs.Viewer DLL.

In case your application is targeting .NET Framework, there are no additional dependencies required.
If you have .NET Core application, running on Linux then please refer to .NET Standard 2.0 API Limitations article.

Hello,
ok - thanks for that information.
Can we somehow force this loading happen earlier, i.e. before calling View() for the first time? Ideally we would like to fully initialize on application startup (in a background thread or async function). We want to prevent this extra seconds somehow for the user when loading the file. If we can initialize early, it would processing would feel more instant to the user.
Thanks!

@wolfgang.gogg,

We’ll look into this and notify you about the outcomes.

@wolfgang.gogg,

The optimal way would be calling SetLicense() on the startup, this could save some time. Also, you can call View() or GetViewInfo() for some small file. Please check sample_app.zip (1.7 KB) that demonstrates assemblies loading when calling SetLicense() or GetViewInfo() methods.
Also, you can write output into memory instead of writing on a disk by implementing custom IPageStreamFactory, IResourceStreamFactory, and IFileStreamFactory interfaces. But it depends on your requirements and system configuration as writing into memory obviously requires more memory to be available. Please let us know if you still have questions.