Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19442

Drive: remove costly and unnecessary call to getLockInfo in FileSystemItem adaptation when calling GetChildren / ScrollDescendants

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 8.3-SNAPSHOT
    • Fix Version/s: 6.0-HF30, 7.10-HF08, 8.3
    • Component/s: Nuxeo Drive

      Description

      Release Notes

      Adaptation of a document as a FileSystemItem for the Nuxeo Drive synchronization has been optimized by not fecthing the lock information when unnecessary, typically in the case of a call to the NuxeoDrive.GetChildren or NuxeoDrive.ScrollDescendants operation.

      Technical Details

      JVM sampling during a call to GetChildren shows that DefaultFileSystemItemFactory#adaptDocument spends a lot of time in DocumentModelImpl#getLockInfo.
      Attached visualvm snapshot shows that on a call with 1.000 children approximatively 1000 ms come from getLockInfo.

      Currently there is 1 occurrence of getLockInfo in AbstractDocumentBackedFileSystemItem:

          protected AbstractDocumentBackedFileSystemItem(String factoryName, FolderItem parentItem, DocumentModel doc,
                  boolean relaxSyncRootConstraint) {
              ...
              lockInfo = doc.getLockInfo();
          }
      

      In the case of a call to DocumentBackedFolderItem#getChildren or DocumentBackedFolderItem#getDescendants we can probably skip this call.

      Indeed, this flag is only used by Drive in Processor._synchronize_locally_modified where the remote info (FileSystemItem) is re-fetched to have a fresh state, so storing it for the initial pair state is not required.

      This is the same kind of issue as NXP-19441.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: