From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Explain syntax-ppss-stats please Date: Sat, 05 Apr 2008 14:53:17 -0400 Message-ID: References: <47F79FFA.2000806@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207421622 1716 80.91.229.12 (5 Apr 2008 18:53:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2008 18:53:42 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 05 20:54:14 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JiDWo-0007PC-0Z for ged-emacs-devel@m.gmane.org; Sat, 05 Apr 2008 20:54:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiDWB-0006AH-54 for ged-emacs-devel@m.gmane.org; Sat, 05 Apr 2008 14:53:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JiDW7-00067v-Gx for emacs-devel@gnu.org; Sat, 05 Apr 2008 14:53:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JiDW6-00065l-NF for emacs-devel@gnu.org; Sat, 05 Apr 2008 14:53:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiDW6-00065d-KA for emacs-devel@gnu.org; Sat, 05 Apr 2008 14:53:30 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JiDW6-0000Vo-B2 for emacs-devel@gnu.org; Sat, 05 Apr 2008 14:53:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0BAB5o90fO+J/WdGdsb2JhbACBXI94ASqYRA X-IronPort-AV: E=Sophos;i="4.25,609,1199682000"; d="scan'208";a="17872531" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 05 Apr 2008 14:53:17 -0400 Original-Received: from pastel.home ([206.248.159.214]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id LWG61917; Sat, 05 Apr 2008 14:53:17 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 576C87F85; Sat, 5 Apr 2008 14:53:17 -0400 (EDT) In-Reply-To: <47F79FFA.2000806@gmail.com> (Lennart Borgman's message of "Sat, 05 Apr 2008 17:51:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94430 Archived-At: > 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. 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. Stefan