From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] 5x speedup of flyspell-buffer Date: Fri, 14 Apr 2023 08:47:46 +0300 Message-ID: <833553ggl9.fsf@gnu.org> References: <837cug5l18.fsf@gnu.org> <83wn2g3wes.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10391"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ilya Zakharevich Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 14 07:48:43 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pnCIc-0002RU-Ml for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Apr 2023 07:48:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnCHu-0005h6-Jo; Fri, 14 Apr 2023 01:47:58 -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 1pnCHr-0005ck-A6 for emacs-devel@gnu.org; Fri, 14 Apr 2023 01:47:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnCHn-0007FS-VW; Fri, 14 Apr 2023 01:47:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=DUKSiskDZ5f/ZzqhtB4FUimtjol+V3KAvWHcFZ33HXg=; b=YZhiW3RrqkjcfIR/Sjp7 k9OgHiFsKSinuUVYpaQ8RJ/7cLZ61lgDYGdVOHZNHJ4u610nxFtOdESyBr7ON0zLs3/SV4r5clmHP 9QfW46n4UtX54UNs+GVo0Qr7+atTit80FDJf9VOzPvNkZQO6au/9WXJZp+PrYy/mvsUcuy1sAdz5Y I3gRRemBo3V5AKDSXDV/T5+53X2Ms6kLTwB9Nwo2kwjXyMe6AjCc6J48+3ZT4zfSfIrGcUhp+w+b3 FanoRQC7NzL7B3bV/HVb2cOQXzVyWLQCwjaE2oh+7vhqlcnxEsS4vu8i9HxGcrUTQgR0ZtMhoXU2G eMin2M8Vh2mJsA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnCHm-0006GE-Qe; Fri, 14 Apr 2023 01:47:51 -0400 In-Reply-To: (message from Ilya Zakharevich on Thu, 13 Apr 2023 13:29:33 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305307 Archived-At: > Date: Thu, 13 Apr 2023 13:29:33 -0700 > From: Ilya Zakharevich > Cc: emacs-devel@gnu.org > > On Thu, Apr 13, 2023 at 01:32:11PM +0300, Eli Zaretskii wrote: > > > Without profiling, how to find out “how much overhead is tolerable to > > > the user”?! > > > > Since you say the change you propose speeds up by a factor of 5, just > > setting N = 5 should do approximately the same, no? I'd actually go > > with N = 10 for a good measure. > > Nope. My solution decreases THE OVERHEAD 50 times. This SPEEDS UP > the whole brouhaha ∼5x (since the overhead was 4x). OK, then N = 50 should do the same trick. > > If you intend to do this asynchronously, I think a relevant question > > is why would you need to do that for the entire buffer? When doing > > this synchronously, the answer is clear, but doing it asynchronously > > means you don't really care when will it end. So in that case, > > perhaps a better idea would be to spell-check only the stuff in the > > window, and update that as the window is scrolled to expose more of > > the text, like jit-lock.el does for fontifications? > > The simple answer: this does not work. > > Observe “how well implemented” it is now — after decades of many > people trying! (I have seen something like tens of discussions of > people attempting something like this. The latest attempt I have seen > uses POLLING!) It does work here and elsewhere. But suit yourself.