From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Convert README.org to plain text README while installing package Date: Wed, 08 Jun 2022 23:44:38 +0800 Message-ID: <87r13zyxax.fsf@localhost> References: <87leuca7v7.fsf@disroot.org> <87czfopmsd.fsf@gnu.org> <87h74ztshe.fsf@gmx.de> <871qw31ois.fsf@yahoo.com> <878rqb5egg.fsf@localhost> <87czfjs4h4.fsf@localhost> <837d5r5jfb.fsf@gnu.org> <87leu7qkym.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20434"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , luangruo@yahoo.com, michael.albinus@gmx.de, acm@muc.de, stefan@marxist.se, tsdh@gnu.org, akib@disroot.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 08 17:45:26 2022 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 1nyxs5-00056L-Rh for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jun 2022 17:45:25 +0200 Original-Received: from localhost ([::1]:36746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyxs4-0002pb-9N for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jun 2022 11:45:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyxqn-0001Mg-Kz for emacs-devel@gnu.org; Wed, 08 Jun 2022 11:44:05 -0400 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:54099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyxqm-000670-12; Wed, 08 Jun 2022 11:44:05 -0400 Original-Received: by mail-pj1-x1030.google.com with SMTP id a10so18931390pju.3; Wed, 08 Jun 2022 08:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=QAc342CvHy94gjQiOxqUeGwp1X3kJtlkNSOmSBDks3I=; b=cEBHep/bF1mRUquOho+1eidAx0zwMw5na1829g/lbEaGNR3EXAh7qqiYNzeWhq5ce7 2FHfw1lxWctltQMWhFbLXAni2kzzaQk/aWlwU/sfVshqUPis5/8MMc0AJJgE1fGaZqOz zyHgYC780N3xHWvJuJohypVERs/qf7e0AZJku6kB5T2iWL2brsH8kSlIYgwU1NweHQ3R M9bjcl9M4ZJWXHum1UrMyC3U6zyZJvcmh0kolzW3OH3yZljm5Eu4fI83AS24OQ+IhUDp xIf3QKfHEtwJrmjnup+mrRiCUoI4KybwtrEioEoM6PSwCnhpNTCulQd7VT4YvBapFT/F wqtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=QAc342CvHy94gjQiOxqUeGwp1X3kJtlkNSOmSBDks3I=; b=onJJWCj5LqO9V/uFwEBPhmqunQ4S/kQXKnDh1VblEWC4Vs1SqOA3ODrYp6QlxprOoo XpQCcJurvpF+4ki6Oe+xdhSBLcxHXothfzHP3s+hoAHhiqy0bzbj5Vor7qKB8WZK8onE gJijtWYigEBndroqE8rhgQEv9chBti08jYTYEOaXAzo9o0gWUr6b+rlzR5jGcIBoSVG/ dfkFKnLCqhVf2tOLMt1Wdqcceuoux2nICLBDV+303X0R1xGKNSRlVblpYXVROvtTRG/S LtiX4qABJ7A1vYfsCufWala1vnW6vwCZezFkt0gqvzXfgA5yfriLaiZgi4UuEp/s1YrE Y5gw== X-Gm-Message-State: AOAM532N1RApz6aSgTLe7e5Px+J1/uBCs2FUB7un5cQuTljDeP4Fm5c4 KWJLlK0RNSXHYyQ+VZHiTPtmO3ioezFHSA== X-Google-Smtp-Source: ABdhPJyQBWkxUZQNFs8KaCi8lgWqLtpSjwjOsd0EdhJffj3iP+EOhOlfjOEFE0spXXkNGCZ0/dDZww== X-Received: by 2002:a17:90b:3845:b0:1e2:e175:be04 with SMTP id nl5-20020a17090b384500b001e2e175be04mr38212504pjb.50.1654703042134; Wed, 08 Jun 2022 08:44:02 -0700 (PDT) Original-Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id ru12-20020a17090b2bcc00b001cb6527ca39sm16908318pjb.0.2022.06.08.08.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 08:44:01 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:290944 Archived-At: Stefan Monnier writes: >>> Which, btw, yet another problem: why does loading Org produce so much >>> garbage? Can this be kept in check somehow? >> >> AFAIU, so much garbage is produced simply because nobody looked into >> memory usage. It is not the easiest thing to track in Emacs. >> >> Can it be kept in check? Maybe. We need to identify first which parts >> are taking excess memory. org-link-set-parameters appears to be one of >> the bottlenecks. I do not know any others. > > w.r.t spending time in the GC, since the GC is run based on the amount > of memory that has been allocated (as opposed to the amount of garbage > generated, for example. which we sadly can't know in advance), the "mem" > profiler (aka `M-x profilter-start RET mem RET`) can be very useful > since it does a sampling-based profiling where the "time" is measured in > number of byte allocated (or some approximation thereof). I know the 'mem profiler. It can help in some cases. That's how I noticed org-link-set-parameter. However, here is one recent memory profiler report: 1,307,745,624 23% - org-persist-load 1,307,726,070 23% - org-persist-read 1,281,385,671 22% - seq-find 1,281,385,671 22% - seq-do 1,281,385,671 22% - mapc 1,281,385,671 22% - # 1,281,385,671 22% - # 1,281,385,671 22% - run-hook-with-args-until-success 333,712 0% + org-element--cache-persist-before-read Unless I misinterpret things, run-hook-with-args-until-success is allocating memory. However, that hook contains a single function which is not allocating much according to the profiler. Moreover, I know myself that the actual memory allocation is done down in org-perist-read when running (read (current-buffer)). I got memory profiler wrong significant amount of time to learn not to trust it too much. cpu profiler is a bit more robust in this regard. At least not until I C-g in the middle of the profiling. Best, Ihor