From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Elisp native profiler Date: Sat, 29 Sep 2012 17:24:32 +0200 Message-ID: <83626wg8cv.fsf@gnu.org> References: <83zk4egs0w.fsf@gnu.org> <83y5jygrni.fsf@gnu.org> <83haqlgrit.fsf@gnu.org> <837grghqfe.fsf@gnu.org> <836270hq4u.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1348932315 25110 80.91.229.3 (29 Sep 2012 15:25:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2012 15:25:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 29 17:25:20 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1THyuu-0007pB-I3 for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2012 17:25:20 +0200 Original-Received: from localhost ([::1]:53984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THyup-00052L-1s for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2012 11:25:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THyum-00052E-8f for emacs-devel@gnu.org; Sat, 29 Sep 2012 11:25:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THyul-00022z-0F for emacs-devel@gnu.org; Sat, 29 Sep 2012 11:25:12 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:49056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THyuk-00020r-OP for emacs-devel@gnu.org; Sat, 29 Sep 2012 11:25:10 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MB400300ASCE800@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 29 Sep 2012 17:24:30 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MB4003UVASU4950@a-mtaout20.012.net.il>; Sat, 29 Sep 2012 17:24:30 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153709 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Wed, 26 Sep 2012 13:49:57 -0400 > > I typically do: > > emacs -Q > M-x profiler-start RET > C-x C-f src/regexp.c RET > page-down until I get to the end of the buffer, then page-up to the beginning > M-x profiler-report RET > > Verifying that the resulting profile is accurate is rather difficult, > of course, so as long as it looks credible, I assume it's more or > less correct. Is the cpu profile below (obtained with the above recipe) reasonable? Why do functions like scroll-up-command and jit-lock-function appear twice or three times, once under call-interactively, the other time by themselves or under scroll-up? (Should we rename "Automatic GC" like we did with redisplay?) - call-interactively 83 47% - scroll-up-command 43 24% - scroll-up 43 24% - jit-lock-function 40 22% - jit-lock-fontify-now 40 22% - byte-code 40 22% - run-hook-with-args 40 22% - font-lock-fontify-region 40 22% - c-font-lock-fontify-region 40 22% - font-lock-default-fontify-region 38 21% - font-lock-fontify-keywords-region 37 21% - c-font-lock-declarations 28 16% - c-find-decl-spots 28 16% - # 25 14% + c-determine-limit 16 9% looking-at 2 1% + c-parse-state 2 1% + c-forward-decl-or-cast-1 1 0% + c-font-lock-declarators 1 0% + c-cheap-inside-bracelist-p 1 0% + c-backward-sws 1 0% looking-at 2 1% + c-forward-sws 1 0% re-search-forward 3 1% + c-font-lock-enclosing-decls 2 1% + c-font-lock-enum-tail 1 0% + # 1 0% + c-font-lock-complex-decl-prepare 1 0% + # 1 0% + font-lock-fontify-syntactically-region 1 0% - mapc 2 1% + # 2 1% - list 40 22% - read-extended-command 40 22% - completing-read 40 22% - completing-read-default 40 22% read-from-minibuffer 40 22% - scroll-up 20 11% - jit-lock-function 20 11% - jit-lock-fontify-now 20 11% - byte-code 20 11% + run-hook-with-args 20 11% Automatic GC 17 9% + redisplay_internal (C function) 16 9% - scroll-up-command 14 8% + scroll-up 14 8% + jit-lock-function 14 8% + byte-code 6 3% + jit-lock-fontify-now 4 2% + font-lock-fontify-region 1 0%