From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45293 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.gnus.general Subject: Re: Compiled format specs in .newsrc.eld? Date: Mon, 17 Jun 2002 21:59:33 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024344489 18139 127.0.0.1 (17 Jun 2002 20:08:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2002 20:08:09 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17K2nJ-0004iL-00 for ; Mon, 17 Jun 2002 22:08:09 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17K2iI-00075n-00; Mon, 17 Jun 2002 15:02:58 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 17 Jun 2002 15:03:17 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA06408 for ; Mon, 17 Jun 2002 15:03:04 -0500 (CDT) Original-Received: (qmail 20529 invoked by alias); 17 Jun 2002 20:02:36 -0000 Original-Received: (qmail 20524 invoked from network); 17 Jun 2002 20:02:36 -0000 Original-Received: from pfepb.post.tele.dk (193.162.153.3) by gnus.org with SMTP; 17 Jun 2002 20:02:36 -0000 Original-Received: from defun.localdomain (0xc3f98274.esnxr3.ras.tele.dk [195.249.130.116]) by pfepb.post.tele.dk (Postfix) with ESMTP id 846435EED87 for ; Mon, 17 Jun 2002 22:02:31 +0200 (CEST) Original-To: ding@gnus.org Original-Lines: 87 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45293 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45293 jas@extundo.com (Simon Josefsson) writes: > Jesper Harder writes: > >> I wasn't really sure whether the manual or the code was wrong about saving >> format specs -- I can think of two good reasons for not saving them: >> >> * It doesn't really matter. >> * Byte-code isn't portable between Emacs and XEmacs. > > Yup. Is the manual correct below? I think this part is wrong: | This will result in the new specs being byte-compiled, and you'll | get top speed again. Gnus will save these compiled specs in the | `.newsrc.eld' file. It's true that if you run `gnus-compile', Gnus will save the byte compiled values in newsrc.eld. But if I * Run `gnus-compile' * Quit Gnus then at this stage the byte-compiled values are in .newsrc.eld. But if I * Start Gnus again, and quit. then the byte-compiled values in newsrc.eld have been replaced with the uncompiled values. So, it appears that if you want the specs to be byte-compiled, you need (gnus-compile) in .gnus. This is probably a bug -- but I don't understand what's going on. > Does Gnus byte-compile format-specs by default internally? I'm not sure any more. I was probably wrong, because I looked at the global value of `gnus-summary-line-format-spec', but I think the buffer local value is actually used when generating the summary-buffer. > Perhaps we should remove gnus-format-specs from gnus-variable-list > completely. If there is no speed gain in M-x gnus-compile I vote for > removing it. I think someone else should also try to verify whether `gnus-compile' makes a big difference. The difference I'm measuring is the smaller than the variance. But I'm a bit suspicious about the results -- I would have expected it to make a much bigger difference. BTW, I'm using this method to profile it -- it times how long it takes to show the oldest 10.000 messages from comp.text.tex (I don't do expiry on the server, so they're always the same): (defun gnus-profile () (interactive) (let (t1 t2 no (sum 0) (avg 0)) (gnus) (sit-for 1) (dotimes (i 5) (gnus-group-jump-to-group "comp.text.tex") (garbage-collect) (sit-for 1) (setq t1 (float-time)) (gnus-topic-select-group -10000) (setq t2 (float-time)) (add-to-list 'no (- t2 t1)) (sit-for 1) (gnus-summary-exit) (sit-for 1)) (gnus-group-exit) (switch-to-buffer (get-buffer-create "gnus-profile")) (dolist (i no) (insert (format "%f " i)) (setq sum (+ sum i))) (insert (format "\nSum: %f \n" sum)) (setq avg (/ sum (length no))) (insert (format "Avg: %f \n" avg)) (insert (format "Var: %f \n" (varians no))))) (defun varians (d) (let ((avg (/ (apply '+ d) (length d))) (tmp 0)) (dolist (x d) (incf tmp (expt (- x avg) 2))) (sqrt (/ tmp (- (length d) 1)))))