jurplel/qView

Slow when used with network drives

j4k0xb opened this issue ยท 4 comments

Environment:

  • OS: Manjaro Linux
  • qView version: 6.1

Information:
I use rclone OneDive but this should apply to pretty much any network drive.
qview takes 5-30s to open a tiny png because it tries to access many other images (even from other folders), which have to be downloaded first.
relevant strace lines:

execve("/usr/bin/qview", ["qview", "image.jpg"], 0x7fff9c7c34d8 /* 87 vars */) = 0
access("/home/*****/OneDrive/image.jpg", F_OK) = 0
access("/home/*****/OneDrive/example2.png", F_OK) = 0
access("/home/*****/OneDrive/example.png", F_OK) = 0
access("/home/*****/OneDrive/IMG_20191124_0002.jpg", F_OK) = 0
access("/home/*****/OneDrive/example4.jpg", F_OK) = 0
access("/home/*****/OneDrive/image.jpg", F_OK) = 0
access("/home/*****/OneDrive/example2.png", F_OK) = 0
access("/home/*****/OneDrive/example.png", F_OK) = 0
access("/home/*****/OneDrive/IMG_20191124_0002.jpg", F_OK) = 0
access("/home/*****/OneDrive/example4.jpg", F_OK) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 12
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 12
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 13
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
statx(AT_FDCWD, "image.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=861747, ...}) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", O_RDONLY|O_CLOEXEC) = 14
access("/home/*****/OneDrive/image.jpg", F_OK) = 0
access("/home/*****/OneDrive/example2.png", F_OK) = 0
access("/home/*****/OneDrive/example.png", F_OK) = 0
access("/home/*****/OneDrive/IMG_20191124_0002.jpg", F_OK) = 0
access("/home/*****/OneDrive/example4.jpg", F_OK) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", O_RDONLY|O_CLOEXEC) = 14
statx(AT_FDCWD, "/home/*****/OneDrive/image.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=861747, ...}) = 0
statx(AT_FDCWD, "/home/*****/OneDrive/0919.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=704484, ...}) = 0
statx(AT_FDCWD, "/home/*****/OneDrive/0919.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=704484, ...}) = 0
statx(AT_FDCWD, "/home/*****/OneDrive/0108.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=859231, ...}) = 0
statx(AT_FDCWD, "/home/*****/OneDrive/0108.jpg", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=859231, ...}) = 0
access("/home/*****/OneDrive/image.jpg", F_OK) = 0
access("/home/*****/OneDrive/example2.png", F_OK) = 0
access("/home/*****/OneDrive/example.png", F_OK) = 0
access("/home/*****/OneDrive/IMG_20191124_0002.jpg", F_OK) = 0
access("/home/*****/OneDrive/example4.jpg", F_OK) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/image.jpg", {st_mode=S_IFREG|0644, st_size=861747, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 29
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example2.png", {st_mode=S_IFREG|0644, st_size=3045980, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example2.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example.png", {st_mode=S_IFREG|0644, st_size=2366, ...}, 0) = 0
openat(AT_FDCWD, "/home/*****/OneDrive/example.png", O_RDONLY|O_CLOEXEC) = 14
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/IMG_20191124_0002.jpg", {st_mode=S_IFREG|0644, st_size=516952, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/*****/OneDrive/example4.jpg", {st_mode=S_IFREG|0644, st_size=557548, ...}, 0) = 0

Drag&Dropping the image in a browser tab takes a few ms in comparison.

Possible solutions:

  • Never access other images
  • Setting to exclude certain paths

If you turn off preloading, it should prevent this.

That unfortunately didn't fix it

Other things to try, in Miscellaneous settings:

  • Make sure "Allow MIME content detection" is NOT checked.
  • Avoid "Sort files by": "Type". Even the date sorting modes and by size are requesting additional function calls when gathering the directory listing, which could trigger additional work depending on how it's implement behind the scenes by Qt, the operating system, and the file system. So try sorting by Name if it isn't already to see if it helps.
  • Not relevant if you're using 6.1, but the nightly builds introduced a "Skip hidden files" option. Querying the hidden attribute causes massive slowdowns in some cases (e.g. macOS accessing a Windows share with many files), so this should be unchecked (@jurplel might want to consider the default?). 6.1 looks for all files and doesn't query the hidden attribute, so no concern here.

I already had the same settings. Only turning off Save recent files fixed it

This probably slowed it down:

qView/src/actionmanager.cpp

Lines 388 to 392 in 018ef8a

for (int i = 0; i < recentsList.length(); i++)
{
// Ensure each file exists
auto recent = recentsList.value(i);
if (!QFileInfo::exists(recent.filePath))