From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "T. V. Raman" Newsgroups: gmane.emacs.devel Subject: Re: json.el speed-ups Date: Tue, 7 Oct 2008 20:21:11 -0700 Message-ID: <18668.10023.696533.317409@gargle.gargle.HOWL> References: <18667.25652.771618.151560@gargle.gargle.HOWL> Reply-To: raman@users.sf.net NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223436096 12739 80.91.229.12 (8 Oct 2008 03:21:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 03:21:36 +0000 (UTC) Cc: emacs-devel@gnu.org, raman@users.sourceforge.net To: monnier@IRO.UMontreal.CA Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 08 05:22:33 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 1KnPd4-0006vo-7v for ged-emacs-devel@m.gmane.org; Wed, 08 Oct 2008 05:22:26 +0200 Original-Received: from localhost ([127.0.0.1]:47796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnPc0-00043O-5h for ged-emacs-devel@m.gmane.org; Tue, 07 Oct 2008 23:21:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnPbv-00041Z-1A for emacs-devel@gnu.org; Tue, 07 Oct 2008 23:21:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnPbu-00040n-CV for emacs-devel@gnu.org; Tue, 07 Oct 2008 23:21:14 -0400 Original-Received: from [199.232.76.173] (port=59147 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnPbu-00040e-7C for emacs-devel@gnu.org; Tue, 07 Oct 2008 23:21:14 -0400 Original-Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:50107) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnPbt-0007ha-NK for emacs-devel@gnu.org; Tue, 07 Oct 2008 23:21:14 -0400 Original-Received: from OMTA04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id Pu3E1a0380lTkoCA63MCsj; Wed, 08 Oct 2008 03:21:12 +0000 Original-Received: from localhost ([71.202.191.236]) by OMTA04.emeryville.ca.mail.comcast.net with comcast id Q3MB1a00T56Ur8v8Q3MCiU; Wed, 08 Oct 2008 03:21:12 +0000 X-Authority-Analysis: v=1.0 c=1 a=2z1OXlWFAAAA:8 a=oyMoC-GC1KLtVNPDUR8A:9 a=RxA5_pFzXGVOkkasCwiuRxFvLGkA:4 a=MSl-tDqOz04A:10 a=WN8zLioqDSwA:10 Original-Received: by localhost (Postfix, from userid 1000) id CEF3312A4102; Tue, 7 Oct 2008 20:21:11 -0700 (PDT) In-Reply-To: X-Mailer: VM alpha-479 under Emacs 23.0.60.1 (i686-pc-linux-gnu) x-attribution: tvr X-detected-operating-system: 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:104409 Archived-At: Yes, the \b should be added as you suggest to be equivalent. Eventually I think json.el should be sped up by creating a json specific syntax table. This would help enormously in things like parsing numbers etc; for now, json-read-number loops through each char making up the number. As does json-read-keyword, and many other functions. >>>>> "Stefan" == Stefan Monnier writes: >> I've been using the following mods to json.el with good >> results, am attaching diff output. Stefan> Stefan> Please use unified diffs (or context diffs). Stefan> >> < (forward-char n)) >> --- >>> (unless n (setq n 1)) (let ((goal (+ (point) n))) >>> (goto-char goal) (when (< (point) goal) (signal >>> 'end-of-file nil)))) Stefan> Stefan> That looks OK, as long as the code doesn't catch Stefan> `end-of-file' or `end-of-buffer' explicitly Stefan> elsewhere. Stefan> >> 144c147,148 < (skip-syntax-forward " ")) >> --- >>> (while (looking-at "[\t\r\n\f\b ]") (goto-char (match-end >>> 0)))) Stefan> Stefan> Using (skip-chars-forward "\t\r\n\f\b ") would make Stefan> the diff more obviously correct. Have you checked Stefan> that all those chars have the "whitespace" syntax in Stefan> the syntax-table? Stefan> Stefan> Stefan> Stefan -- Best Regards, --raman Email: raman@users.sf.net WWW: http://emacspeak.sf.net/raman/ AIM: emacspeak GTalk: tv.raman.tv@gmail.com PGP: http://emacspeak.sf.net/raman/raman-almaden.asc Google: tv+raman IRC: irc://irc.freenode.net/#emacs