From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bryan Gilbert Newsgroups: gmane.emacs.bugs Subject: bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on Linux Date: Tue, 03 Oct 2017 23:10:16 -0400 Message-ID: <8760bvd2w7.fsf@bryan.sh> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507098011 22802 195.159.176.226 (4 Oct 2017 06:20:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 06:20:11 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 26.0.60 To: 28695@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 08:20:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzd2L-0005Lc-Ps for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 08:20:06 +0200 Original-Received: from localhost ([::1]:33331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzd2T-0006Te-6g for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 02:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzd2M-0006Rl-NL for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 02:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzd2J-0005CI-5C for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 02:20:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzd2I-00059r-Km for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 02:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzd2I-0008Rf-FV for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 02:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bryan Gilbert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Oct 2017 06:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28695 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150709795032382 (code B ref -1); Wed, 04 Oct 2017 06:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Oct 2017 06:19:10 +0000 Original-Received: from localhost ([127.0.0.1]:47256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzd1S-0008QE-1f for submit@debbugs.gnu.org; Wed, 04 Oct 2017 02:19:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dza4v-0003OT-E1 for submit@debbugs.gnu.org; Tue, 03 Oct 2017 23:10:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dza4o-0005YF-VD for submit@debbugs.gnu.org; Tue, 03 Oct 2017 23:10:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36573) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dza4o-0005Y0-Rn for submit@debbugs.gnu.org; Tue, 03 Oct 2017 23:10:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dza4n-00086r-GA for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 23:10:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dza4k-0005T0-8X for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 23:10:25 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dza4j-0005OA-B3 for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 23:10:22 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 77DB2210F0 for ; Tue, 3 Oct 2017 23:10:17 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Tue, 03 Oct 2017 23:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryan.sh; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=cQp/Fa Qxqm0OCOFauFx3tLpaUfzvbsf4GHvmzzhP5Us=; b=O6WgIxvggUM2pMIEuykJwh YVKK5I5x6KfoC/jWvfPNNS2y2OVw+b5/CoZ2okWq2iFVhNeSWlf04rUXXNW30/dr 5McN+F3454k9PRsjJ0i+NVsf/7yl0OObyGFft9hGSrjxdK/eAlUE35qh9Y9q9egC 0n6QeqaoWGuVrjNS8sTiUGNBbozfJuBo/gMvzHPvZ3Y/THkrmAVeCoYWTKamRh2E 9TzQsO5PgumZeMMrh3yag2ieIHcXjRfAWdZtqgduDUQ9D/QRik7OsZsvFTt6zEtQ CcLa/sAvhWSJct2kd460ZHFY2GrgdRbjNHH71oKo1ZWOBAPVB1WLc+XUTqy0WMTw == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=cQp/FaQxqm0OCOFauFx3tLpaUfzvbsf4GHvmzzhP5 Us=; b=Bu13w4u53tGy04ifWDhWoqg+gbA+p1nzwD1ML3eu485uaU6xeQsvI5fdy 97e4xTzL/N2IF3zoId1wjydUu28MD/Smt6W4VMaSbt0LSb0K7qGScro1PNhmY5Vu sIJnouG5X3XhuXck43/i/zoOWvhBntlnwNirLBfDqL/GMDVKM9kYT7WmKt0ipVVH 1mYaSeW6OuYscMocdClMnL88t2N628MebCHM4iagRAeNNO9HipmETYih3IFB4tbu fO6nUTxj7mcJcmMb5j3LRJq/DRwWdJ3YSFgb9EcTXfVxj7GVF9kp1Kcp+usX0EzM D8l87qiDlViP17NOPfg8lOy7PdMqA== X-ME-Sender: X-Sasl-enc: VXKD1y3cssGEQmXT/P/JhIELeJjx787vO4vjwBl30Cdy 1507086617 Original-Received: from borealis (23-116-242-116.lightspeed.chtnsc.sbcglobal.net [23.116.242.116]) by mail.messagingengine.com (Postfix) with ESMTPA id 21C0A24586 for ; Tue, 3 Oct 2017 23:10:17 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 04 Oct 2017 02:19:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137869 Archived-At: 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