emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Behavior of Gnus when called from an hyperlink


From: Sébastien Vauban
Subject: [Orgmode] Re: Behavior of Gnus when called from an hyperlink
Date: Fri, 16 Jul 2010 21:51:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Tassilo,

> Tassilo Horn wrote:
>> Sébastien Vauban writes:
>>
>>> I've followed Nick's procedure, hoping to get even more details:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> Function Name                   Call Count Elapsed Time Average Time
>>> ...
>>> gnus-request-head               1           312.993525    312.993525
>>> gnus-activate-group             1           13.587475     13.587475
>>> gnus-group-read-group           1           7.949638      7.949638
>>> ...
>>> --8<---------------cut here---------------end--------------->8---
>>
>> Looks to me that `gnus-request-head' is the culprit. Looking at the code, I
>> cannot see why that function is so slow. I'd try to edebug that to see what
>> exact part of it takes that long.
>
> Sorry to be such a newbie on that, but I'd understood I would have to type
> `C-u C-M-x' (`edebug-defun') when on that function definition, right?
>
> My problem is I can't access the definition, as all of Gnus is only present
> as "byte-compiled" files, located in
>
>     /usr/share/emacs/23.1/lisp/
>
> Is there a way, still, to debug the function, then, the way you intend it?

Thanks to Nick, got access to the sources, and could edebug-defun the function
`gnus-request-head':

--8<---------------cut here---------------start------------->8---
(defun gnus-request-head (article group)
  "Request the head of ARTICLE in GROUP."
  (let* ((gnus-command-method (gnus-find-method-for-group group))
         (head (gnus-get-function gnus-command-method 'request-head t))
         res clean-up)
    (cond
     ;; Check the cache.
     ((and gnus-use-cache
           (numberp article)
           (gnus-cache-request-article article group))
      (setq res (cons group article)
            clean-up t))
     ;; Check the agent cache.
     ((gnus-agent-request-article article group)
      (setq res (cons group article)
            clean-up t))
     ;; Use `head' function.
     ((fboundp head)
      (setq res (funcall head article (gnus-group-real-name group)
                         (nth 1 gnus-command-method))))
     ;; Use `article' function.
     (t
      (setq res (gnus-request-article article group)
            clean-up t)))
    (when clean-up
      (save-excursion
        (set-buffer nntp-server-buffer)
        (goto-char (point-min))
        (when (search-forward "\n\n" nil t)
          (delete-region (1- (point)) (point-max)))
        (nnheader-fold-continuation-lines)))
    res))
--8<---------------cut here---------------end--------------->8---

When stepping with SPC, the "arrow mark" (in the left fringe) stayed 5 mins on
line 487:

--8<---------------cut here---------------start------------->8---
     ;; Use `head' function.
     ((fboundp head)
      (setq res (funcall head article (gnus-group-real-name group)
>                        (nth 1 gnus-command-method))))
                                                    ^
                                                 cursor after first paren
--8<---------------cut here---------------end--------------->8---

If I understand well, it wasted all the time evaluating

--8<---------------cut here---------------start------------->8---
    (nth 1 gnus-command-method)
--8<---------------cut here---------------end--------------->8---

I can't understand anything from the above... Someone does?

Thanks in advance!

Best regards,
  Seb

-- 
Sébastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]