Hello
Im working on a simple file explorer. User simply clicks on a folder & a folder list is displayed. There are over 200 sub folders inside a my test folder. But it is taking forever.
I measured the performance of the code & found out that that there are 2 major time delays, 5 seconds & 8 seconds. As result fetching 200 filenames takes 13 seconds. You can not really expect the user to wait 13 seconds each time he tried to navigate to a new folder.
Is there a solution to this problem?
Log file & the code are attached below.
First time delay happens at objectList.hasNext() line
Second delay happens after first 100 files are fetched
note that I set operationalcontext.setMaxItemsPerPage(100000);
Without knowing what Alfresco version you are using, what variant of CMIS transport you are using, and what your Alfresco server configuration / infrastructure looks like, it is hard to give you a complete answer.
From what your output looks like it should be clear what happens at the first call of hasNext(): the CMIS client API is actually performing the call to getChildren(), i.e. is retrieving the results only then. It is likely that at the 100th element, it is doing something similar, i.e. load the next page of results. Although you have created a minimal operation context, you are not using it in the getChildren() call, so your reduced set of data to be loaded and number of elements per page to load are not taken into account at all.
Windows 10, 64 bit
Alfresco Community (Build: 201707)
===============================Contains:
- Alfresco Platform: 5.2.g
- Alfresco Share: 5.2.f- Alfresco-opencmis-extension v.1.1
I have taken your advise & added context to getChildren() & reduced the paginator to 500. Now with 200 items second slowdown is not happening. But it is still slow. I made another test by fetching 2 items. Hire is the code & test result. What is the deal with the objectList.next() ?
Ok, so now that you have eliminated the inefficiency caused by the operation context, it is time to actually check / consider the DB. In a correctly set up (and optimised) system, this call should typically not take longer than a second. So, please check / monitor the following:
After further investigation & testing on different machines with Alfresco installation located in different locations, it turned out that all other machines had decent speed. Turned out the clients machine I was working (no direct access) with had its HDD full. (Logs filled the drive I was told.)
Anyway problem is resolved, thank you for being helpful.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.