From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yJUhF2LFMWNFlgAAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 17:29:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8JomF2LFMWMXqQAA9RJhRA (envelope-from ) for ; Mon, 26 Sep 2022 17:29:38 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0C2DB38D76 for ; Mon, 26 Sep 2022 17:29:38 +0200 (CEST) Received: from localhost ([::1]:39072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocq36-0003QN-Bo for larch@yhetil.org; Mon, 26 Sep 2022 11:29:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocpqX-0008OZ-Ol for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 11:16:39 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:42629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocpqI-0003cG-1q for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 11:16:37 -0400 Received: by mail-pl1-x62e.google.com with SMTP id v1so6509498plo.9 for ; Mon, 26 Sep 2022 08:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=JV9nMjaEjiKFHKEBPV47I5mFeFl0+y42uSrE20kPFWk=; b=AyRjawjf5arrbg+FMVWzuTcXglze4RMbOX2SOu2i85ZOEelXAxqK76oA8cByXGElmu HCfcF7BG7PFdvz2lTLitG5aXnuAYR21gPXHEQmy2rhFWNR06HqW6lgaV3stbrRgeryy4 UugLC5TuvGsO7sf/sI82Iqnn+E40lRspQdu2FV89Kd11EANQt20S436pLMbzRUdk/JS0 XeVAsYYX+nXNCGJpaANu/7QgWydcEuV3UqK5kG5rHhosML9rl0JhphXZfRG3pDZzbu6Z KttHWMLAltJbBghRX526kupCRAHd6PW/0JBjz88lnT1mzJlumVJABLTl9s76jjxitoVQ 2nNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=JV9nMjaEjiKFHKEBPV47I5mFeFl0+y42uSrE20kPFWk=; b=F1gd1PNt7MtMOGr826lvZ/T1rOxmEE99uIMvzfUamq8EH8izZhRWG02tvu++9/oSZf 6Jg7iTKe3XavGQwKi+GVdAFGD/fakGsRMOTX4G+jV/1whtVsN5i7aFFj+4YwAv3gWuUE 7zVzCYm0Hgms1oqjBf4vIyjUbvLlAR3JRPcI3TubSJa9fpqTvw6uRWQ4G+q4mYfCZQIc xbv976/tKmaK6R05eE/Z/2XQXcD7Qi9BSoH5MpddhtOzfckdXP2mCyMafzOUTXXa71tC yuxgGtvUuIh7Of2r1/OPekARboT9RMUlkTMpaDKjyI2lL3fKq/GwqGtCDXHgju+sVmw2 5anA== X-Gm-Message-State: ACrzQf25wOqETfx2e3F3HlKgCKp9iOAjj0N8piuWTRqH6DuCgnQ9PhbD FemKxK4WT0NpBzJQqmUEM9U= X-Google-Smtp-Source: AMsMyM5Z+2BWlyj84uT5jnwnLnC77tC27dKCwB6o5bciWLA3Yy/bnjN6GsiCHDYFqB1mdBxEa2jjGg== X-Received: by 2002:a17:902:e782:b0:179:da9d:6b8 with SMTP id cp2-20020a170902e78200b00179da9d06b8mr5904410plb.50.1664205380418; Mon, 26 Sep 2022 08:16:20 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id a124-20020a636682000000b00439103a6c3bsm10802845pgc.94.2022.09.26.08.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 08:16:19 -0700 (PDT) From: Ihor Radchenko To: Luca Ferrari Cc: emacs-org list Subject: Re: emacs really slow when inserting a new source code block In-Reply-To: References: <871qry7nmg.fsf@localhost> Date: Mon, 26 Sep 2022 23:17:11 +0800 Message-ID: <875yhaf9mw.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664206178; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JV9nMjaEjiKFHKEBPV47I5mFeFl0+y42uSrE20kPFWk=; b=RW/dKtKFDTd+crUFX3ybmw9sfKUsWw34NFDMCYRcohGmeuafwPgFZzC1kbeSVOUrAIdrFi g4BivofHn2N6ytqGNCbNampIODXICblRGf2hLE++xYMXuBpy9jE3SbFSW4LBNDqxwlkFOv 817jL7oeVqYWZToDK53NjRt02oeZa7O3lhhZKt0Qu1GLS+Z9vo2o4t26DMhxIpl7vmmHFv /vWSF4OOky9EsXwtBnt0flOTaunq1s2yyE5uozH3jd71jzLl44zPba7pAUwaUuSVOcNYg3 4KoJx1juzmfldp6rS0Cmu72rZuutcRiXkjQ6hRqWQslAS/qGKbJQncf3z4GPlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664206178; a=rsa-sha256; cv=none; b=pqwn7fT+lzW4r7kZrPRFGA3sWX56IUdaKV5jJUZe2L+3d9tsYg/AsabeGp1ck71bcetI28 iQOv7mGCBGApn2HkXLWoe0bJHc93YsnBZ/fWPFy4Z+Ih0gIpPJt/fZwkrjy0KJagByJmm5 D9KI52rBSCXtCd17NwOutkWW/OijDPTLHXiXPYH622xOLH6c8tPvpcoXPx0MKKldiJ357l 47Z1CG2qHvijUUKe43hBwxPekRIcp3pJyPjkRyH2/Hg4WJz7U9iWHCKSo7F9JrozPTfBI8 eBGpO5nbqBAlqhRHnavVhowl4iW3aCMfcuTarT4oPvPNMysst0QkSrW7xoak/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AyRjawjf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AyRjawjf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0C2DB38D76 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3iDfCipI9vek Luca Ferrari writes: > On Mon, Sep 26, 2022 at 6:41 AM Ihor Radchenko wrote: >> Thanks for reporting! >> May you >> 1. M-x profiler-start cpu >> 2. Move/paste/edit your source block >> 3. M-x profiler-report >> 4. M-x profiler-report-write-profile and share the resulting file here > > Apparently I'm not able to get the profiler report written. > However, I discovered that, for instance, when I'm editing a piece of > code with regexp Emacs seems to suffer, at least it is the only > chances I had today to get it slower. > The messages buffer does not help very much: > > CPU and memory profiler started > End of =E2=80=98m/ ... /=E2=80=99 string/RE not found: (scan-error Unbala= nced parentheses 74 82) > Auto-saving...done > CPU and memory profiler stopped > profiler-write-profile: Wrong type argument: arrayp, nil I think you tried to use M-x profiler-stop instead of M-x profiler-report M-x profiler-report show yield a new buffer displayed the profiler tree. M-x profiler-write-profile will work from inside that buffer. You can refer to https://cubeatic.com/index.php/s/iQakFWXgxsJzyXP (around 22:00) for a more detailed showcase. > Oh, I also tried to disable flyspell, but it seems to me it gets > re-enabled for the source code block I'm within (but it's just a > feeling). > > Any idea? Another thing you can try is setting org-src-fontify-natively to nil in your config. --=20 Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92