[O] [PATCH] * org-publish.el (org-publish-find-date): optimization

2011-04-19 Thread Manuel Giraud
Hi,

elp reports important speed gain with this patch to find an org file date.

---
 lisp/org-publish.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index e944eea..7470ee2 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -852,7 +852,7 @@ system's modification time.
 It returns time in `current-time' format.
   (let ((visiting (find-buffer-visiting file)))
 (save-excursion
-  (switch-to-buffer (or visiting (find-file file)))
+  (switch-to-buffer (or visiting (find-file-noselect file nil t)))
   (let* ((plist (org-infile-export-plist))
 (date (plist-get plist :date)))
(unless visiting
-- 
1.7.3.5




Re: [O] [PATCH] * org-publish.el (org-publish-find-date): optimization

2011-04-19 Thread Bernt Hansen
Manuel Giraud manuel.gir...@univ-nantes.fr writes:

 Hi,

 elp reports important speed gain with this patch to find an org file date.

Hi Manual,

It would be useful to post the elp results too so we can see the
differences before and after your patch.

Regards,
Bernt



Re: [O] [PATCH] * org-publish.el (org-publish-find-date): optimization

2011-04-19 Thread Manuel Giraud
Bernt Hansen be...@norang.ca writes:

 Manuel Giraud manuel.gir...@univ-nantes.fr writes:

 Hi,

 elp reports important speed gain with this patch to find an org file date.

 Hi Manual,

 It would be useful to post the elp results too so we can see the
 differences before and after your patch.

Right. Here there are:

org-publish-find-date-before  100 0.527289  0.0052728900
org-publish-find-date-after   100 0.203770  0.0020377000

Done with:
(dotimes (n 100)
  (org-publish-find-date-before ~/foo.org)
  (org-publish-find-date-after ~/foo.org))

and foo.org is about 300 lines.

-- 
Manuel Giraud