From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: Measuring execution time of a function Date: Mon, 24 May 2021 10:35:11 +0200 Message-ID: References: <83cztij5ky.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000050a63005c30f4a55" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18258"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 24 10:36:20 2021 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 1ll64R-0004Xy-L9 for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 10:36:19 +0200 Original-Received: from localhost ([::1]:51286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll64Q-0006l5-LK for ged-emacs-devel@m.gmane-mx.org; Mon, 24 May 2021 04:36:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll63c-000603-30 for emacs-devel@gnu.org; Mon, 24 May 2021 04:35:28 -0400 Original-Received: from mail-ua1-x92a.google.com ([2607:f8b0:4864:20::92a]:43941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ll63Z-0007KX-OB; Mon, 24 May 2021 04:35:27 -0400 Original-Received: by mail-ua1-x92a.google.com with SMTP id f1so9063776uaj.10; Mon, 24 May 2021 01:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7n4CIslvf1avrItKt8vtEdBo4uWiSX1fEuC5bv8953Y=; b=Z+fLZ64jkQZ/6XdyilaIYbGBm+YA1NIAkuyX0qjvx/qYXk9mGRAT2a+PnmidJC0gI8 Y4XOlr8wpt/JkYzg+RsjuQcYWcdQ3prwPrhfjge2zAENYaH6ut12Pf2urm2hjQT7+RH9 siwWVodJ5mUX0TjXkTrFZA6tLbUrLRwgv8YwwLhe4TIx/jKztT0WV0FZnjREoAdYKwg/ gT4Trvq7Q+r/hozvV87zqk6NVmkkPrWdFwk6IV0r9ACUPDyIqKVi7nSQ5J3+02aR0N5K RlksVdl3h/6Lo8Oz2Hn23DJ+r0XivBKKB/vhnqeBhan/JQTvl/VjAdwQKVnnid+ganwI C9Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7n4CIslvf1avrItKt8vtEdBo4uWiSX1fEuC5bv8953Y=; b=IUdmvYcxl7/h6AaTlUVc2wl1za2wVxlsSrVUaVaXq2p2GApI40REuAZOydah+sPvGU Qq8St1Kh9ARPEGcAdN7PbEakk490DQcACsDpKHle16T2ZfsLF5Msp6yn2t2Ek3AwZuQi rPfagwbLvXT37SrhtYim2VV78+B0eVdZxdDdBLPaCRkxtVvtdxhoxaF7mXp5LHPRuPBq EB21IYLr5mpz4h2YqLH9H/S26hGuOVpFbq5B/Yq/uhmqYnI48BGu6X4QaMWGdOQcnrRW O/DCcSYrak64RmdLh6CA+Po5JU8FTszL6YSMQ/bwNNwJIbYFoeGcamNUiLoUVRI/5zN5 rCaA== X-Gm-Message-State: AOAM533PkSCG5oTAEIwawkdomLWtAzaO9cRUKiPcjc4ymf/8rbArJi0f pPXA9eMpeB6Tty3AUEOYXHK8zbfP15E3LWL4/88= X-Google-Smtp-Source: ABdhPJzIfLTMDZrUlC/s0gDhX1aZtEO3VNUQGWYCSsDJxY7krvXIMHyLoJD4BMyP4DGgPzZEl8NlqFVGsgFqJsyr0z8= X-Received: by 2002:ab0:1523:: with SMTP id o32mr21192088uae.16.1621845322277; Mon, 24 May 2021 01:35:22 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::92a; envelope-from=dalanicolai@gmail.com; helo=mail-ua1-x92a.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, HTML_MESSAGE=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.23 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:269736 Archived-At: --00000000000050a63005c30f4a55 Content-Type: text/plain; charset="UTF-8" Great thanks! Now I could 'track down' `benchmark` and `benchmark-run`... And also I have Drew's info-apropos command now to search in multiple manuals at once, so now `info-apropos "timing" would lead me to this answer also (if I select the right manuals). On Sun, 23 May 2021 at 17:42, Stefan Monnier wrote: > > I used > > [the macro posted here]( > > > https://stackoverflow.com/questions/23622296/emacs-timing-execution-of-function-calls-in-emacs-lisp > > ) > > to time it. I would vote for adding that macro to Emacs b.t.w., if there > is > > not > > some hidden alternative command already. > > `benchmark-call` or `benchmark-elapse` should do the trick. > > > Stefan > > --00000000000050a63005c30f4a55 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Great thanks! Now I could 'track down' `bench= mark` and `benchmark-run`...

=C2=A0And also I have= Drew's info-apropos command now to search in multiple manuals at once,=
=C2=A0so now `info-apropos "timing" would lead me to t= his answer also (if I select the right manuals).

On Sun, 23 May 2= 021 at 17:42, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> I used
> [the macro posted here](
> https://stackoverflow.com/questions/23622296/emacs-timing-execution-of-= function-calls-in-emacs-lisp
> )
> to time it. I would vote for adding that macro to Emacs b.t.w., if the= re is
> not
> some hidden alternative command already.

`benchmark-call` or `benchmark-elapse` should do the trick.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--00000000000050a63005c30f4a55--