cperl-time-fontification is an interactive compiled Lisp function in `cperl-mode.el'.

(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.