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 16:43:36 +0200 Message-ID: <550C3218.4000903@yandex.ru> References: <86twxf68zk.fsf@yandex.ru> <83384zwxdx.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 1426862671 26411 80.91.229.3 (20 Mar 2015 14:44:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 14:44:31 +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 15:44:14 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 1YYy9i-0004o0-Q2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 15:44:11 +0100 Original-Received: from localhost ([::1]:44199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYy9i-0004bX-9G for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 10:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYy9d-0004Xq-7J for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 10:44:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYy9Z-0007B4-VV for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 10:44:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYy9Z-0007Az-T7 for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 10:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YYy9Z-0007jT-Iv for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 10:44: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 14:44: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.142686262729697 (code B ref 20154); Fri, 20 Mar 2015 14:44:01 +0000 Original-Received: (at 20154) by debbugs.gnu.org; 20 Mar 2015 14:43:47 +0000 Original-Received: from localhost ([127.0.0.1]:59255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYy9L-0007iu-Cv for submit@debbugs.gnu.org; Fri, 20 Mar 2015 10:43:47 -0400 Original-Received: from mail-wi0-f170.google.com ([209.85.212.170]:35609) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYy9J-0007ih-95 for 20154@debbugs.gnu.org; Fri, 20 Mar 2015 10:43:45 -0400 Original-Received: by wibdy8 with SMTP id dy8so18925591wib.0 for <20154@debbugs.gnu.org>; Fri, 20 Mar 2015 07:43:39 -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=BgulrS5fQkbkaMtMI8doP0rGyIVpV3Gp9Kzx1dsb+Hw=; b=yCnet5HAZZTHB8GTfE9OQzzCJh2sWgcHUNmofW7lESHN5mIGyl6ugKo7SCwsmq+QyI Q0ApkbX9UGFl9bN1pScR6585xEgFZ+WQomnVKnlZA937aIR60Dej9vx+3ny9GPdLaXXg IFCYKr7ADz7pkDmx7KrwBZYDg3pnMd0qJYTssezixQfBcDN3xUAxE9Xivfhg/8wMYkr+ UsDVfNtztzrdWLGMO86j/MYoF1EE7AleRNOJ7oGRqMuVWjlVFL2RYxI5VfFNvLSIrkjA CbpU9K2FJsk46VmdbjZzfhvfb3DFjFnnkTSzMxNwiig9eZ7/hpn4+VfdxKAxZ/Oi7D6Q l2AA== X-Received: by 10.194.121.68 with SMTP id li4mr162638588wjb.138.1426862619595; Fri, 20 Mar 2015 07:43:39 -0700 (PDT) Original-Received: from [192.168.1.3] ([82.102.93.54]) by mx.google.com with ESMTPSA id hl8sm6638594wjb.38.2015.03.20.07.43.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 07:43:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: <83384zwxdx.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:100700 Archived-At: On 03/20/2015 04:34 PM, Eli Zaretskii wrote: > I suggest to start with a detailed profile of the current > implementation, Any suggestions there? By the way, I've included the example, so you can also profile it yourself. Here's the output of the built-in profiler, after using the current implementation: CPU: - command-execute 1147 79% - call-interactively 1147 79% - funcall-interactively 1082 74% - eval-last-sexp 1035 71% - elisp--eval-last-sexp 1035 71% - eval 1035 71% - length 1035 71% - json-encode-string 1035 71% - mapconcat 874 60% json-encode-char 571 39% + execute-extended-command 40 2% + previous-line 7 0% + byte-code 65 4% - ... 298 20% Automatic GC 298 20% Memory: - command-execute 255,362,537 99% - call-interactively 255,362,537 99% - funcall-interactively 255,349,159 99% - eval-last-sexp 248,605,484 97% - elisp--eval-last-sexp 248,605,484 97% - eval 217,011,432 84% - length 217,011,432 84% - json-encode-string 217,011,432 84% - mapconcat 93,689,099 36% json-encode-char 81,784,197 32% format 814 0% elisp--eval-last-sexp-print-value 11,954 0% + elisp--preceding-sexp 2,048 0% + execute-extended-command 6,743,643 2% + previous-line 32 0% + byte-code 13,378 0% + xselect-convert-to-string 176 0% ... 0 0%