From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SC0QGx9z0WDLQQEAgWs5BA (envelope-from ) for ; Tue, 22 Jun 2021 07:20:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EFStFh9z0WCrEAAAbx9fmQ (envelope-from ) for ; Tue, 22 Jun 2021 05:20:31 +0000 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 C325B1C1DB for ; Tue, 22 Jun 2021 07:20:30 +0200 (CEST) Received: from localhost ([::1]:49048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvYpp-000424-Ih for larch@yhetil.org; Tue, 22 Jun 2021 01:20:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvYoo-00040l-Id for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 01:19:26 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:39604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvYol-0003I6-MA for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 01:19:25 -0400 Received: by mail-pl1-x62e.google.com with SMTP id o21so9820986pll.6 for ; Mon, 21 Jun 2021 22:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=Oa3fnt2H0Jg0ncf8Iqh0l3gnjvIA3jLAi4lSdtUYGWE=; b=teiZEbg1QUU9aul9vkUqDw5yhjrOBRjNU12Ddg/mw3IkI7nV2txDDpqwClcmpYHMTw NP3+ldzC06og3qduotnwTnpXQ+ZtCwdOpqTSBcelLoC9LorWCdCCFPwa4tnBm4C1ZLXI 7gYAScp9qYFaeu4c2nyMUKa13PBZ1Y5tIk/n6vR15N3JaQ+vFhp7k2DwHUFAvSaZT4Q+ rqQUF9OdpyyvuXApAy/Ree3f9ngKbkqLWOppEoHLkDomNTQqAA8Tz7DepiSrvqppOEac nFnEXZsXOZT5hEDpBKC4gKN0EIVCtO8FbZeJTDjCbBdZCqrE+AfF2skY4/3YQnaktYec g+WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=Oa3fnt2H0Jg0ncf8Iqh0l3gnjvIA3jLAi4lSdtUYGWE=; b=jGGEeT7cAghzCuYwpEOEpNedOz7aPVr6WO7sA67FMLi0xCoDTc9bOR9JGk0iPdmL2F 6uLsaWtijV6IjUB751GsZqnPQxS9gN99jAN9bVnSAaf7GVFph/vTBcj+DIZQzMc2Z9V5 zjw/PDYo+3TScPi3Sdi1r5uBpYbUvrNhL5/0442X5xzwwjky7E+P520wQ32YrWorlR6V qz9lloM/Nzl8haWqOHa7Qj5gD2G/tvJwEW+h478E6faAZubFgaznULK78iFbGHn8On0j kE4+IbnaPUcoXHYbLn2hglaDS/ehs8MZGiHWbRlkZ7EtSEY18/KzFVzcKOfAoYZWzAJ4 b5Mw== X-Gm-Message-State: AOAM533I7FnL/P6QuU8/3KFyrU+n5nDU1L0EmUfIBhFB+31rTxV8pJLE tqOZAfOYLmSG/NTHNpYTtWProTpvUAE= X-Google-Smtp-Source: ABdhPJxjAKA+0LpdB1RbyUBqmsa6PPv1E7m0Dqt2PsV+R64qh1IFjBVQgfcdya1DiqKKMkVRwqOkHA== X-Received: by 2002:a17:90b:3507:: with SMTP id ls7mr1825125pjb.153.1624339161562; Mon, 21 Jun 2021 22:19:21 -0700 (PDT) Received: from tim-desktop (106-69-79-105.dyn.iinet.net.au. [106.69.79.105]) by smtp.gmail.com with ESMTPSA id w123sm16738958pfb.109.2021.06.21.22.19.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 22:19:21 -0700 (PDT) References: User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Large source block causes org-mode to be unusable Date: Tue, 22 Jun 2021 14:48:57 +1000 In-reply-to: Message-ID: <87lf72lbmy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x62e.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-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624339230; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Oa3fnt2H0Jg0ncf8Iqh0l3gnjvIA3jLAi4lSdtUYGWE=; b=M1QIxMUlrbnCiQCPM27P5zYx0kgOF38F0td6e1+WDXx4oWuLKemkQfuhoFiKVc8eFkwIGr AjYzYeKPeHVDR9xglDE3w7QAeJkT+Y2lbCmyPuTYsarBA71fZBU67Roo7WunxwRHdmN7Xb oTkX+2+s0ffNLkDIG7tdniNAgzLQHcCDD7p5uCH4+eBI9ilV4R7bTDvb0gs2CfRrwggt+0 je0zd2wVqHKbXn/a9sNcYPw99Ft0orzK2hqDjIBB1Txr1kv/VwLQZTJGqiwKpVPAleZO+p 8T5WwbKfMRK7aBgByQKjUoqL7801O7W/X617GuchaZDGiKH0o2b2R2PTdH6IbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624339230; a=rsa-sha256; cv=none; b=JXQ4QOVLV+d6nGWssJAPkuhE7MfoCXewQmLGD1DFPJxSs/XP+hcUTUYuYnWY33pMYJ1LVV A/gU93oh7bIAjHZD5gcU16wLctaku8UBBrh60Zaxl7+C1B7jFSCLm4o1oSOhpQZOHXNPdK tOeR6NIHs+R5A+ndRXjuvBq6lGPfdRzWLe1ijQMjep76zQ+FSkE+2Djc8yG9bJI7/83Mgo Db39oNohnKRTVwPD4S7ws9xDdYEHzRGC7iyv/QKLPHXLROjWBwK1Ti8LRCYgyAnAnmBSf2 DsoQojBdRA7w84otvUhuFhJjmEXolW8SdjPQa432zo9NplIwd0FHRn4IzSgjbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=teiZEbg1; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=teiZEbg1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C325B1C1DB X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: E8hsfL/Z/ORT Tom Gillespie writes: >> That said, I think keeping 2000 lines of source code inside an >> org src block is neither a standard use case nor a reasonable idea. > > I would say that it certainly is a standard use case for people who > want to keep everything in a single file (e.g. to simplify > reproducibility and avoid the mess of trying to distribute multiple > files to non-technical users). #+INCLUDE is not a substitute if you > are going to be tangling files, breaks many workflows, and as a result > should rarely be recommended as a solution when src blocks are > involved. Org should definitely be able to handle this case because > there is no reason why performance should be any worse than having a > 2000 line file in another buffer. > While I agree with the sentiment, I disagree with the conclusion "there is no reason why performance should be any worse than having a 2000 line file in another buffer.". Org mode is pushing right up against the limits of Emacs' architecture with what it is doing. The way modes and font-locking work in Emacs was never designed to support multiple modes and multiple font-locking schemes within a single buffer. The fact org is able to do this is a testament to the power of Emacs, but this comes at a cost and that cost is primarily with respect to performance. You can experience similar performance degradation when you use other 'modes' which try to support multiple modes in a single buffer (like mmm-mode). This is not specific to org mode, but shows up more due to the larger user base for org. > Org babel has many basic interactivity performance pitfalls that need > to be investigated. I personally have many workarounds for bad emacs > performance degradations related to code executing in the event loop > because I need to get on with the task at hand, but they need to be > fixed, not dismissed. I think the big challenge here is that the 'fixes' needed by org mode really need to be at a deeper level inside Emac core architecture. It isn't something which can be effectively addressed at the org level. This makes it a much bigger and more complex task which is further hampered by the need to maintain compatibility with all the existing modes and libraries. >From what I've seen in the org-devel list, there is on-going work which is focused on improvements to font-lock efficiency and I think support for multiple modes is also being considered in some of this work. Other developments, such as native compilation and pure gtk implementations may also help in this area. Unfortunately, it may take some time before we see the benefits of this work as it is complex and non-trivial work. In the meantime, we need to consider all possible work-arounds and tweaks which can help and in some cases, accept some compromise. Having source blocks which are 2000 lines long is, at this time, a challenge for org to handle given existing facilities. There are no quick and easy fixes, but there are some tweaks, such as turning off native fontification or using include files which can make the system usable. While not ideal, we have ot work within the limits of the current architecture while we wait for improvements, which can be expected to be incremental and slow. -- Tim Cross