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.
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:
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