From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: igc, macOS avoiding signals Date: Sat, 04 Jan 2025 14:59:50 +0100 Message-ID: <87wmfaof1l.fsf@gmail.com> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <87msgdkt29.fsf@gmail.com> <86h66lnjrt.fsf@gnu.org> <868qrxnfrw.fsf@gnu.org> <87a5ccl2zx.fsf@gmail.com> <875xn0p3l1.fsf@protonmail.com> <86ldvwm190.fsf@gnu.org> <87cyh8nczh.fsf@protonmail.com> <867c7fncom.fsf@gnu.org> <87pll3ivzs.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2454"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Pip Cet , gerd.moellmann@gmail.com, spd@toadstyle.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 04 15:00:37 2025 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 1tU4hh-0000Wg-14 for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Jan 2025 15:00:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU4h5-0007HK-HE; Sat, 04 Jan 2025 09:00:03 -0500 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 1tU4h2-0007H5-DI for emacs-devel@gnu.org; Sat, 04 Jan 2025 08:59:56 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tU4h0-0003ox-Ne; Sat, 04 Jan 2025 08:59:56 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385e87b25f0so8753011f8f.0; Sat, 04 Jan 2025 05:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735999193; x=1736603993; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=LXKRtZ8Hs5nMhIdQ758ZV6NS0axBDQhYnLPP7L+y0L8=; b=RYVbwozkKnfhxzuRtOkkpvezrU+JmuSlNrgxVCP8R1DQ15sD/9uoyt4blSw8DwkprU SfokmuKeDN7HJTo4afKlWzAsK1r38Wbjxjk5bc0X3FeD0UI77ujzWfzsvNXXutc6oqfe kf0o47NYgnRT7xL08gBBpHjsjdKJo0cHkMQVSUY4ftx9kKHdxQyuKFS6qO40NrZMmq8G oVkpDAh0Y+sMu+BLNx7pRir1zHW12f7bAoTI1hLALEye3En7Ver/tv6k9vd3hZxT7+K6 FUYoX+TlCOfR/nVQPKOHNREl4QV41/HG39N8tnoRpojHwLKj+qHK1yoRT5xBFThOGQjD HuiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735999193; x=1736603993; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LXKRtZ8Hs5nMhIdQ758ZV6NS0axBDQhYnLPP7L+y0L8=; b=YRO28bXRre2bptoDSMgyPex7AvEnjWKCq31hZWfvu65J2Nz1aVV5Mf2ntr/B7WY+ez 7U27gRBdW79U2MMgIYtRouRrJzoeNPOJj5G9jGlqjuj/TEvqFxyRsNjLC9JOlUh60g+8 6UCLIKLLJP5vW0MHWJJBsJtPg/q4UnS+dL8TZICW5emFVOoyyFUPkiaMbBaVJJJjjqoh 93HhVhjFo/1e3/Y5kPU2YMPzEwo/0pLV3smdAuXtL1It+1/QJ24BUPkfD5Y3PSFC79CY uAG3rHds5v4VGpU+RbrxQxnhENqbB/TiuqaneHkwUl7ePdhU+XtJKIukzeNAERAzOkuP usnw== X-Forwarded-Encrypted: i=1; AJvYcCWHaVrR1vG5nqwhfFHAvBzqR/ETSLcRwMBteHvAql2i33EZUdMP0nrynt7auDSCRg/uu/406exPIh0/YA==@gnu.org X-Gm-Message-State: AOJu0YyLw2YMELFAX8i6Z35uqq20ZK8gWybLT4ovD2/M13IYrbWqN8Yw Lgg4ioNMWv+lN6dU731cMveqR+vrD7P/T8zLk/sElwQcvobkoB6T7O26Qw== X-Gm-Gg: ASbGncs/vu6JpTQZn4AXRFm4ZRHnQp/yuw8NkgGunoJz4XeiGcZXIDio8U7YbJooiH8 CWDtRBXVp+1FHENGuxLAbR1qEqVY67nExTBc8HiUqv8ls1jB98BSckhcDip2v8cR4ayRm2gRtkZ OHo7romoWf+QZr53PRgr86tNXQg+nKuXR8vaGH/4Vvwoemh0Iw6RfrBuk9NaPyqot1tGlsswdHz 99abSjjPQDBxtlywxrsgTb9yZpaGEh0p0r8ajq6tSvau104Il16fw== X-Google-Smtp-Source: AGHT+IGklBVCKx03loTzGWp/jGZx/qu5TKxyfz+j7NyDJw53BeG0qZx1zzPaTU6zCvi2ghovpwWR4g== X-Received: by 2002:a05:6000:18a5:b0:386:3672:73e4 with SMTP id ffacd0b85a97d-38a1a2746a3mr48690966f8f.26.1735999192400; Sat, 04 Jan 2025 05:59:52 -0800 (PST) Original-Received: from caladan ([89.107.106.84]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43665cd9c29sm495203165e9.14.2025.01.04.05.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 05:59:51 -0800 (PST) In-Reply-To: <87pll3ivzs.fsf@gmail.com> (Helmut Eller's message of "Fri, 03 Jan 2025 19:37:59 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=eller.helmut@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:327665 Archived-At: --=-=-= Content-Type: text/plain On Fri, Jan 03 2025, Helmut Eller wrote: [...] > I'm not sure if those differences are acceptable. I also have no good > idea how to reduce it, except inserting more calls to maybe_quit. It seems that calling maybe_quit before and after calling functions would cure this problem. With the original maybe_quit restored, as in the attached patch, the foo example looks so: 1986 100% main 1986 100% record-samples 1986 100% foo 1214 61% float-time Compared to the original 1074 54% float-time that seems pretty ok. Also the bar example 812 80% animate-place-char 6 0% window-start 29 2% beginning-of-line 29 2% delete-char 6 0% undo-auto-amalgamate 36 3% insert-char 390 38% move-to-column 11 1% undo-auto--undoable-change looks quite good to me. WDYT? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Restore-maybe_quit-before-functions-are-called.patch >From 754efc2306682d882595c1b72022a877b0f415f8 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Sat, 4 Jan 2025 14:33:57 +0100 Subject: [PATCH] Restore maybe_quit before functions are called. * src/bytecode.c (exec_byte_code): Call maybe_quite before pushing a function. --- src/bytecode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bytecode.c b/src/bytecode.c index 53c200e2c18..886be3e67f2 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -784,6 +784,7 @@ #define DEFINE(name, value) [name] = &&insn_ ## name, } } #endif + maybe_quit (); if (++lisp_eval_depth > max_lisp_eval_depth) { @@ -828,7 +829,8 @@ #define DEFINE(name, value) [name] = &&insn_ ## name, else val = funcall_general (original_fun, call_nargs, call_args); - maybe_quit (); + maybe_quit (); /* needed for profiler */ + lisp_eval_depth--; if (backtrace_debug_on_exit (specpdl_ptr - 1)) val = call_debugger (list2 (Qexit, val)); -- 2.39.5 --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=bar-3.report 0 0% nil 1007 100% normal-top-level 1007 100% command-line 1007 100% command-line-1 1007 100% main 1007 100% record-samples 1007 100% bar 1007 100% animate-birthday-present 999 99% animate-string 5 0% sit-for 5 0% sleep-for 12 1% animate-initialize 126 12% primitive-undo 18 1% abs 846 84% animate-step 812 80% animate-place-char 6 0% window-start 29 2% beginning-of-line 29 2% delete-char 6 0% undo-auto-amalgamate 36 3% insert-char 390 38% move-to-column 11 1% undo-auto--undoable-change 8 0% capitalize 8 0% load-with-code-conversion 8 0% insert-file-contents 8 0% set-auto-coding 8 0% find-auto-coding 8 0% auto-coding-regexp-alist-lookup 8 0% re-search-forward 0 0% ... --=-=-=--