From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#71355: 30.0.50; [PATCH] Improve performance of buffered output in Eshell Date: Tue, 4 Jun 2024 17:52:03 -0400 Message-ID: References: <22b0dc8f-11dc-5fd2-c75d-88c17580d28d@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39610"; mail-complaints-to="usenet@ciao.gmane.io" To: Jim Porter , 71355@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 05 00:02:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sEcEY-000A5g-NO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Jun 2024 00:02:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEcE2-0000tg-Hk; Tue, 04 Jun 2024 18:01:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEcE1-0000t8-6g for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 18:01:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEcE0-00019W-RL for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 18:01:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEcEE-0003i5-0U for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 18:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2024 22:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71355 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71355-submit@debbugs.gnu.org id=B71355.171753847414146 (code B ref 71355); Tue, 04 Jun 2024 22:02:01 +0000 Original-Received: (at 71355) by debbugs.gnu.org; 4 Jun 2024 22:01:14 +0000 Original-Received: from localhost ([127.0.0.1]:54919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEcDR-0003g4-QO for submit@debbugs.gnu.org; Tue, 04 Jun 2024 18:01:14 -0400 Original-Received: from mail-ej1-f48.google.com ([209.85.218.48]:58468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEcDP-0003XU-3u for 71355@debbugs.gnu.org; Tue, 04 Jun 2024 18:01:11 -0400 Original-Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a68f10171bdso353621966b.0 for <71355@debbugs.gnu.org>; Tue, 04 Jun 2024 15:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717538391; x=1718143191; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=jG/mT15whW1LN+9lp+fjKeIUAMwWxaCsg0eMMV/einY=; b=krVmhWyktNfLHaYcXEbnNs78pp1q6Ix6USFv7dwDCNUk5cZouWFBIlzV2y6q9LGx2K m5W3KwHgg1iybNWFyoGshRb2JPaJEJnK7RqJIg7Afpil6BiWdD1nPzhfc9t1dEOuYnZY zXPGM+2fbqifeYSR+wGlKf65vBWQMg7LcfToYEVMS6k0XUEFu5jFCCRKY5W8nD3utR5A BoUvcKWEk2tG1lUfic88Lu6+XERarlBv/q/QFERxRK+FB8K6IVPBvsLJCFgak2vAXgd2 Kj3uPs14wk6Ra6UNATzzMUA6P+gH7q6H5iBkAaQAarLoqzwaZEFxhYOx/5cfPHmUGcL8 msLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717538391; x=1718143191; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jG/mT15whW1LN+9lp+fjKeIUAMwWxaCsg0eMMV/einY=; b=FHFG/ty8YKBVq6HNBCbLgjdubTVUJ7TkZ4b2NDH2BeIg506QqY708KWcetUNrfWD3f MdvwmQqPTeRE2KmpjvFq7KTgopRZfUDMM4RyQnCoKpXoQOSO5GQLMrJbzROT0XpVnd9E zeg4KVRuwvchHGhsWmMjpO+uIWIHylqXK93xG3kthWiC8WtzQ4FKTRyXbdFaqap7EFOF CxFMLa5Q93TMm78tY+lIfiIArz/OClUDd4FHyxNuG/S1gYm9KgRbfXxSA9qSlb++DM6i xVjC5hIXfJN2GyZNLOdk9oIcTUDemOVzoAkNoP+v1b6OZALMCUXksPrLOBvILT1Q/AEh zumA== X-Forwarded-Encrypted: i=1; AJvYcCUlr4OJMbVdxZYD43O6s/YzvBLW2V8BcZEkBZs9DGFIzSGe9xHiDfA6UCqi7iYzuu+csjPuhJYYHXdB7A3LtLO1qWz4N84= X-Gm-Message-State: AOJu0Yw9Y3kDXEvFXk8hejZ+oW45Mbo6Ai66cj0eIM3hyvYZUoS3zhud bhRwH/de7H4bDsjK+OPj3+3W0nZuMG8q4dq0cJW5Vn1N0/L504Y9PSnzM+kyPg1P3XdRit91SKj H2JIX87FksII9g9TAUKe7XSQ45J5LBpho X-Google-Smtp-Source: AGHT+IEaG+2KF6pMEAoOToSC4qT0X2nWLjkruYkZDX7KPpZB0dBU829Wl9/8iObIFCB46Tg9p6uvlZbo4OtOscOZ11c= X-Received: by 2002:a50:bb03:0:b0:57a:1c44:581c with SMTP id 4fb4d7f45d1cf-57a8bc91223mr547968a12.32.1717537923838; Tue, 04 Jun 2024 14:52:03 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 4 Jun 2024 17:52:03 -0400 In-Reply-To: <22b0dc8f-11dc-5fd2-c75d-88c17580d28d@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286559 Archived-At: Jim Porter writes: > In Eshell, if I run "time cat config.log" from my Emacs build directory, > it reports that it takes about 7.5s. It also doesn't show *any* output > until it's completely finished. With my attached patches, it now takes > about 0.6s and also shows the output iteratively, redisplaying > periodically so users can see that something is happening. > > The other command most likely to be impacted by this is the built-in > version of "ls". When I run "ls -Al /usr/bin" on my system, I go from > 2.1s before my patch to 1.2s after. Not as big an improvement, but still > noticeable, and it *feels* a lot faster too with the iterative redisplay. > > I don't usually add a NEWS entry for perf improvements, but this one > seemed notable enough that I figured it was worth tooting my own horn. :) Nice, thanks for working on this. Your patch makes sense to me at first glance, but I didn't test it. The performance improvement definitely seems highly worthwhile based on your measurements. Bonus points for adding tests, as always. > +(defcustom eshell-buffered-print-size 2048 > + "The size of the print queue in characters, for doing buffered printing. > This is basically a speed enhancement, to avoid blocking the Lisp code > from executing while Emacs is redisplaying." How did you decide on this value? Could the docstring be expanded to explain what a user can expect to happen if they increase or decrease this value?