unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on Linux
@ 2017-10-04  3:10 Bryan Gilbert
  2017-10-04  7:53 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Bryan Gilbert @ 2017-10-04  3:10 UTC (permalink / raw)
  To: 28695

Hi,

I've been using the Emacs 26 release branch and I've noticed a
significant amount of rendering lag spikes. When this occurs the UI
completely locks up in Emacs (and the desktop) for short periods of
time. Better than an explanation I have two very short screencasts
included below the display the behavior.

I've been able to reproduce the problem with 100% reliability using the
`counsel-rg` command from ivy/swiper (full details to reproduce below).
I've also used git bisect to narrow down the exact commit these lag
spikes were introduced as this commit:

https://github.com/emacs-mirror/emacs/commit/c29071587c64efb30792bd72248d3c791abd9337

I was able to verify that reverting to the previous commit before
double-buffering was added completely removed the problem. I've made two
short screencasts, one before the double-buffer commit and the other
after.

Before: http://drop.bryan.sh/YtUzfcSRp7.mp4
After: http://drop.bryan.sh/UyRpSc4NyQ.mp4

The behavior is unaffected by the glxgears program I have running in
both screencasts, I just used it as a method to show when the screen is
locking up. In the second screencast when it looks like the screen is
completely locked up, I am just pressing the 'e' and 'backspace' in
alternation once every second.

Two minor precursors to running the steps to reproduce are that one
would need to be running Linux and have 'rg' installed. 

Steps to Reproduce using emacs -Q:

1. Add the melpa archive

    (require 'package)
    (add-to-list 'package-archives
                '("melpa" . "http://melpa.org/packages/"))

2. Install Counsel:

    (package-refresh-contents)
    (package-install) ;; counsel

3. Enable Ivy:

    (ivy-mode 1)

4. Change counsel-rg minimum query length from 3 characters to 1 character:

    (defun ivy-counsel-ag-function (string base-cmd extra-ag-args)
      (when (null extra-ag-args)
          (setq extra-ag-args ""))
      (if (< (length string) 1)  ;; #1
          (counsel-more-chars 1)
          (let ((default-directory counsel--git-dir)
              (regex (counsel-unquote-regex-parens
                      (setq ivy--old-re
                              (ivy--regex
                              (counsel-unquote-regex-parens string)))))) ;; #2
          (let* ((args-end (string-match " -- " extra-ag-args))
                  (file (if args-end
                          (substring-no-properties extra-ag-args (+ args-end 3))
                          ""))
                  (extra-ag-args (if args-end
                                      (substring-no-properties extra-ag-args 0 args-end)
                                  extra-ag-args))
                  (ag-cmd (format base-cmd
                                  (concat extra-ag-args
                                          " -- "
                                          (shell-quote-argument regex)
                                          file))))
              (if (file-remote-p default-directory)
                  (split-string (shell-command-to-string ag-cmd) "\n" t)
              (counsel--async-command ag-cmd)
              nil)))))

    (advice-add #'counsel-ag-function :override #'+ivy*counsel-ag-function)

5. Run 'counsel-rg', begin typing, and notice large lag spikes

    (counsel-rg)


Step number 3 is a bit of a messy step, however by lowering the minimum
query size from 3 characters to 1 character makes the rendering lag spikes
painfully obvious.

Thanks!


=========================================================================


In GNU Emacs 26.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
 of 2017-09-28 built on borealis
Repository revision: 88a0dd71f10ffb63fba08c062e948551c3e876c2
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:	Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-sound=alsa --with-xft --with-modules --with-x-toolkit=gtk3
 --without-gconf --without-gsettings --without-gpm --without-m17n-flt
 --with-xwidgets --without-compress-install 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES
XWIDGETS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_COLLATE: 
  value of $LC_CTYPE: 
  value of $LC_MESSAGES: 
  value of $LC_MONETARY: 
  value of $LC_NUMERIC: 
  value of $LC_TIME: 
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8





^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-05-22 11:28 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04  3:10 bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on Linux Bryan Gilbert
2017-10-04  7:53 ` Eli Zaretskii
2017-10-04  9:04 ` martin rudalics
2017-10-04  9:32   ` Eli Zaretskii
2017-10-04 11:21     ` Bryan Gilbert
2017-10-04 11:36       ` Eli Zaretskii
2017-10-04 12:02         ` Bryan Gilbert
2017-10-04 12:31           ` Eli Zaretskii
2017-10-05 13:36       ` Dmitry Gutov
2017-10-05 14:01         ` Eli Zaretskii
2017-10-05 14:02         ` Noam Postavsky
2017-10-07  7:53           ` Dmitry Gutov
2017-10-07  8:14             ` Eli Zaretskii
2017-10-09 13:53               ` Dmitry Gutov
2017-10-09 14:03                 ` Eli Zaretskii
2017-10-15 22:55                   ` Dmitry Gutov
2017-10-16  2:30                     ` Eli Zaretskii
2017-10-26 23:19                       ` Dmitry Gutov
2017-10-28  9:33                         ` Eli Zaretskii
2017-10-28 21:47                         ` bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on GNU/Linux Richard Stallman
2017-10-05 14:26         ` bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on Linux Bryan Gilbert
2022-04-23 13:46 ` Lars Ingebrigtsen
2022-05-22 11:28   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).