Gnus development mailing list
 help / color / mirror / Atom feed
From: Jesper Harder <harder@ifa.au.dk>
Subject: Re: Compiled format specs in .newsrc.eld?
Date: Mon, 17 Jun 2002 21:59:33 +0200	[thread overview]
Message-ID: <m3bsa9wuai.fsf@defun.localdomain> (raw)
In-Reply-To: <iluznxtkfqj.fsf@latte.josefsson.org>

jas@extundo.com (Simon Josefsson) writes:

> Jesper Harder <harder@ifa.au.dk> 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)))))




  reply	other threads:[~2002-06-17 19:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-15  0:35 Jesper Harder
2002-06-15 10:00 ` Simon Josefsson
2002-06-15 16:15   ` Jesper Harder
2002-06-15 17:38 ` Kai Großjohann
2002-06-16  2:23   ` Jesper Harder
2002-06-16 10:04     ` Kai Großjohann
2002-06-17 12:13       ` Katsumi Yamaoka
2002-06-17 13:31         ` Kai Großjohann
2002-06-17 14:03           ` Jesper Harder
2002-06-17 14:03           ` Simon Josefsson
2002-06-17 14:09             ` Jesper Harder
2002-06-17 14:17               ` Simon Josefsson
2002-06-17 15:13                 ` Jesper Harder
2002-06-17 15:56                   ` Simon Josefsson
2002-06-17 16:31                     ` Jesper Harder
2002-06-17 16:54                       ` Simon Josefsson
2002-06-17 19:59                         ` Jesper Harder [this message]
2002-06-17 16:25                   ` Kai Großjohann
2002-06-17 15:36                 ` Kai Großjohann
2002-06-17 23:13                 ` Katsumi Yamaoka
2002-06-18  2:12                   ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3bsa9wuai.fsf@defun.localdomain \
    --to=harder@ifa.au.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).