#980780 mpv: Slow performance when startup

Package:
mpv
Source:
mpv
Description:
video player based on MPlayer/mplayer2
Submitter:
Tee Zhen Cong
Date:
2021-01-22 03:03:04 UTC
Severity:
important
#980780#5
Date:
2021-01-22 03:00:21 UTC
From:
To:
Dear Maintainer,

Mpv takes around 2 to 3 seconds to startup even only run --help
command without running any video. This only happens in Debian 10. In
Debian 9 and Debian 8, mplayer (predecessor of mpv) runs in less than 1
second.

when check with strace, we found out that each of the library loaded by
mpv, it will do multiple llseek and read at same location. Sometimes it
loads up to 5 or 6 times at same location. Mpv has many libraries and
this causes the slowness of startup of mpv. Example of strace as below:

openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabi/libsndio.so.7.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\330!\0\0004\0\0\0"..., 512) = 512
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41
_llseek(3, 49656, [49656], SEEK_SET)    = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
_llseek(3, 49328, [49328], SEEK_SET)    = 0
read(3, "A(\0\0\0aeabi\0\1\36\0\0\0\0055TE\0\6\4\10\1\t\1\22\4\24\1\25"..., 41) = 41

In fact, we checked and found out that running other applications in Debian10
also has this issue. Debian 9 and Debian 8 does not have the same issue.

Please help. Thank you