Function: cperl-time-fontification

cperl-time-fontification is an interactive and byte-compiled function defined in cperl-mode.el.gz.

Signature

(cperl-time-fontification &optional L STEP LIM)

Documentation

Times how long it takes to do incremental fontification in a region.

L is the line to start at, STEP is the number of lines to skip when doing next incremental fontification, LIM is the maximal number of incremental fontification to perform. Messages are accumulated in
*Messages* buffer.

May be used for pinpointing which construct slows down buffer fontification: start with default arguments, then refine the slowdown regions.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cperl-mode.el.gz
(defun cperl-time-fontification (&optional l step lim)
  "Times how long it takes to do incremental fontification in a region.
L is the line to start at, STEP is the number of lines to skip when
doing next incremental fontification, LIM is the maximal number of
incremental fontification to perform.  Messages are accumulated in
*Messages* buffer.

May be used for pinpointing which construct slows down buffer fontification:
start with default arguments, then refine the slowdown regions."
  (interactive "nLine to start at: \nnStep to do incremental fontification: ")
  (or l (setq l 1))
  (or step (setq step 500))
  (or lim (setq lim 40))
  (let* ((timems (lambda () (car (cperl--time-convert nil 1000))))
	 (tt (funcall timems)) (c 0) delta tot)
    (goto-char (point-min))
    (forward-line (1- l))
    (cperl-mode)
    (setq tot (- (- tt (setq tt (funcall timems)))))
    (message "cperl-mode at %s: %s" l tot)
    (while (and (< c lim) (not (eobp)))
      (forward-line step)
      (setq l (+ l step))
      (setq c (1+ c))
      (cperl-update-syntaxification (point))
      (setq delta (- (- tt (setq tt (funcall timems)))) tot (+ tot delta))
      (message "to %s:%6s,%7s" l delta tot))
    tot))