11-03-2018 09:19 AM
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);
11-03-2018 05:48 PM
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.
11-04-2018 07:05 AM
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() ?
11-12-2018 04:03 AM
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:
02-01-2019 02:31 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.