[gnus git] branch master updated: m0-7-97-g4787623 =1= Speed up table rendering at bit
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 478762305b43bc50207eb971ba106b6931455f0b (commit)
from 6ef0ffdc7ea83a4a06849bc560e282aca5222c51 (commit)
- Log -----------------------------------------------------------------
commit 478762305b43bc50207eb971ba106b6931455f0b
Author: Lars Magne Ingebrigtsen <[email protected]>
Date: Sun Jun 16 21:42:07 2013 +0200
Speed up table rendering at bit
* shr.el (shr-make-table): Cache the table rendering at the table
level, and not the <td> level. This is a bit faster.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 004b5a3..6c3febf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2013-06-16 Lars Magne Ingebrigtsen <[email protected]>
+ * shr.el (shr-make-table): Cache the table rendering at the table
+ level, and not the <td> level. This is a bit faster.
+
* eww.el (eww-render): Go to the correct ID when given URLs ending with
#id.
diff --git a/lisp/shr.el b/lisp/shr.el
index 53f6e0c..339b969 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -1410,6 +1410,13 @@ ones, in case fg and bg are nil."
widths))
(defun shr-make-table (cont widths &optional fill)
+ (or (cadr (assoc (list cont widths fill) shr-content-cache))
+ (let ((data (shr-make-table-1 cont widths fill)))
+ (push (list (list cont widths fill) data)
+ shr-content-cache)
+ data)))
+
+(defun shr-make-table-1 (cont widths &optional fill)
(let ((trs nil))
(dolist (row cont)
(when (eq (car row) 'tr)
@@ -1443,19 +1450,6 @@ ones, in case fg and bg are nil."
(setq style (nconc (list (cons 'color fgcolor)) style)))
(when style
(setq shr-stylesheet (append style shr-stylesheet)))
- (let ((cache (cdr (assoc (cons width cont) shr-content-cache))))
- (if cache
- (progn
- (insert (car cache))
- (let ((end (length (car cache))))
- (dolist (overlay (cadr cache))
- (let ((new-overlay
- (shr-make-overlay (1+ (- end (nth 0 overlay)))
- (1+ (- end (nth 1 overlay)))))
- (properties (nth 2 overlay)))
- (while properties
- (overlay-put new-overlay
- (pop properties) (pop properties)))))))
(let ((shr-width width)
(shr-indentation 0))
(shr-descend (cons 'td cont)))
@@ -1466,9 +1460,6 @@ ones, in case fg and bg are nil."
(skip-chars-backward " \t\n")
(end-of-line)
(point)))
- (push (list (cons width cont) (buffer-string)
- (shr-overlays-in-region (point-min) (point-max)))
- shr-content-cache)))
(goto-char (point-min))
(let ((max 0))
(while (not (eobp))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 3 +++
lisp/shr.el | 43 +++++++++++++++++--------------------------
2 files changed, 20 insertions(+), 26 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project