From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings Date: Fri, 20 Mar 2015 18:21:46 +0200 Message-ID: <550C491A.6000909@yandex.ru> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1426868553 2043 80.91.229.3 (20 Mar 2015 16:22:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 16:22:33 +0000 (UTC) Cc: 20154@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 20 17:22:22 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 1YYzga-00043j-GH for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 17:22:12 +0100 Original-Received: from localhost ([::1]:44700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzgZ-0005oM-Lq for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 12:22:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzgU-0005lV-W6 for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:22:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYzgQ-000450-DA for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:22:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzgQ-00044v-Aj for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YYzgP-0001e4-Tw for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Mar 2015 16:22: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.14268685166314 (code B ref 20154); Fri, 20 Mar 2015 16:22:01 +0000 Original-Received: (at 20154) by debbugs.gnu.org; 20 Mar 2015 16:21:56 +0000 Original-Received: from localhost ([127.0.0.1]:59303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYzgK-0001dm-8T for submit@debbugs.gnu.org; Fri, 20 Mar 2015 12:21:56 -0400 Original-Received: from mail-we0-f180.google.com ([74.125.82.180]:33830) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYzgI-0001dX-3R for 20154@debbugs.gnu.org; Fri, 20 Mar 2015 12:21:54 -0400 Original-Received: by wegp1 with SMTP id p1so86018841weg.1 for <20154@debbugs.gnu.org>; Fri, 20 Mar 2015 09:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=sdenkB+voBeJYJ6L5ovkt/dDBSWx55fWvr0GTMrxRXg=; b=TbhuVuympXy54pCuZIleM0fn6qPaLQnwR/fZ9Ja+zc9s8O4xtpchGCZMbxZ9L8mh4r cag6tG8IiagvJUNUxMoBv8zFLnPf43zp64gPBP8arB4sOh7UJVvJniLBnk4ptEc9qCWp loHDDaM7PrkkteU3hANSsu2fAZdY7yDGtd4bEIgIf7AK8e3tozVUmlPnYpawjXSE2pLU mu+zCDrli1atmp8cI2bhyrFqQpwa3aHBMBrTc2OU4MgO56x+6NdzGwRHzwUWr5EM4r+K Hfvgw+2oF9ovjnK3+9XTS8rFSLc+bj53VXceqeCy1meMpDaD9X0kbrDcq1eGNIz5k2Gl 5S1g== X-Received: by 10.180.104.66 with SMTP id gc2mr26019636wib.34.1426868508235; Fri, 20 Mar 2015 09:21:48 -0700 (PDT) Original-Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id fo8sm3651204wib.14.2015.03.20.09.21.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 09:21:47 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: <83wq2bveq6.fsf@gnu.org> 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:100709 Archived-At: On 03/20/2015 06:02 PM, Eli Zaretskii wrote: > I have other things on my plate while I read email. If my advice > bothers you, I can shut up in the future. Very well. Please continue with the advice. > I suggest to rewrite json-encode-char, it does a lot of unnecessary > stuff, starting with the call to encode-char (which was needed in > Emacs 22 and before, but no more). The call to rassoc is also > redundant, since you already have that covered in your regexp. Yes, I thought about that, but as the number of calls to `json-encode-char' must have decreased by 10 in the new version (only each 10th character needs to be encoded), and the runtime only decreased by 3 (or by 2, in a different example I have), the total improvement can't be dramatic enough even if `json-encode-char' is lightning-fast.