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: Wed, 26 Sep 2012 21:31:55 +0200 Message-ID: <83zk4cfums.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 1348687986 18009 80.91.229.3 (26 Sep 2012 19:33:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2012 19:33:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 26 21:33:11 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 1TGxM6-0003Ju-RV for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2012 21:33:11 +0200 Original-Received: from localhost ([::1]:34525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGxM1-0004zK-SA for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2012 15:33:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGxLz-0004z3-3E for emacs-devel@gnu.org; Wed, 26 Sep 2012 15:33:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGxLv-0005bz-29 for emacs-devel@gnu.org; Wed, 26 Sep 2012 15:33:02 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:57224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGxLu-0005bn-Pe for emacs-devel@gnu.org; Wed, 26 Sep 2012 15:32:58 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAZ00L00278BM00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Wed, 26 Sep 2012 21:31:58 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAZ00KLE298VED0@a-mtaout22.012.net.il>; Wed, 26 Sep 2012 21:31:56 +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.172 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:153599 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Wed, 26 Sep 2012 13:49:57 -0400 > > >> I didn't say we should prevent users of other platforms from enjoying > >> this feature. But if this will be in 24.3, someone, probably myself, > >> will need to add the missing pieces to get it working on Windows. > > > Btw, is it possible to have a simple test case, starting from "emacs -Q", > > to check that the profiling (both cpu and memory) works? That would > > simplify testing of this on MS-Windows. > > 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 (I presume that was regex.c, not regexp.c.) Thanks for the recipe. > 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. Can you show your results, for the reference? The first lines in what I got (still only the memory profiler, the itimer code is in the works and not ready yet) look suspicious to me in the last column: + call-interactively 46,352,691 2% + Automatic Redisplay 30,389,586 -1% + scroll-up-command 24,834,342 2% + jit-lock-function 20,082,147 0% + scroll-up 15,687,351 3% + jit-lock-fontify-now 2,196,032 1% + byte-code 1,426,989 1% + read-from-minibuffer 312,804 0% + run-hook-with-args 237,005 0% (Overflow?) Here's the same with the + signs expanded: - call-interactively 46,352,691 2% - scroll-up-command 43,373,729 0% - scroll-up 43,373,729 0% - jit-lock-function 41,648,995 0% - jit-lock-fontify-now 41,648,995 0% - byte-code 41,619,059 0% - run-hook-with-args 41,619,059 0% - font-lock-fontify-region 41,619,059 0% - c-font-lock-fontify-region 41,619,059 0% - font-lock-default-fontify-region 40,842,125 -1% - font-lock-fontify-keywords-region 39,963,822 -2% - c-font-lock-declarations 34,602,780 1% - c-find-decl-spots 34,602,780 1% + # 28,867,024 -2% looking-at 2,817,588 1% re-search-forward 1,791,738 1% - c-forward-sws 413,348 0% looking-at 355,304 0% put-text-property 26,844 0% - c-beginning-of-current-toke 150,676 0% looking-at 150,676 0% - c-beginning-of-macro 66,408 0% looking-at 66,408 0% - c-backward-sws 39,468 0% c-beginning-of-macro 12,480 0%