Hi there,
We are not 100% sure whether it’s maybe caused by the license mechanism, but we noticed that it usually takes 20-30 seconds for the first GroupDocs.Search call to complete.
Is there a way to speed this up?
We implemented extraction in separate processes (suggested by you), but starting them always takes this time, because the first GroupDocs call take time.
@jamsharp
To speed up the first initialization of GroupDocs.Search, consider the following strategies:
-
Preload the Library: Ensure that the GroupDocs.Search library is loaded at the start of your application. This can help reduce the time taken for the first call.
-
License Initialization: If you suspect the license mechanism is causing delays, ensure that the license is applied as early as possible in your application. This can help avoid any delays associated with license validation during the first call.
-
Optimize Resource Usage: Review your application to ensure that it is not performing unnecessary operations during the first call. For example, avoid loading large datasets or performing complex calculations until they are needed.
-
Asynchronous Initialization: If possible, consider initializing GroupDocs.Search in a separate thread or task. This way, your application can continue to respond to user actions while the library initializes in the background.
-
Caching: If your application frequently makes similar calls, consider implementing caching mechanisms to store results from previous searches, which can significantly reduce response times for repeated queries.
By implementing these strategies, you should be able to reduce the initialization time for GroupDocs.Search.
For further assistance, refer to the official documentation for additional tips and best practices.
@jamsharp
Since the delay happens only on the very first GroupDocs.Search
call, could you please confirm a couple of points so we can investigate further:
- Are you applying the license before making the first call, or does the delay also occur when the license is not applied?
- Does the delay happen when creating the SearchIndex/Searcher instance, or on the very first search/extraction operation?
- Approximately how large is the index or data source being opened on the first call?
This will help us check whether the initialization time is related to the license validation or the index startup.
I analyzed our code.
We initialize a class (that deals with GroupDocs), which calls this method:
private static void SetLicense()
{
using var licenseStream = new MemoryStream(FileResources.GroupDocs_Search_NET);
new License().SetLicense(licenseStream);
}
And this call just took around 30 seconds.
So, there is no index or SearchIndexer instance involved yet.
1 Like
@jamsharp
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SEARCHNET-3549
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@jamsharp
License installation took almost 14.5 seconds (.NET 9) on our machine. Unfortunately, the license installation process is slow and cannot currently be optimized further. However, we’ll review this in the future to see if improvements can be made.
1 Like