Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 734642 - app-editors/gvim app-editors/neovim-gtk with x11-drivers/nvidia-drivers-{450.80.02,455.28,455.28-r1} show performance regression in scrolling speed compared to 440.100-r2
Summary: app-editors/gvim app-editors/neovim-gtk with x11-drivers/nvidia-drivers-{450....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: David Seifert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-30 02:43 UTC by Christopher Head
Modified: 2020-12-10 02:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Head 2020-07-30 02:43:54 UTC
With nvidia-drivers-450.57, I open a file of decent size (just a few hundred lines long is sufficient) in a maximized gvim window. I then use page-down to scroll to the bottom of the file, and, upon reaching the bottom, use page-up to scroll back to the top. Repeat. While doing this, monitor CPU usage with “top” in another window. After a number of seconds, CPU usage of the X process gets very high (70+%, sometimes up to 100%) and the scrolling starts to get noticeably laggy. CPU usage of the gvim process is in the 20–30% range.

Trying the same experiment with a homebuilt neovim-gtk yields similar results, but seems to hit the failure faster and harder.

It is not only scrolling that causes the problem—regular editing can sometimes run into it too—but scrolling is an easy and fast way to reproduce.

Downgrading to nvidia-drivers-440.100-r1 makes the problem go away; there, the same experiment results in gvim having CPU usage in the 30–40% range and X in the 20–30% range, with neovim-gtk showing similar results, and no visible lag developing, after a much longer time.

This does not affect all scrolling; catting the same file into a urxvt and scrolling it up and down uses very little CPU and does not show any lag. It may or may not be notable that gvim and neovim-gtk are both GTK-based while urxvt is not. I haven’t checked whether this affects other GTK-based software.

Reproducible: Always




chead@amdahl ~ $ emerge --info x11-drivers/nvidia-drivers
Portage 2.3.103 (python 3.7.8-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.30-r8, 5.4.48-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.48-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:    16410256 total,  14688832 free
KiB Swap:   12362176 total,  12362176 free
Head commit of repository steam-overlay: b8fc2697aadc252bcd8c229ef24db59fd67728f4

Timestamp of repository gentoo: Wed, 29 Jul 2020 01:35:21 +0000
Head commit of repository gentoo: c58b50dfcfeaf6739857e849f87d8fc09e6f4124

Head commit of repository zaber: 8bcb590ad7024d15d48b92cc4c3b05d85565f4e7

sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
ccache version 3.7.10 [disabled]
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo, 3.9.0_beta3::gentoo
dev-util/ccache:          3.7.10::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

steam-overlay
    location: /var/cache/repos/steam
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 1

gentoo
    location: /var/cache/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    sync-user: chead
    priority: 3
    sync-git-verify-commit-signature: true

hawk777
    location: /var/cache/repos/hawk777
    masters: gentoo
    priority: 4

zaber
    location: /var/cache/repos/zaber
    sync-type: git
    sync-uri: git@gitlab.izaber.com:/firmware/gentoo-overlay.git
    sync-user: chead
    masters: gentoo
    priority: 4

Installed sets: @admin, @android, @desktop, @dev, @emulation, @foldingathome, @fonts, @games, @media, @net, @office, @taskcoach-dev, @vim, @web, @xfce, @zaber
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE freedist"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 8 --with-bdeps y --complete-graph y -1"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
GENTOO_MIRRORS="http://gentoo.gossamerhost.com/ ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles http://gentoo.osuosl.org/"
INSTALL_MASK="/sbin/installkernel"
LANG="en_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_CA"
MAKEOPTS="--jobs 4 --load-average 8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl alsa amd64 bzip2 cairo caps cli dbus dri elogind ffmpeg flac fontconfig fortran gtk iconv icu idn ipv6 joystick libnotify libsamplerate libtirpc luajit multilib ncurses nls nptl ogg opengl openmp opus pam pcre policykit readline seccomp split-usr ssl startup-notification svg theora threads truetype udev unicode vaapi vdpau vim-syntax vorbis vulkan xattr xinerama xscreensaver xv xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx popcnt sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-CA" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" XFCE_PLUGINS="logout menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

x11-drivers/nvidia-drivers-440.100-r1::gentoo was built with the following:
USE="X driver gtk3 kms libglvnd multilib tools uvm -compat -static-libs -wayland" ABI_X86="32 (64) (-x32)"
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-07-30 12:56:42 UTC
Works fine for me. Also, how did packaging of nvidia-drivers cause any of these problems? In other words, why are you reporting this here and not upstream? Is it about the way nvidia-drivers is installed?
Comment 2 Christopher Head 2020-07-30 14:15:11 UTC
(In reply to Jeroen Roovers from comment #1)
> Works fine for me.

Any hints on how to narrow down the problem then?

> Also, how did packaging of nvidia-drivers cause any of
> these problems?

I don’t know whether it did or not.

> In other words, why are you reporting this here and not
> upstream?

I thought the standard procedure for reporting bugs encountered while using Gentoo was to bring them here, and the package maintainer—being an expert on their package—would try to determine whether the problem lay in something Gentoo-specific or whether the bug should be taken upstream.

> app-editors/neovim-gtk

It’s called this in my overlay, but as I said in the description, it’s a homebuilt version, so I don’t know whether it’s appropriate to name it as such in the bug title. There is no package for it in ::gentoo. Up to you which you prefer though.
Comment 3 Christopher Head 2020-08-25 13:23:42 UTC
I wondered if it might be that the newer driver was actually more efficient and therefore ran the CPU at a lower frequency due to cpufreq, leading to lower overall performance. But that’s not the problem. Even with the performance governor, the problem still exists.
Comment 4 Christopher Head 2020-09-03 01:40:58 UTC
I wondered if window manager compositing might matter. I tried turning it on (I had it off before). No difference: even with compositing enabled, 450.66 is very slow and 440.100-r1 is fast.
Comment 5 Christopher Head 2020-12-10 02:58:38 UTC
Turns out the problem only happens when there are a lot of spelling error squiggles present while scrolling rapidly. While it did seem to get worse in 450, 455 seems to be not fantastic but not noticeably worse than 440, so I think the problem as described (performance regression) is probably fixed.