From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Emacs benchmark workload to run and time instead of hunch performance Date: Wed, 09 Jul 2014 12:24:06 +0100 Message-ID: <87vbr66ai1.fsf@robertthorpeconsulting.com> References: <87ha2r1l9r.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1404905092 30679 80.91.229.3 (9 Jul 2014 11:24:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2014 11:24:52 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 09 13:24:45 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1X4pzR-0006f2-3c for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Jul 2014 13:24:45 +0200 Original-Received: from localhost ([::1]:59864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4pzQ-0002Dc-H1 for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Jul 2014 07:24:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4pz3-0002CH-Es for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 07:24:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4pyw-0006Wv-3X for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 07:24:21 -0400 Original-Received: from outbound-smtp06.blacknight.com ([81.17.249.39]:58916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4pyv-0006WF-T9 for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 07:24:14 -0400 Original-Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp06.blacknight.com (Postfix) with ESMTP id 2590B987A7 for ; Wed, 9 Jul 2014 11:24:11 +0000 (UTC) Original-Received: (qmail 18161 invoked from network); 9 Jul 2014 11:24:12 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[77.130.85.223]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 9 Jul 2014 11:24:09 -0000 In-Reply-To: <87ha2r1l9r.fsf@debian.uxu> (message from Emanuel Berg on Wed, 09 Jul 2014 01:30:24 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.39 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98598 Archived-At: Emanuel Berg writes: > Emanuel Berg did write: ... > Not-very-ambitious workload but still: > > (defun bench () > (interactive) > (define-abbrev global-abbrev-table "rsb" "rec.sport.boxing") > (insert "rsb") > (expand-abbrev) > > (insert " 3") > (backward-char 3) > (delete-char 2) > > (buffer-menu) > > (man "ls") > > (beginning-of-buffer) ) > > (progn > (elp-instrument-function 'bench) > (bench) > (elp-results) ) > > Execution times for first invocation: > > emacs -Q: > > bench 1 0.038667778 0.038667778 > > emacs, with tons of configuration: > > bench 1 0.05604648 0.05604648 I get ~0.028 for emacs -Q and ~0.03 using my init file. > Keep calling it I guess it ends up in a cache because > it gets much faster - but the emacs -Q is still faster. That's not the reason. Do (elp-instrument-function 'man). It'll tell you that for the single-run case much of the time is spent in (man "ls"). The Emacs "man" command works by calling the system man command which typesets the man page from it's troff source then pipes it to Emacs. The Emacs man command first checks if the man page is already open in a buffer, if so it just switches to that buffer. So, on the first interation of your benchmark you have the system man program performing typesetting, then on each later iteration it does nothing. To make the benchmark fair you have to kill the man buffer before each run. Of course cache effects still make the benchmark quicker for repeated runs. That's partly because of the processor's cache, but also because Linux's file-system cache will store the man page's source file. (It goes below 0.01 for me). > So the next question is just what configs slows it down > - if there is indeed a difference there... I don't know. Try dividing you init file into two halves. See if the first half or the second half causes the slowdown. When you've found which half it is divide that into halves too, and so on until you've found the culprit. BR, Robert Thorpe