From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings Date: Sat, 21 Mar 2015 14:05:55 -0700 (PDT) Message-ID: References: <86twxf68zk.fsf@yandex.ru> <83384zwxdx.fsf@gnu.org> <550C3218.4000903@yandex.ru> <831tkjww0y.fsf@gnu.org> <550C3AB9.7020403@yandex.ru> <83wq2bveq6.fsf@gnu.org> <550C491A.6000909@yandex.ru> <83siczvcss.fsf@gnu.org> <550C504A.10708@yandex.ru> <83r3sjva0q.fsf@gnu.org> <550C6A06.6040203@yandex.ru> <83fv8zv0b1.fsf@gnu.org> <550C990B.8080505@yandex.ru> <838ueqvl1o.fsf@gnu.org> <550DCDEE.4090900@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1426972044 465 80.91.229.3 (21 Mar 2015 21:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2015 21:07:24 +0000 (UTC) Cc: 20154@debbugs.gnu.org To: Dmitry Gutov , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 22:07:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZQbt-0006TQ-By for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 22:07:09 +0100 Original-Received: from localhost ([::1]:48979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQbs-0004Pu-Do for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 17:07:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQbp-0004Pn-4J for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:07:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZQbl-0002j3-Tq for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:07:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQbl-0002iz-QV for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZQbl-0000LE-JY for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2015 21:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20154 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20154-submit@debbugs.gnu.org id=B20154.14269719641237 (code B ref 20154); Sat, 21 Mar 2015 21:07:01 +0000 Original-Received: (at 20154) by debbugs.gnu.org; 21 Mar 2015 21:06:04 +0000 Original-Received: from localhost ([127.0.0.1]:60099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQap-0000Js-TO for submit@debbugs.gnu.org; Sat, 21 Mar 2015 17:06:04 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:18105) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQan-0000JM-I9 for 20154@debbugs.gnu.org; Sat, 21 Mar 2015 17:06:02 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t2LL5rHr025684 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 21 Mar 2015 21:05:54 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t2LL5rnW015265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 21 Mar 2015 21:05:53 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t2LL5rxK018038; Sat, 21 Mar 2015 21:05:53 GMT In-Reply-To: <550DCDEE.4090900@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100761 Archived-At: > > I think the latest tendency is the opposite: move to Lisp everything > > that doesn't need to be in C. >=20 > Yes, and often that's great, if we're dealing with some piece of UI > infrastructure that only gets called at most a few times per command, > with inputs of size we can anticipate in advance. (FYI, I'm not following this thread.) I will just say that if you want or need to have something like `json-encode-string' be coded in C for speed, an alternative might be for the actual code to invoke a Lisp function when bound to a variable, e.g., `json-encode-string-function'. That is, it can be OK to define something like the default encoding of JSON in C, but perhaps you can give users the possibility of optionally providing their own encoding Lisp function as well. What would, I think, be too bad would be to make it impossible or difficult for users to provide their own encoding function (without messing with C and rebuilding Emacs).