emacs-devel
[Top][All Lists]
Advanced

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

Re: Explain syntax-ppss-stats please


From: Lennart Borgman (gmail)
Subject: Re: Explain syntax-ppss-stats please
Date: Sun, 06 Apr 2008 03:25:17 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Stefan Monnier wrote:
I do not understand the use of syntax-ppss-stats at all. Where is it used?
(I can only see that the 5:th element is read.) How does it work?

Only the 5th element is really used.  The rest was added there during
development to tune the algorithm.  It could be removed.

Thanks. I still believe too much in magic. I thought something strange was going on somewhere behind the scenes.

Maybe this could be told in the code and the lines changing the other elements commented out?


As for the 5th element it's used to keep track of the average size of
a "defun", so as to know whether to use the closest cache location, or
to try and find a closer location with syntax-begin-function: if the
closest cache location is 100KB earlier and syntax-begin-function
usually finds a safe point within 10KB, we're better off calling
syntax-begin-function (when tho it'll typically take a while itself)
than running parse-partial-sexp on the 100KB.  But OTOH if
syntax-begin-function usually needs to look back 200KB to find a safe
spot, then just the call to syntax-begin-function might take us longer
than just running parse-partial-sexp on the 100KB.

Thanks, this was helpful.




reply via email to

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