From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id UJHWOL9lImYNMAEA62LTzQ:P1 (envelope-from ) for ; Fri, 19 Apr 2024 14:38:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UJHWOL9lImYNMAEA62LTzQ (envelope-from ) for ; Fri, 19 Apr 2024 14:38:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=R4df7pcc; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713530303; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9Vy8FgYyT4lI6wLF4h75ItcNbwunwsXJIF3pvHd1x3k=; b=UejoqDTx1O164LxEwKW1YlZGNGs42izvj/7gUTkmpZhzdVav0xOuESF0zpylzxm1YT22I0 NIhM+b1Y2hnCRXJnt9aNpGSdgaZWl/+Loh2BvPoWy6MTJV5uDBBzzV/r9BXvvoN8bMOFnu zUlT2ZyT04bFgGsaxyC7NazBGahLjE0eJXFH4OXopA6l7FFCDSZgOumCwyYLN0EROGgYDd HeKpaf4nV7/kRyBCH72EVMpG3l2uKSfYp45rvfNLlxBS3FgGP1a45N1BR9oGgleJloThjM yaEWO6ovH2CinXNcNtWTU6xL3hqCEJKX6XZ/SCASJNu68ZJOzdQzAxr0kFWDDg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713530303; a=rsa-sha256; cv=none; b=uDjNj/RFkhEcGbjgiUFuhBlMTJyTUg1pkwMvgXDEHviNIFRnkxxoLdPo8hzj56dZZTervz bxG2TLwOn4SI1VPv2GCnqqZMRiGvZf7NhNIzYopQ61a0/AEsi0Bnf5mrLupaQ3qWbHpzy5 yy1pFqtefHZ+N4zQavrRA46wdDWmsfh8YoDvEyjhNAZ82K0eSHPdrJ8dBW+PDBSyhafD6n LUMTmz9PcIQVkPk8MZlAHR4V1mLlRlFwlzdfbjbRUfukgKg4Q9My+xiOesie1OoMG3FNWW 4CGfG5E2HFvU8YRwdlipX3ZtSZkAO1MDHLxwhQHll8Gm+N8Yi1FPPL+Dc51e8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=R4df7pcc; 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"; dmarc=pass (policy=none) header.from=posteo.net 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 CB8CE23A5B for ; Fri, 19 Apr 2024 14:38:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxnUq-0003vl-TG; Fri, 19 Apr 2024 08:37:40 -0400 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 1rxnUp-0003vc-7M for emacs-orgmode@gnu.org; Fri, 19 Apr 2024 08:37:39 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxnUn-00026x-59 for emacs-orgmode@gnu.org; Fri, 19 Apr 2024 08:37:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AB2D2240027 for ; Fri, 19 Apr 2024 14:37:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713530254; bh=PVQBRN35wwSfxkWHJGId9q12mszusZiLOHMtUCpyHUw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=R4df7pcchMJnGt4sz1wJ8E3DH++doKE8HRIEm9l5wbhbwsqQGT9MWWQzQgYlyidz1 hTSsw3Cr4a2vB0fsKqovxTGOJBvxILXwIvWruCKJgovVs+XO35+NMitsPGr3fRWuR7 61emFKTJACvebZpHL1BVpz0UQ/D1LIZmsGt8I4I6d/fkX4xEKMhFCjno17y987Mz+l fa4wydG76/G7VrOQfQCUgehRarRMqv7lIBuYG7GIlzq8Jnk2VA7QaNy/a9PRulOrJs 8Q6Yruc6eegQCTUD+nnZJErdpbpJu+IAwdwlacQDIb5k+xN88ZY4+mwG6l29JxRKnD qk52Xx0uMkBvQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VLZ0s4nYKz6twp; Fri, 19 Apr 2024 14:37:33 +0200 (CEST) From: Ihor Radchenko To: Karthik Chikmagalur Cc: emacs-orgmode@gnu.org Subject: Re: org-persist-write slowing down kill-buffer In-Reply-To: <874jbz9xvl.fsf@gmail.com> References: <874jbz9xvl.fsf@gmail.com> Date: Fri, 19 Apr 2024 12:38:20 +0000 Message-ID: <87y199cytf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.12 X-Spam-Score: -9.12 X-Migadu-Queue-Id: CB8CE23A5B X-Migadu-Scanner: mx12.migadu.com X-TUID: GBhUIb85OhPq Karthik Chikmagalur writes: > I've been noticing that kill-buffer blocks Emacs for a noticeable > period when killing org buffers. Here are elp results obtained by > instrumenting org-persist-* and kill-buffer: > > | Function name | Call count | Elapsed time | Average time | > |-----------------------------------+------------+--------------+--------------| > | kill-buffer | 38 | 2.5647546329 | 0.0674935429 | > | org-persist-write-all-buffer | 1 | 2.562779994 | 2.562779994 | > | org-persist-write-all | 1 | 2.56277329 | 2.56277329 | > | org-persist-write | 1 | 1.627834788 | 1.627834788 | > | org-persist--write-elisp-file | 1 | 0.312172392 | 0.312172392 | > It blocks Emacs for about 3 seconds each time. Any Org file with > 500 > lines causes this behavior. > > I've also attached the sampling profiler output from killing an Org > buffer. > > Some facts that might be relevant: > > - I'm using the WIP LaTeX preview system fork of Org, but there are no > LaTeX previews in the Org buffers that I run these tests on. (There > aren't even any LaTeX fragments.) > > - My org-persist-dir is 627MB in size. What is your (length org-persist--index) ? Also, it does not look like your `org-element-ast-map' is compiled. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at