GNU bug report logs - #31138
Native json slower than json.el

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Sebastien Chapuis <sebastien@HIDDEN>; Keywords: moreinfo; dated Thu, 12 Apr 2018 19:15:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Apr 2019 14:27:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 10:27:37 2019
Received: from localhost ([127.0.0.1]:59084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJfLd-0004lP-Kn
	for submit <at> debbugs.gnu.org; Thu, 25 Apr 2019 10:27:37 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:35763)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJfLb-0004lA-2K
 for 31138 <at> debbugs.gnu.org; Thu, 25 Apr 2019 10:27:36 -0400
Received: by mail-wm1-f48.google.com with SMTP id y197so10918764wmd.0
 for <31138 <at> debbugs.gnu.org>; Thu, 25 Apr 2019 07:27:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=kpCwkRr09y6sZk+RK6dBOtX7H2MvB5lGTkttuqk19ds=;
 b=Pcs/IMKjahF70up3vfI84BfkEEOCvsKcyGA8Q7TzPL2raNjmYlkLYxG8BpU2P6oXoo
 0gIPx8IaSVUORQX7gsj2pBzNznpbdannhnsqf3C6PqWo3TAgpP2AlWi+5/JZZrJY3svO
 qpLCmFgZfsOMhoSCSaV5KigEvXAkUHtzb3jve3HhuxeIQOM5PhToqByrrIKRWBDM+kWM
 Geyl6XFDhUfmWQa6dkZ+yybfrHhj4YecYEQ9lZzTvANgSDYUzAYNLVYDTaCRhLrZk7S1
 yl4n6pZSfbE0LU5w/+3TCh7e942Aa48oBOHfQCt1W67/cSEMUF/I163rPufEzKpq6RRc
 73aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=kpCwkRr09y6sZk+RK6dBOtX7H2MvB5lGTkttuqk19ds=;
 b=KfIjwcChWo4gY0Nxscj7M3ANe5NVFqxadYLU2E6GICKTHzwJi65uSXdeANhiu8n9SH
 pWdtUDbgYQzJUZ85KcNo29lzyBVKyVe5ry1VBLgWGAQLi0hArYJ/44izpHEhyrbmWya9
 5axmIlbS10fjwG01XAQc/zdtghckgif/TVlBYYUkWkrY3qvN02hLQu0u6MgT79f9x+dv
 tryXdUxeVtHSfACqXkIlCa7PjZijN/5TUxqjbqafjzjPRUwTjtXOUmB2gwctWqHeUvGY
 q2Hjn3zK677x0hPDN/+A443DJBrP1Q2r2efClQXqGzMk1HxjkN2l6zw55LmhSM99T+jB
 fwcw==
X-Gm-Message-State: APjAAAWvonx/0F+srucJpD1yYUHDuFgX5XesQSuCDljrg+u+Ab7ElwNA
 SiiFn7sB7wlKpel71SOCbtTYQlma
X-Google-Smtp-Source: APXvYqyCg9Y0eG+Y7pmvuu+uTD5Mp5C8RGhwjFKO038LXEBgRHL5H7voJ6emW9PKuEczdqv01D0DhA==
X-Received: by 2002:a1c:a953:: with SMTP id s80mr3820828wme.50.1556202448881; 
 Thu, 25 Apr 2019 07:27:28 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id w10sm6391985wmi.43.2019.04.25.07.27.26
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 25 Apr 2019 07:27:27 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN> <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN> <83wojk534g.fsf@HIDDEN>
 <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN> <83h8ao4vl0.fsf@HIDDEN>
 <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN> <835zr32x2m.fsf@HIDDEN>
 <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN> <831s1r2uzx.fsf@HIDDEN>
 <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN> <83wojj1ep8.fsf@HIDDEN>
 <429a19a3-52aa-02d1-0bd0-77c27c6811d7@HIDDEN> <83lfzyz7np.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <7ff13b50-f728-1e6e-d56d-fc9b5e306b10@HIDDEN>
Date: Thu, 25 Apr 2019 17:27:25 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83lfzyz7np.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 25.04.2019 13:44, Eli Zaretskii wrote:

>>> Why faster?
>>
>> Because the library will perform its validation anyway, during normal
>> execution.
> 
> But if we validate the string before even calling the library, that
> will be even faster, no?

Only if the string is invalid. There's not much point in optimizing for 
that situation, I think.

>> Any extra validation work Emacs performs, will take time on
>> top of that (of course, I don't know how much time).
> 
> Didn't we just establish that it's almost negligible?  Especially for
> short strings?

Probably. But I can't say for sure without seeing the code.

>>> And more importantly, will the error indication be useful enough to
>>> the Lisp program that triggered it?  If we signal an error, we can
>>> make sure of that.
>>
>> We still signal errors if the library returns an error code.
> 
> But we need to guess the reason.

I think I've addressed that in the part of the reply you cut out: "we 
also perform additional validation ourselves if something goes wrong". 
That can be extended, if you like.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Apr 2019 10:44:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 06:44:38 2019
Received: from localhost ([127.0.0.1]:57590 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJbrp-0005VA-Vp
	for submit <at> debbugs.gnu.org; Thu, 25 Apr 2019 06:44:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39401)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJbro-0005Uw-8V
 for 31138 <at> debbugs.gnu.org; Thu, 25 Apr 2019 06:44:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48524)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJbri-0002qM-Sl; Thu, 25 Apr 2019 06:44:30 -0400
Received: from [176.228.60.248] (port=2417 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJbri-0004tC-9X; Thu, 25 Apr 2019 06:44:30 -0400
Date: Thu, 25 Apr 2019 13:44:10 +0300
Message-Id: <83lfzyz7np.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <429a19a3-52aa-02d1-0bd0-77c27c6811d7@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 23:25:32 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN> <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN> <83wojk534g.fsf@HIDDEN>
 <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN> <83h8ao4vl0.fsf@HIDDEN>
 <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN> <835zr32x2m.fsf@HIDDEN>
 <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN> <831s1r2uzx.fsf@HIDDEN>
 <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN> <83wojj1ep8.fsf@HIDDEN>
 <429a19a3-52aa-02d1-0bd0-77c27c6811d7@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Wed, 24 Apr 2019 23:25:32 +0300
> 
> >> Relying on the library is probably faster.
> > 
> > Why faster?
> 
> Because the library will perform its validation anyway, during normal 
> execution.

But if we validate the string before even calling the library, that
will be even faster, no?

> Any extra validation work Emacs performs, will take time on 
> top of that (of course, I don't know how much time).

Didn't we just establish that it's almost negligible?  Especially for
short strings?

> > And more importantly, will the error indication be useful enough to
> > the Lisp program that triggered it?  If we signal an error, we can
> > make sure of that.
> 
> We still signal errors if the library returns an error code.

But we need to guess the reason.

> Anyway, speeding up encoding is not as important as it was with 
> decoding, because at least in this case Lisp programs can control how 
> much data is sent. So let's not spend too much time and effort on it.

OK.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 20:25:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 16:25:45 2019
Received: from localhost ([127.0.0.1]:56594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJOSf-0008D0-8S
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 16:25:45 -0400
Received: from mail-lj1-f169.google.com ([209.85.208.169]:36719)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJOSd-0008Cj-Rh
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 16:25:44 -0400
Received: by mail-lj1-f169.google.com with SMTP id l6so3323758ljb.3
 for <31138 <at> debbugs.gnu.org>; Wed, 24 Apr 2019 13:25:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=adQbGWTpcMRGs2pN24teOaH1EWsaxWmkdA9jvfxL1X0=;
 b=Tl+/4/rgcB2zRTgi7R66cUdNmA4z0Z/siJ9QV+jtNxh+YQm7xGYHzfcmBdX2QHAVW3
 1D9uJL97U4P0k9Jiumcevb4BJLXPGNBzvHdIy+QabQ0noellv3JPGioyBbEIZ2k85jA1
 sPm4ESkkvjEskBS7eLy5CHpV51bSMokhc3uYcVkzXPdgSVx1xYPTNLh6vBVil9cnVzFS
 KucH2UaZ2Aju1NoTsEfmFzukhQtsew4ZufkEB9fUmuwpzGnCzurIUWt3lunAkAb1J8z5
 Vqc8SL3dk5MXEkcZp1mlTcLZwWCltboO0r2uxBM/WjVHy8J0Y1ypQT6TWCZZwVGP9xYr
 aUPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=adQbGWTpcMRGs2pN24teOaH1EWsaxWmkdA9jvfxL1X0=;
 b=JSjiXYXQaQ+o+Aq3zsJYFYk7finnc4rmxobei9bTGnwwg9WZ5g6uk2AIuSpWREHN/l
 P5Ou6IWaIDmtslA07JlAD2QYJtsR61xMNouFXsNElEQz7xEsjwXt+3TAnK3kYMpXZm1r
 KH2fvT6E7DGO54/OZAb6DwKjBPDN9E8/1qIEcaGAfNQvw5c11MJBoCMC+LB0MUefliVs
 vITYHPBzm2YOsIrW8XAaI+/Zdcy5fJvBQpqGr7wkOdV2W/v0J3dXLQ/zj5oJM/TJ6Ook
 L+D7m32eoP1yq8DVu/8tr2ezHVZqhFJM/P/uLqBMY79gvFXYJAUyrtZsfs3yC8D9z9AD
 //5w==
X-Gm-Message-State: APjAAAVVWKVehERasRtfGYQFmlojZT/X6v8H+4kpIyIBt04vexiLHVpa
 vs8mhajxrdU3jkx2R4tAW07hWMc6
X-Google-Smtp-Source: APXvYqz38rKH2wumy0qKlf+I1gGL62XP94ASwxM7sNaJGggaYCwjsOdRFvI9QRdGK0LWmEn1ILFaRQ==
X-Received: by 2002:a2e:7e11:: with SMTP id z17mr4119705ljc.77.1556137536010; 
 Wed, 24 Apr 2019 13:25:36 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id w198sm4555866lff.10.2019.04.24.13.25.33
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Apr 2019 13:25:34 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN> <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN> <83wojk534g.fsf@HIDDEN>
 <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN> <83h8ao4vl0.fsf@HIDDEN>
 <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN> <835zr32x2m.fsf@HIDDEN>
 <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN> <831s1r2uzx.fsf@HIDDEN>
 <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN> <83wojj1ep8.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <429a19a3-52aa-02d1-0bd0-77c27c6811d7@HIDDEN>
Date: Wed, 24 Apr 2019 23:25:32 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83wojj1ep8.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 24.04.2019 20:43, Eli Zaretskii wrote:

>> But what conversion primitives does that low-level code use?
>> code_convert_region?
> 
> AFAICS, it uses decode_coding_c_string.  Incoming data doesn't have to
> be UTF-8, mind you, it could be anything, including an unknown
> encoding that needs detecting, and only the detection tells us it's
> UTF-8.

All right, thank you. If I ever have anything solid to propose, I will 
do so later.

>> Relying on the library is probably faster.
> 
> Why faster?

Because the library will perform its validation anyway, during normal 
execution. Any extra validation work Emacs performs, will take time on 
top of that (of course, I don't know how much time).

> And more importantly, will the error indication be useful enough to
> the Lisp program that triggered it?  If we signal an error, we can
> make sure of that.

We still signal errors if the library returns an error code.

More importantly, we also perform additional validation ourselves if 
something goes wrong. See the pieces of code like

       if (json == NULL)
         {
           /* A failure can be caused either by an invalid string or by
              low memory.  */
           json_check_utf8 (encoded);
           json_out_of_memory ();
         }

Anyway, speeding up encoding is not as important as it was with 
decoding, because at least in this case Lisp programs can control how 
much data is sent. So let's not spend too much time and effort on it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 17:44:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 13:44:06 2019
Received: from localhost ([127.0.0.1]:56439 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJLwC-0002CS-LZ
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:44:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJLwA-0002Br-06
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:44:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33342)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJLw4-0000fv-3O; Wed, 24 Apr 2019 13:43:56 -0400
Received: from [176.228.60.248] (port=2978 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJLw3-0004Kb-Ec; Wed, 24 Apr 2019 13:43:55 -0400
Date: Wed, 24 Apr 2019 20:43:47 +0300
Message-Id: <83wojj1ep8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 20:36:56 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN> <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
 <835zr32x2m.fsf@HIDDEN> <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN>
 <831s1r2uzx.fsf@HIDDEN> <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Wed, 24 Apr 2019 20:36:56 +0300
> 
> On 24.04.2019 20:06, Eli Zaretskii wrote:
> 
> > No, I think it's decoded by low-level code which reads output from the
> > process.  At least by default.
> 
> But what conversion primitives does that low-level code use? 
> code_convert_region?

AFAICS, it uses decode_coding_c_string.  Incoming data doesn't have to
be UTF-8, mind you, it could be anything, including an unknown
encoding that needs detecting, and only the detection tells us it's
UTF-8.

> > The question is, do we want to signal an error ourselves, or do we
> > want to rely on the library?
> 
> Relying on the library is probably faster.

Why faster?

And more importantly, will the error indication be useful enough to
the Lisp program that triggered it?  If we signal an error, we can
make sure of that.

> I'll happily benchmark a patch, if you have any.

OK.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 17:37:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 13:37:11 2019
Received: from localhost ([127.0.0.1]:56427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJLpX-00022U-Eg
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:37:11 -0400
Received: from mail-lf1-f46.google.com ([209.85.167.46]:36100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJLpV-00022F-3L
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:37:10 -0400
Received: by mail-lf1-f46.google.com with SMTP id u17so15346800lfi.3
 for <31138 <at> debbugs.gnu.org>; Wed, 24 Apr 2019 10:37:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=vbrDD0YJGitNJeLTash9vxglX3Zsb9wRZlvraIhDNZE=;
 b=XDeQa5jMJJvcMKmkuwbBolU7VRRRue3m8fVNN0XG/UkrMotexTNDGJ/Lt+vSm29IvN
 uxHQJnb9HVLSDUGxM3ofj9XG7P8RLYiEdlmwkH/8wxYsBgE11DdYOnCxGhj3YufHUXtr
 e+y8SgDuyAxBAnE6+OQ+BkolCsdjnxQ9+vj6fcUiRFrdciaazOkn/3QPYyApVd0SYzX+
 SDfrYtOVLX42+Nch5yHX4Q8Di12Gh2bEOcGsPGBS0FRccf0LDuclK81V3ZakWKv6CeQ2
 VRO/0uX8LRaYhgi/PvvhWx8YKlfWJbQdYxZccnwAfHAOrP8XdneV713L8TmKP+l0MUGk
 PdHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=vbrDD0YJGitNJeLTash9vxglX3Zsb9wRZlvraIhDNZE=;
 b=qe5UeNnuWvpqcnUpHjIjxMa/aHis+KO5yQzepUWUlR2nOqcYVQ5Iblg7zSSXBwG8Om
 zc1Cf7EJKNq206dzoxzMr3EbNPGoW8MHKdISp6s4NlOjYdqI5uEXyuoUKepfghDPVekt
 QbFzzrRr84pCCXtO/9Xd0yvFVSTO/dnYZdPF/o1w021Z7jSl/+m4dvsz3VwtPdDJQRcb
 +cu0H4IUmv6mfpGCCLGT+yGUiUlak7I0ZrcH8Vf2w3WZbpUVRgrOc1pwCEZLIC84BpeL
 C/1nJxkno4awd4sfsagC5UqM4MGT+hNsJztP6CIMQsKygaUjx58PmvgjWH8vt0KqETSe
 c1rw==
X-Gm-Message-State: APjAAAWgNJwJ1tKdqfDvMKkt6QRz8e2bts3wvmwXtev15efKVBDv9Opc
 BMdayDQ7pSxcF8RE6pcezYm7HthU
X-Google-Smtp-Source: APXvYqyVodG+lFJ1Jjy89liS7i+tlxB4Aly6xPJ0ptPUGkULprfYv2O0VLF0OBrhVv517NOOZ9NYFg==
X-Received: by 2002:ac2:54b4:: with SMTP id w20mr17902135lfk.149.1556127422180; 
 Wed, 24 Apr 2019 10:37:02 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id 10sm730862ljc.48.2019.04.24.10.36.59
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Apr 2019 10:37:00 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN> <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
 <835zr32x2m.fsf@HIDDEN> <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN>
 <831s1r2uzx.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b580279e-6f21-626b-bc13-bb8ff3b59473@HIDDEN>
Date: Wed, 24 Apr 2019 20:36:56 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <831s1r2uzx.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 24.04.2019 20:06, Eli Zaretskii wrote:

> No, I think it's decoded by low-level code which reads output from the
> process.  At least by default.

But what conversion primitives does that low-level code use? 
code_convert_region?

> The question is, do we want to signal an error ourselves, or do we
> want to rely on the library?

Relying on the library is probably faster. Though I'm not sure why we 
would be confident enough to rely on it in this case, but not the other.

I'll happily benchmark a patch, if you have any.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 17:06:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 13:06:44 2019
Received: from localhost ([127.0.0.1]:56389 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJLM2-0001K4-AX
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:06:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38315)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJLLz-0001Jr-Vy
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 13:06:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:32813)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJLLu-0000Ba-Gj; Wed, 24 Apr 2019 13:06:34 -0400
Received: from [176.228.60.248] (port=4609 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJLLq-0002KV-80; Wed, 24 Apr 2019 13:06:31 -0400
Date: Wed, 24 Apr 2019 20:06:26 +0300
Message-Id: <831s1r2uzx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 19:46:16 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN> <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
 <835zr32x2m.fsf@HIDDEN> <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Wed, 24 Apr 2019 19:46:16 +0300
> 
> On 24.04.2019 19:21, Eli Zaretskii wrote:
> 
> > Please point me to examples of this, I don't think I understand what
> > you have in mind.
> 
> Buffers with output from a process. In this example, the process is a 
> network connection. Not sure it applies, though. Since output arrives 
> piece-by-piece, maybe it gets decoded with *-string routines 
> (mm-decode-string uses that).

No, I think it's decoded by low-level code which reads output from the
process.  At least by default.

> > What does libjansson do if it receives strings with bytes it cannot
> > interpret?  Like raw bytes or UTF-8 sequences whose length is more
> > than 4 bytes?
> 
> One could test that directly, but its API docs list different kinds of 
> errors, including:
> 
>    json_error_invalid_utf8
>    json_error_null_character
>    json_error_null_byte_in_key
> 
> And we check for error status in functions that use the encoded values.
> 
> Reading the sources, there are several places where the first error is 
> signaled.

The question is, do we want to signal an error ourselves, or do we
want to rely on the library?

(And I need to refresh my memory regarding the differences between the
internal representation of text and strict UTF-8.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 16:46:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 12:46:28 2019
Received: from localhost ([127.0.0.1]:56350 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJL2S-0000pN-AR
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 12:46:28 -0400
Received: from mail-wr1-f41.google.com ([209.85.221.41]:44779)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJL2R-0000p9-Av
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 12:46:27 -0400
Received: by mail-wr1-f41.google.com with SMTP id c5so17224517wrs.11
 for <31138 <at> debbugs.gnu.org>; Wed, 24 Apr 2019 09:46:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=A00dzpksnQiU23asnkJDnnpmu0WX1OBof04Y0B0dhpo=;
 b=g0ElvqIiqd73BjQZjpCZg0Wld0l55vyAfRu3aFYouWk+is8cnECJF/bB9WdkfOOynu
 T3+IMlpQ2Oza0rR3CcrJH36kC8IbIhAa3gZskBFASrPZ+nRHoeomET32wKSPU8facDD7
 7+dAexZLWVsjzDeGrGQzx7hbm1uBCgqKfrPJwQH+HfqDbYQA85KfzaNRIqoHc20lrUHS
 9y9ENrVpLcrTofcZ7SGftl5a+kTRkcJChQyzrYTLtItqhDu9ZaK/mrMdK/4U0pm6rbnn
 dIMd4t4alA8rnBjhUgM198OjDQ/+8QWeNelMdY4+MMXyTgxfjtu7a6LwqC0m7mz8OuSM
 Nl6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=A00dzpksnQiU23asnkJDnnpmu0WX1OBof04Y0B0dhpo=;
 b=G7ze4RidEDuqwDZ0lSZLnRKDWCqX6F0fYU1gbHWdSmXEuv26JbQhnSO30sLFDe1+Hx
 Fim32ZZpuQEVuwsaEgpVVppvLJy85JmiRJOzkRuqGT1dI8ShPkIIe6BEiITryV7upcca
 tYc1TTUNeq6tddeix/v9fG8d4A821JRpsDGPFJxhqqbMhG0/RE1MyqH6VgO3yIymW0tn
 5AJ9BabODpK0OIXce0Mn8w3hwOBW2ZuEUEX/0lVKZ50lFDFoLIOrcTioTd1zBtUPrTcU
 JaPEuSolN+wcy94uO5xhe9XKRAVABxBY0nor4tT7Cb3LNfGNwuK1Wbw7i9xyeK4az5XF
 aXNQ==
X-Gm-Message-State: APjAAAVIEa/GibWZXWH5q1L55RB+9bpB8ZI1sjGkriqR7bRERDBVXlTL
 z1cALohTvwCp3eW8zAb60jLjas6B
X-Google-Smtp-Source: APXvYqzXSZg0+hB10m7MpsCixzOh3BnkF2CKfYlH0LnV02wJmjQe/ncE43ViqaI1JRslcaAipZC/Xw==
X-Received: by 2002:adf:ebd2:: with SMTP id v18mr18113030wrn.108.1556124380969; 
 Wed, 24 Apr 2019 09:46:20 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id z15sm11738557wrv.80.2019.04.24.09.46.17
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Apr 2019 09:46:18 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN> <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
 <835zr32x2m.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <8f3318e9-25bd-c7af-20dd-ed78d2a92efd@HIDDEN>
Date: Wed, 24 Apr 2019 19:46:16 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <835zr32x2m.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 24.04.2019 19:21, Eli Zaretskii wrote:

> Please point me to examples of this, I don't think I understand what
> you have in mind.

Buffers with output from a process. In this example, the process is a 
network connection. Not sure it applies, though. Since output arrives 
piece-by-piece, maybe it gets decoded with *-string routines 
(mm-decode-string uses that).

>>> We could perhaps try
>>> a similar optimization for UTF-8 instead of just ASCII.
>>
>> I think so.
> 
> Turns out we already do, I just missed that.

OK.

> What does libjansson do if it receives strings with bytes it cannot
> interpret?  Like raw bytes or UTF-8 sequences whose length is more
> than 4 bytes?

One could test that directly, but its API docs list different kinds of 
errors, including:

   json_error_invalid_utf8
   json_error_null_character
   json_error_null_byte_in_key

And we check for error status in functions that use the encoded values.

Reading the sources, there are several places where the first error is 
signaled.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 16:21:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 12:21:50 2019
Received: from localhost ([127.0.0.1]:56314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJKeb-0000DG-VG
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 12:21:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55394)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJKea-0000D4-AF
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 12:21:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60346)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJKeU-0004hF-8o; Wed, 24 Apr 2019 12:21:42 -0400
Received: from [176.228.60.248] (port=1860 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJKeT-0005tA-LN; Wed, 24 Apr 2019 12:21:42 -0400
Date: Wed, 24 Apr 2019 19:21:37 +0300
Message-Id: <835zr32x2m.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 18:55:45 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN> <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Dmitry Gutov <dgutov@HIDDEN>
> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> Date: Wed, 24 Apr 2019 18:55:45 +0300
> 
> On 23.04.2019 17:58, Eli Zaretskii wrote:
> 
> >> Doing that for buffer text as well might be helpful.
> > 
> > In what use cases would this be helpful?  Most cases of decoding text
> > in a buffer happen when we read text from files, where we already have
> > an internal optimization for plain ASCII files.
> 
> HTTP request response buffers? They can be as large as several 
> megabytes, as we have established in this discussion.

Please point me to examples of this, I don't think I understand what
you have in mind.

> > We could perhaps try
> > a similar optimization for UTF-8 instead of just ASCII.
> 
> I think so.

Turns out we already do, I just missed that.

> But it did increase the performance of json-serialize, by more than 2x, 
> on the same test data I've been using.
> 
> Like 3.8s to 1.6s for 10 iterations.
> 
> Can we do something like that? Removing conversion altogether is 
> probably not an option, but even using Fstring_as_unibyte instead lead 
> to a significant improvement (2,43s with this approach).

What does libjansson do if it receives strings with bytes it cannot
interpret?  Like raw bytes or UTF-8 sequences whose length is more
than 4 bytes?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 15:55:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 11:55:57 2019
Received: from localhost ([127.0.0.1]:56268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJKFZ-0005ua-HX
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 11:55:57 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:40506)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJKFX-0005uL-Ap
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 11:55:56 -0400
Received: by mail-wm1-f42.google.com with SMTP id z24so5805027wmi.5
 for <31138 <at> debbugs.gnu.org>; Wed, 24 Apr 2019 08:55:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:subject:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=/iooIZJOxCSJ1XnkCnhRKsETGDdBbIwVPxXLGRJU9Eg=;
 b=DId9lwQtfCSR+J9dMchfom5T9HpElP1yofzhOUsTi/KNakB8k+WfwNnjikY4jb1gze
 d3lmGVyoG1xkklVnZ8nN0laWVzhZsUcVsZITsnGneK57/EPxJGpe4tKotf4AccyK6s9Y
 DvBK/K6aEv3wDHTW0JZa6noTAsYt1aIYGIQ/rSKZSFJYQWoI2EN/NhpeyUi1kAGs8qUh
 f3Dg70xm5f9HijiKHmwgaGe4pw0VuTzl7N45EDEQKoRnYoujPqkUPDRCDG2QSov6SpKW
 V6+P/rLaj7odfI170s4eY5OOnnZhej5q7LILUswLBqncm5fQp3s0ie4roSw/okMPsxUC
 Tvnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:subject:to:cc:references:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=/iooIZJOxCSJ1XnkCnhRKsETGDdBbIwVPxXLGRJU9Eg=;
 b=uCasy9cLcQxhhI8WjsxGBaA2MeBzDi5obzzTpdf+o8M1KQJ4uZc2ZLJusTUuCrlgRK
 x9YhBVqWs4qxH//zk92olEAXYZNMyibiRuE0VLCKZ/djG2f7zWC0/VkFQYGWDmtBDc1L
 M0AV/rwB1B5z+8EIR0RqyGoQCdkcel/zIOUVq07hjwU/c9DRVEdB0eGHwO+fK95dKhnH
 D922RSEks3+yR9M2v8UlZMj/RCNVTAnA93ShiPZlRmag/mJC+PPwCwu0Ewo1iSQQSudL
 TxRQZu1i2FjNnGn918IWWXyLSr2vxScHX4ljzUPD/NPHoeyW69y1IaGfZDWJqkzzxViC
 w+Qw==
X-Gm-Message-State: APjAAAUQ/1+XyDm7YRruhzXtzrV8ih31BWWcbee5aKoDRDLsigCpxIfY
 00WGvEB+dsKqk3FT3fHi5o9K7gCR
X-Google-Smtp-Source: APXvYqydBMrWmzEI5Y26egIs48fsbrDICi/Ivr8JOWivNDyKVbnUT8r74n3NY7egRFM2qIEmFiBYVQ==
X-Received: by 2002:a7b:cc91:: with SMTP id p17mr7155292wma.38.1556121348874; 
 Wed, 24 Apr 2019 08:55:48 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id a22sm17567050wmj.44.2019.04.24.08.55.46
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Apr 2019 08:55:47 -0700 (PDT)
From: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <83h8ao4vl0.fsf@HIDDEN>
Message-ID: <deeefe54-5f7a-e221-6048-1cc47431bf19@HIDDEN>
Date: Wed, 24 Apr 2019 18:55:45 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83h8ao4vl0.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 17:58, Eli Zaretskii wrote:

>> Doing that for buffer text as well might be helpful.
> 
> In what use cases would this be helpful?  Most cases of decoding text
> in a buffer happen when we read text from files, where we already have
> an internal optimization for plain ASCII files.

HTTP request response buffers? They can be as large as several 
megabytes, as we have established in this discussion.

> We could perhaps try
> a similar optimization for UTF-8 instead of just ASCII.

I think so.

> Use cases where we read without decoding and then decode buffer
> contents "by hand" are relatively rare, certainly when the stuff to
> decode is so large that the performance gains will be tangible.

Maybe be. We could try and benchmark, though.

>> So that's why I mentioned decode-coding-string (though
>> code_convert_string would be a better choice; or decode_coding_object?),
>> as opposed to creating a new specialized function.
> 
> code_convert_string also handles encoding, though.

That's just one more comparison. We could also do that in 
decode_coding_object instead, but I'm not sure about the overhead of the 
intervening code.

>> What I can understand from our testing, this kind of change improves
>> performance for all kinds of strings when the source encoding is
>> utf_8_unix. Even for large ones (despite you expecting otherwise).
> 
> I tested 10K strings, and the advantage there already becomes
> relatively small.  10K characters may be a lot for strings, but it
> isn't for buffers.

That's probably true. I have tried a similar shortcut, removing the 
code_convert_string call in json_encode (which is called once from 
json-parse-string), and that did not measurably affect its performance.

But it did increase the performance of json-serialize, by more than 2x, 
on the same test data I've been using.

Like 3.8s to 1.6s for 10 iterations.

Can we do something like that? Removing conversion altogether is 
probably not an option, but even using Fstring_as_unibyte instead lead 
to a significant improvement (2,43s with this approach).

diff --git a/src/json.c b/src/json.c
index 7d6d531427..01682473ca 100644
--- a/src/json.c
+++ b/src/json.c
@@ -266,7 +266,7 @@ json_encode (Lisp_Object string)
  {
    /* FIXME: Raise an error if STRING is not a scalar value
       sequence.  */
-  return code_convert_string (string, Qutf_8_unix, Qt, true, true, true);
+  return string;
  }

  static AVOID




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 09:52:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 05:52:34 2019
Received: from localhost ([127.0.0.1]:55032 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJEZu-0003AY-EI
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 05:52:34 -0400
Received: from mail-wr1-f44.google.com ([209.85.221.44]:36437)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJEZs-0003AL-Te
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 05:52:33 -0400
Received: by mail-wr1-f44.google.com with SMTP id b1so12897752wru.3
 for <31138 <at> debbugs.gnu.org>; Wed, 24 Apr 2019 02:52:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=JMGhZkauEVzhREtBvHhctyqrI9lvpl4U9ueOFokMB/0=;
 b=TOi72v7J+mwn0f6HqmOuEju01++FUpbkF+eWYawH5fVcvnydRdusNZy65AL1wMJKLo
 zcVmtVodmywJwH2A/XZ7vq8BJyHWQLQkFFsvFpaH+u79LFvaeKDaVLUfymQkUd8i/qBQ
 2JqU6VeWJUml8BAJ5VeDbYetg5heFV1tYYWlQLSdrKA9Ph2P6l0+unBqIvYafeH0vqzO
 bjaze58pdQFPhpK5XJh/ODNEXhg42gkmQPy4k4K/aRvFLhYd7Ys+eDzIjc971VUO//nT
 +rRFdsVPtfGgbymNOOjDclhun/oaYzg4vCSnNBW5hlX6S+hCQURJQh5NIFFPoNdFzIIJ
 U5uA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=JMGhZkauEVzhREtBvHhctyqrI9lvpl4U9ueOFokMB/0=;
 b=D9YA3svXH5k2i1n7Oa+dbxIQzccGPmSUYsTawPq2UiDzc3smLh2yGtrcuMVkDuPKMO
 1BcsOKK8DHLRAopTP1sbIHbysD8zRT3oIPzAzzXJtMEklDCHBxFOT8FUdHQZJTlYJkm5
 h2N82yuR8e/snfg+ulCzetK5OXnyw+06zCk8z7g0Mkc7ewH+zlFGyXe94TkijtzcB5Xk
 Xve5z7T8lDdfAVt8Eihqs2mUiYXLqgDs3/hEKerlvHu4kn/3y0xKU0mwb4eIBjwvMGel
 6FLV9Q8Y9wkF0iFt61phUxFpJlCbhaToXxcd0/a1f/Wn+SRKLqa6S2yd+y1AnnzS+8jm
 F0Rg==
X-Gm-Message-State: APjAAAWVw8fza3UCIcpfVqnqLxsYbI4z1WMClNXi7OTfW2zH7q7jyNDM
 rSeUG4LRo/xSr2nJNzt3Ifr8rvUm
X-Google-Smtp-Source: APXvYqyTDsePDdfxMJgsVaxbWhs/4mE9Y5rLjO2JoaAve28qQvUQdge9zMq1dlaZsHoFKv9/Qq5SgA==
X-Received: by 2002:adf:f206:: with SMTP id p6mr10663725wro.168.1556099545802; 
 Wed, 24 Apr 2019 02:52:25 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id l1sm11201560wrh.58.2019.04.24.02.52.23
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Apr 2019 02:52:24 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN> <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN> <83wojk534g.fsf@HIDDEN>
 <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN> <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN>
 <83y33z3owd.fsf@HIDDEN> <e72cbb61-f7a8-2e65-ff38-d840390e7762@HIDDEN>
 <83mukf3lrx.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <4c68b32e-ffe8-beb8-4830-1a60332acc39@HIDDEN>
Date: Wed, 24 Apr 2019 12:52:21 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83mukf3lrx.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 24.04.2019 10:28, Eli Zaretskii wrote:

>> BTW, this is a case one could call both "non-UTF-8" and "valid UTF-8".
> 
> No, it's valid UTF-8.

That's what I said.

Anyway, this is just a discussion about words. Please feel free to 
disregard.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 07:28:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 03:28:17 2019
Received: from localhost ([127.0.0.1]:54921 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJCKH-0006CV-7O
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 03:28:17 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60931)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJCKC-0006C4-Um
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 03:28:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52000)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJCK6-0002S2-Qo; Wed, 24 Apr 2019 03:28:06 -0400
Received: from [176.228.60.248] (port=4177 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJCK5-000633-Td; Wed, 24 Apr 2019 03:28:06 -0400
Date: Wed, 24 Apr 2019 10:28:02 +0300
Message-Id: <83mukf3lrx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <e72cbb61-f7a8-2e65-ff38-d840390e7762@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 09:57:26 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN> <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN>
 <83y33z3owd.fsf@HIDDEN> <e72cbb61-f7a8-2e65-ff38-d840390e7762@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Wed, 24 Apr 2019 09:57:26 +0300
> 
> > However, note that various 7-bit encodings will be taken by such an
> > interface as valid UTF-8, since all the bytes are 7-bit ASCII.
> > There's nothing we can do about that, just something to keep in mind
> > (it isn't supposed to happen in correct usage).
> 
> IIUC, in the case the "proper" UTF-8 decoder would do exactly the same 
> thing in this case as the "fast path" upon discussion.
> 
> BTW, this is a case one could call both "non-UTF-8" and "valid UTF-8".

No, it's valid UTF-8.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 06:57:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 02:57:40 2019
Received: from localhost ([127.0.0.1]:54891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJBqe-0005UR-HA
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 02:57:40 -0400
Received: from mail-lj1-f181.google.com ([209.85.208.181]:42842)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJBqb-0005UB-PA
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 02:57:38 -0400
Received: by mail-lj1-f181.google.com with SMTP id i186so1872576lji.9
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 23:57:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=W9p4rDIV5SvbTgIdLwkYmYwhq48AFtervad7Dh7HxOE=;
 b=smQ93tZSofo67V/gAQSpBaio7s0r3KuPKKYXxoMZbK35VXeJ3FVLUoOlWTrrzEJtDl
 LZVRccfxYhqXL16G3NtJpT0FGT/iKX54Hb9FpxdOjdEj1lz37usc1w8e0gsBYb30abSD
 aTJfemY1/OzGOB7fXD66ZC8pUO/sAczILMx9Db31OZO6Gwm1/IRH6VrZ+GtjxhIOhA0/
 H/AO2uktrFmivSCs0VduT/+reAdSP0LbtaSmJfjK02gpOwlFOEMYm1iMZsvpfDSDqAjS
 XZ5a26xtHNCO7noNk+YkR9nsGwoDVKvCny4J4HpMgn+q9+hAmWFbtWkGSuKxq+RGWH3a
 lLmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=W9p4rDIV5SvbTgIdLwkYmYwhq48AFtervad7Dh7HxOE=;
 b=qR7T7W53/AMncwHYF7EdjD6XSFVWeDkGlaLiMSldsSKIXY4W4TMzeAX7ZBSL6kT17c
 1x3gNlOgR5yEdHfvk+i+Tpp6ZUP+x/kjf4D3W9O/F/77Cj08dfq3ZuoDI6qYtKu6P5/V
 HSyHF+e6BUx/f6i98dz5enfia31LoyZr4Njl6TjCDA06OghnsYcJCQ8laN3/LPzR1IxI
 8S4FhvhAn9wsB5zJB0lIUfWrusmzqBAHd35DjXJYfHEy0+0EraZMtEdFD133wnQX5lPg
 EifxHqCbdFk++AT8MKVqhixUrYvRasMS6iQOKtblOrCjBRKErKMhn2C7N/GlXjGnSPBq
 hWUA==
X-Gm-Message-State: APjAAAX77LjVZTQogsFMaJeWwJxi+uqCASBYEDhjWT3sCPuDI796U82B
 FJqqN4Wima66HvnRzf+2lc+cSzQX
X-Google-Smtp-Source: APXvYqxG3USrqNdMGBr4zRp/4biA8Pw85vDbobCxhweNXmc/3mjYhxRIiz3CkCDuvadW4T+gGhuerQ==
X-Received: by 2002:a2e:3c0a:: with SMTP id j10mr4808370lja.164.1556089050255; 
 Tue, 23 Apr 2019 23:57:30 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id x76sm3824205ljb.17.2019.04.23.23.57.27
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 23:57:29 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN> <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN>
 <83y33z3owd.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <e72cbb61-f7a8-2e65-ff38-d840390e7762@HIDDEN>
Date: Wed, 24 Apr 2019 09:57:26 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83y33z3owd.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 24.04.2019 9:20, Eli Zaretskii wrote:

> We are talking about a function that expects UTF-8 strings, so
> "non-UTF-8" and "invalid UTF-8" are 2 different ways of saying the
> same thing.

Right, except for the emphasis. But since we're talking about 
documentation, there's a difference between saying "parsing of non-UTF-8 
got slower" and "parsing of invalid UTF-8 got slower".

> However, note that various 7-bit encodings will be taken by such an
> interface as valid UTF-8, since all the bytes are 7-bit ASCII.
> There's nothing we can do about that, just something to keep in mind
> (it isn't supposed to happen in correct usage).

IIUC, in the case the "proper" UTF-8 decoder would do exactly the same 
thing in this case as the "fast path" upon discussion.

BTW, this is a case one could call both "non-UTF-8" and "valid UTF-8".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 06:20:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 24 02:20:49 2019
Received: from localhost ([127.0.0.1]:54877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJBGy-0004fU-Qb
	for submit <at> debbugs.gnu.org; Wed, 24 Apr 2019 02:20:49 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42875)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hJBGw-0004fG-SN
 for 31138 <at> debbugs.gnu.org; Wed, 24 Apr 2019 02:20:47 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51232)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hJBGq-0000uD-4t; Wed, 24 Apr 2019 02:20:40 -0400
Received: from [176.228.60.248] (port=3987 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hJBGp-0005TR-In; Wed, 24 Apr 2019 02:20:39 -0400
Date: Wed, 24 Apr 2019 09:20:34 +0300
Message-Id: <83y33z3owd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN> (message from
 Dmitry Gutov on Wed, 24 Apr 2019 01:34:37 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN> <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Wed, 24 Apr 2019 01:34:37 +0300
> 
> > Or we might document that non-UTF-8 strings will be slower to convert,
> > if that's acceptable.
> 
> *Invalid* UTF-8 strings. Strings that aren't actually UTF-8, even though 
> the caller declares them to be.

We are talking about a function that expects UTF-8 strings, so
"non-UTF-8" and "invalid UTF-8" are 2 different ways of saying the
same thing.

However, note that various 7-bit encodings will be taken by such an
interface as valid UTF-8, since all the bytes are 7-bit ASCII.
There's nothing we can do about that, just something to keep in mind
(it isn't supposed to happen in correct usage).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Apr 2019 02:23:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 22:23:30 2019
Received: from localhost ([127.0.0.1]:54764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJ7ZK-0007OJ-4o
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 22:23:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41595)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1hJ7ZH-0007O1-7f
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 22:23:27 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48055)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>)
 id 1hJ7ZA-0001D2-Qf; Tue, 23 Apr 2019 22:23:20 -0400
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1hJ7Z9-0003vp-MJ; Tue, 23 Apr 2019 22:23:19 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <83a7gh5kie.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 23
 Apr 2019 09:00:09 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN>
 <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN>
 <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN>
 <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN>
 <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN>
 <83muki54tm.fsf@HIDDEN>
 <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN> <83a7gh5kie.fsf@HIDDEN>
Message-Id: <E1hJ7Z9-0003vp-MJ@HIDDEN>
Date: Tue, 23 Apr 2019 22:23:19 -0400
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The interests of libjansson developers aside, I disagree that
  > low-level text decoding functionality should signal an error, let
  > alone abort.  It is up to the application to decide whether having raw
  > bytes in strings is legit or not.

I agree.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 22:34:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 18:34:50 2019
Received: from localhost ([127.0.0.1]:54571 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hJ402-00088U-3K
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 18:34:50 -0400
Received: from mail-lf1-f43.google.com ([209.85.167.43]:36918)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hJ400-00088H-2t
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 18:34:48 -0400
Received: by mail-lf1-f43.google.com with SMTP id h126so2344795lfh.4
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 15:34:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=rlR++8oZKlFohUfeW2OJw+vkF+ECt6qDzkptmp3etYM=;
 b=Wu7Q/nlkwrB7pi06goNDLF1E9JM9oPxBEWcQT1FBkoDSUo8uZcEIb/4Lb5p/McWXUF
 2XVSdlPwMBLRVITDc1+zczhf+uRL+CDNEBlITdOIWEFYLBUqwGFGYHd127M2gQmmSLPb
 f+f8Ep8DaQntTYQUeBUraGNz/Nswjq0bYWhQaC4hLd25uv3BEx/rTAxYZm3dQTxeVYMf
 89zWObLhxEKLMr260S5kf/9BagP60BdIEWFb4SXYKoOkpbxvAbd1l+lUyD5iQfPbTHFn
 sPrA2M/pkQW/G+GBP0HrqIRvX/HkigVpn+1KNPCG3UxiPdmwYPQC/0mKQhE91uJF/Stv
 PlBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=rlR++8oZKlFohUfeW2OJw+vkF+ECt6qDzkptmp3etYM=;
 b=fibZDIHMqO7eUgORNfo2d6QzBf4Q0iO5AjkJD2NTawlIIRbCVwVoMee3WbefebfFDe
 lgX2em6SeAramAUFaxrQAxHMc5gD1ZUfkY0xMEHbhZiMPEOkLR5PO2dRB/URoSikgvvv
 VoHsKAssRi9bIabulFBg8Fl/yB+nWnjB5+VajVcXvmPKJ3rXyUbWi0SfR4L7Jhuum87o
 SQOxNdsZNX+0fa/Y1IGh5EDrjDs2MlnovHoF/HD4CJxOun/lIckxJBHbR8yI9ag6Jkw6
 OZ7YzENlht5dtoN6K4/7qxWGCwt2lXtjJQr/JC+UPlfwozLCpp/Q6Ax6q6NVM7mterZ6
 s23A==
X-Gm-Message-State: APjAAAXTelmS1p5T6s2FQJbGAIRBayjkdG/ZONmw7D7WsDb60tIFz3V0
 llrIsDMQjGwVut0Us/OwiqK7KLNX
X-Google-Smtp-Source: APXvYqyA36HChuyFpkIxZsKRX7DWVu70ixNxoZCEvLQTVAf6ao9mDsQkoZ7Bv0e51Z+xAh36hw5Hpg==
X-Received: by 2002:ac2:5315:: with SMTP id c21mr16305047lfh.25.1556058881724; 
 Tue, 23 Apr 2019 15:34:41 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id i24sm3944476lfl.55.2019.04.23.15.34.38
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 15:34:40 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, Philipp Stephani <p.stephani2@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <25d6f575-dbda-435e-d5de-4e029432edb1@HIDDEN>
Date: Wed, 24 Apr 2019 01:34:37 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83ef5s4v24.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 18:09, Eli Zaretskii wrote:

> If we want to make this more general-purpose, we should time the code
> with very long strings.  It could be that beyond some length the UTF-8
> verification, if it fails, will make the conversion slower, in which
> case we probably should not take the shortcut beyond that length
> limit.

If it fails, yes. Although it might still be an insignificant fraction 
of the total time it takes (verification is O(N), and conversion is O(N) 
as well).

> Or we might document that non-UTF-8 strings will be slower to convert,
> if that's acceptable.

*Invalid* UTF-8 strings. Strings that aren't actually UTF-8, even though 
the caller declares them to be.

I think this can be a good (and simple) tradeoff.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 15:45:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:45:13 2019
Received: from localhost ([127.0.0.1]:54141 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIxbd-0002UO-Bu
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:45:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51065)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIxbb-0002U6-1l
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:45:12 -0400
Received: from lists.gnu.org ([209.51.188.17]:33419)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1hIxbV-0001aH-TC
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:45:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37213)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIxbU-0006Af-V8
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 11:45:05 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 RDNS_NONE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIxbU-0001ZJ-1q
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 11:45:04 -0400
Received: from [195.159.176.226] (port=36428 helo=blaine.gmane.org)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1hIxbT-0001Z7-R5
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 11:45:03 -0400
Received: from list by blaine.gmane.org with local (Exim 4.89)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIxbS-000Ytl-Hj
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 17:45:02 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
Date: Tue, 23 Apr 2019 16:44:02 +0100
Message-ID: <vz1wojkohfh.fsf@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <vz1imv4n5bi.fsf@HIDDEN>
 <83ftq84vcc.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)
Cancel-Lock: sha1:1Hr4mu3/WJqh6/dct4iRqeJNgIo=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 195.159.176.226
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

On Tue 23 Apr 2019, Eli Zaretskii wrote:

>> From: Andy Moreton <andrewjmoreton@HIDDEN>
>> Date: Tue, 23 Apr 2019 15:50:57 +0100
>> 
>> > What applications do we have where en/decoding strings has critical
>> > effect on performance?
>> 
>> One possible candidate is the LSP packages from ELPA/MELPA (eglot,
>> lsp-mode, etc) which use JSON-RPC to communicate with the external
>> language servers. Their interactive performance may be sensitive to JSON
>> overheads.
>> 
>> I don't yet use these tools, so perhaps someone who does can indicate if
>> faster JSON handling is important for these tools.
>
> JSON performance already got sped up: that's what this bug report and
> the associated commits were all about.  I was asking which other
> applications that do NOT use JSON might have string conversion a
> bottleneck.

Ah - my bad.

> Or did I misunderstand what you were saying?

No, I did not read enough context.

    AndyM






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:44:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:44:00 2019
Received: from localhost ([127.0.0.1]:54137 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIxaR-0002Rq-UA
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:44:00 -0400
Received: from mail-lf1-f47.google.com ([209.85.167.47]:45354)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIxaQ-0002Rb-Gf
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:43:58 -0400
Received: by mail-lf1-f47.google.com with SMTP id t11so12129715lfl.12
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 08:43:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=Q3z+jo/SNO8O6Ukv4e30eRf4N7FThmvw8BewW3AOSoo=;
 b=KdN4bVPAaycIblZYjXNpC39ijn29mk0OzHQfeFVe3B0DImPZ1bRLBHW4PTuEhk+z8r
 bSI+ZKSb6t/2lvDOQ/9ynYTl3iOWj7glnfanlFNePlamPQ4WBcJyp7R+51RAilclpOJY
 YO1caOfRHY8VeDsu02MyZyjWrsa7s25TdIBBIiQGKoZDJb6Pg5IR5dfRfu1uBqMuAYrI
 FrPmBvM6YDMyZ7mv2YeM4q0AAqnz56vG2zKgIdjPbaxKGbK0ZKIbXfl3gO3Y3p+VXN8s
 j7NXr0svABym94oawoF9CFm/2o7rH3YquCKNvFc1ivzaGNiErFrQ8mx8drJLixDeJGbZ
 fHOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=Q3z+jo/SNO8O6Ukv4e30eRf4N7FThmvw8BewW3AOSoo=;
 b=taF53HRztOmy90FJSjUiy0ME+ijOiH5q3vsAT60dZW1v3ZC6bgcvHfxYm35gcKcUWB
 oI6wESzyUqZf74zgrghB9AkOMwDWljJFx+lNoskPnr8ZoKDxJEe/hojkXzv4ETHhRpAu
 f+goSzuMp4cfVpiCL1Wyd0kUbS5lv8e13cKTctMHXvUUIJPGAZ4cj6MWuBL8VSVawqtL
 daqygWYjtNg7uqGqiwFBJISnqyhT+PY9dFiQTxwi5zh36bSGIXMAe1hG88dVtDAt5vJz
 yNhGDedkoimytYNZPqqq0ziiYEzup+9PZRHv8QcfzJ0Q3E9ozQAO4Yeo9ylWf4ZjVZv4
 e/qg==
X-Gm-Message-State: APjAAAVBm1ysmXjvxCnpFb9VmYshrvro9AfuTGEaogQ2j+pMka+askXY
 T44CXdx22mEaltBc/idu9YyTrC7NtH13rSuj9uk=
X-Google-Smtp-Source: APXvYqzwHVZJd9Z0B8iCkCMOfphFYfacplj6jAdAyglqwEb0A3OvAdZuTdgzQwTViaNufK1TFja7fXI0m0Cjm7oWaDM=
X-Received: by 2002:a19:f013:: with SMTP id p19mr13847054lfc.49.1556034232446; 
 Tue, 23 Apr 2019 08:43:52 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN>
 <CACCVLQUERca-Hc5sKJ5undvTPGEX4wtqcGzOvq2UqevNEYF7gQ@HIDDEN>
 <83bm0w4tpe.fsf@HIDDEN>
In-Reply-To: <83bm0w4tpe.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 23 Apr 2019 18:43:41 +0300
Message-ID: <CACCVLQV+EAoie57BnJC8EuRpuVd7vrB+T8nBZo8QC-T2Rc1EsA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000aef3680587347337"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: Philipp Stephani <p.stephani2@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000aef3680587347337
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I am talking about module_make_utf8_string and module_make_string.

Thanks,
Ivan

On Tue, Apr 23, 2019 at 6:39 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Tue, 23 Apr 2019 18:36:18 +0300
> > Cc: Philipp Stephani <p.stephani2@HIDDEN>, Dmitry Gutov <
> dgutov@HIDDEN>,
> >       S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > Another posibility is to have two string convertion methods.
>
> We already have them, that's what json_make_string uses internally.
> Right?
>

--000000000000aef3680587347337
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I am talking about module_make_utf8_string and module_make=
_string.<div><br></div><div>Thanks,</div><div>Ivan</div></div><br><div clas=
s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Apr 23, 201=
9 at 6:39 PM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_b=
lank">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN=
m" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Tue, 23 Apr 2019 18:36:18 +0300<br>
&gt; Cc: Philipp Stephani &lt;<a href=3D"mailto:p.stephani2@HIDDEN" targ=
et=3D"_blank">p.stephani2@HIDDEN</a>&gt;, Dmitry Gutov &lt;<a href=3D"ma=
ilto:dgutov@HIDDEN" target=3D"_blank">dgutov@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0S=C3=A9bastien Chapuis &lt;<a href=3D"mailto=
:sebastien@HIDDEN" target=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; Another posibility is to have two string convertion methods.<br>
<br>
We already have them, that&#39;s what json_make_string uses internally.<br>
Right?<br>
</blockquote></div>

--000000000000aef3680587347337--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:39:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:39:26 2019
Received: from localhost ([127.0.0.1]:54121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIxW2-0002Kn-H8
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:39:26 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIxVz-0002KZ-1a
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:39:23 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36113)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIxVt-00074a-AK; Tue, 23 Apr 2019 11:39:17 -0400
Received: from [176.228.60.248] (port=1523 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIxVs-0003Rs-MP; Tue, 23 Apr 2019 11:39:17 -0400
Date: Tue, 23 Apr 2019 18:39:09 +0300
Message-Id: <83bm0w4tpe.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUERca-Hc5sKJ5undvTPGEX4wtqcGzOvq2UqevNEYF7gQ@HIDDEN>
 (message from yyoncho on Tue, 23 Apr 2019 18:36:18 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN>
 <CACCVLQUERca-Hc5sKJ5undvTPGEX4wtqcGzOvq2UqevNEYF7gQ@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, 31138 <at> debbugs.gnu.org,
 dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Tue, 23 Apr 2019 18:36:18 +0300
> Cc: Philipp Stephani <p.stephani2@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>, 
> 	Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> Another posibility is to have two string convertion methods.

We already have them, that's what json_make_string uses internally.
Right?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:36:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:36:37 2019
Received: from localhost ([127.0.0.1]:54110 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIxTJ-0002GY-Ja
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:36:37 -0400
Received: from mail-lj1-f171.google.com ([209.85.208.171]:46281)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIxTI-0002GE-4S
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:36:36 -0400
Received: by mail-lj1-f171.google.com with SMTP id h21so13914428ljk.13
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 08:36:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=TzNnDgpPH90fN0WQTqppOC+RAqlq2jxlxnxQCq4BClk=;
 b=aah3aadsLnBLcEaySAlbxILTLjzHGBHy5ENqupSBZr7+AdRCsmGQw6DTlSmSub60GE
 AQzbP2YAo1qjKjilUf1042ko7hHVs/w8xeVfIsvQxOfKEXJjusECOyX2LT6pdYtl8X6A
 Sc3Hb+Mlwsch9irZLd0M+RsJ5o8CGZ04zORGOonV3H9wP0Qj8FYvVFhrDQlRwaIFDi5N
 Jt1muXfNYwoM78LZi/kshMqCsx4nYTa+KL6nw5WhSxR4ID5ddRv11ZSwoRUemF0GI5oX
 P718sVvFIK/9i/ONxbQUmSnrmsim60xFy5xSg75WgugWkVTzdQzyZKpJ6Xs1SqPkg65U
 JIYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=TzNnDgpPH90fN0WQTqppOC+RAqlq2jxlxnxQCq4BClk=;
 b=n+Xdg44P8c5Qic6TtrgldfiYgnmoGu4hIAm5Nf+I04S/zPVJ7tcYLRnA1To7hmjJM/
 MsSrjaSYTRPC43scwMZcI2z6BNgeetseELb7mX0TXZodfT88YAw7hCYPzRQRenxOrXcM
 IJTuHTms+8XJKcvBNE9PFTexpUmQP6u8aunLPHWF30RzUqZe83hgSz+hroGQCMFmW+GG
 h+PZdIVXSzRHxbCV1Uxa2pJYZ0UFD8w5jVd8Ioc8q4DV5V2njKyYJo86yKNiTT35WEDP
 A/wk86ABTFxt72CuX9DFSdiqH7ciIDF0XbEQyxPt7wkeKLZ/pmsgpRiX248iNDB28zAY
 IkRg==
X-Gm-Message-State: APjAAAX34LVWejN1Rgz/tI+BwASroLLFHWmEGzlovJqk37qTwJeQh3s5
 2r5AMrj4VwEj6KVb05n8YUPYVIPhYKFDx2JTRxg=
X-Google-Smtp-Source: APXvYqyMxqaKJ6w3pXboskdxHZG+ea5TCvdfEp+vpV+PXjyyTOzLfvypuqSXgOKj94yJ8YR66Q00hqJgL4fK8CEIeV8=
X-Received: by 2002:a2e:8895:: with SMTP id k21mr2901140lji.43.1556033790144; 
 Tue, 23 Apr 2019 08:36:30 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN>
In-Reply-To: <83ef5s4v24.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 23 Apr 2019 18:36:18 +0300
Message-ID: <CACCVLQUERca-Hc5sKJ5undvTPGEX4wtqcGzOvq2UqevNEYF7gQ@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000051f35305873459b7"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: Philipp Stephani <p.stephani2@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000051f35305873459b7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

Another posibility is to have two string convertion methods.

Thanks,
Ivan

On Tue, Apr 23, 2019 at 6:10 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Philipp Stephani <p.stephani2@HIDDEN>
> > Date: Tue, 23 Apr 2019 16:40:10 +0200
> > Cc: Eli Zaretskii <eliz@HIDDEN>, S=C3=A9bastien Chapuis <sebastien@cha=
pu.is>,
>
> >       yyoncho <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
> >
> > For starters, the module code in emacs-module.c (e.g.
> > module_make_string) has essentially the same requirements. So we could
> > at least move json_make_string, json_build_string, and json_encode
> > into coding.[ch] (and rename them).
>
> If we want to make this more general-purpose, we should time the code
> with very long strings.  It could be that beyond some length the UTF-8
> verification, if it fails, will make the conversion slower, in which
> case we probably should not take the shortcut beyond that length
> limit.
>
> Or we might document that non-UTF-8 strings will be slower to convert,
> if that's acceptable.
>

--00000000000051f35305873459b7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Eli,<div><br></div><div>Another posibility is to have t=
wo string convertion methods.</div><div><br></div><div>Thanks,</div><div>Iv=
an</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmai=
l_attr">On Tue, Apr 23, 2019 at 6:10 PM Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">&gt; From: Philipp Stephani &lt;<a href=3D"mailt=
o:p.stephani2@HIDDEN" target=3D"_blank">p.stephani2@HIDDEN</a>&gt;<br=
>
&gt; Date: Tue, 23 Apr 2019 16:40:10 +0200<br>
&gt; Cc: Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank=
">eliz@HIDDEN</a>&gt;, S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebast=
ien@HIDDEN" target=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0yyoncho &lt;<a href=3D"mailto:yyoncho@gmail.=
com" target=3D"_blank">yyoncho@HIDDEN</a>&gt;, <a href=3D"mailto:31138@d=
ebbugs.gnu.org" target=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; For starters, the module code in emacs-module.c (e.g.<br>
&gt; module_make_string) has essentially the same requirements. So we could=
<br>
&gt; at least move json_make_string, json_build_string, and json_encode<br>
&gt; into coding.[ch] (and rename them).<br>
<br>
If we want to make this more general-purpose, we should time the code<br>
with very long strings.=C2=A0 It could be that beyond some length the UTF-8=
<br>
verification, if it fails, will make the conversion slower, in which<br>
case we probably should not take the shortcut beyond that length<br>
limit.<br>
<br>
Or we might document that non-UTF-8 strings will be slower to convert,<br>
if that&#39;s acceptable.<br>
</blockquote></div>

--00000000000051f35305873459b7--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:18:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:18:04 2019
Received: from localhost ([127.0.0.1]:54073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIxBM-0001of-6W
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:18:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44374)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIxBK-0001oA-Gx
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:18:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35587)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIxBC-0004Pu-PQ; Tue, 23 Apr 2019 11:17:56 -0400
Received: from [176.228.60.248] (port=4183 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIxBC-0000HF-5Z; Tue, 23 Apr 2019 11:17:54 -0400
Date: Tue, 23 Apr 2019 18:17:46 +0300
Message-Id: <83d0lc4up1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: p.stephani2@HIDDEN
In-reply-to: <83ef5s4v24.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 23
 Apr 2019 18:09:55 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
 <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 <83ef5s4v24.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, yyoncho@HIDDEN,
 dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 23 Apr 2019 18:09:55 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: sebastien@HIDDEN, dgutov@HIDDEN, yyoncho@HIDDEN,
> 	31138 <at> debbugs.gnu.org
> 
> If we want to make this more general-purpose, we should time the code
> with very long strings.  It could be that beyond some length the UTF-8
> verification, if it fails, will make the conversion slower, in which
> case we probably should not take the shortcut beyond that length
> limit.

Another minor issue to consider is that moving json_make_string into
another file might make JSON processing somewhat slower, because the
function will/might no longer be inlined.  Not sure if this is
important enough, though.  Perhaps timing the results will tell.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:10:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:10:09 2019
Received: from localhost ([127.0.0.1]:54052 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIx3g-0001cR-TV
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:10:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42155)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIx3f-0001c1-49
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:10:07 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35354)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIx3Z-0000JE-E3; Tue, 23 Apr 2019 11:10:01 -0400
Received: from [176.228.60.248] (port=3632 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIx3Y-0007pr-Tn; Tue, 23 Apr 2019 11:10:01 -0400
Date: Tue, 23 Apr 2019 18:09:55 +0300
Message-Id: <83ef5s4v24.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
In-reply-to: <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
 (message from Philipp Stephani on Tue, 23 Apr 2019 16:40:10 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
 <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, yyoncho@HIDDEN,
 dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philipp Stephani <p.stephani2@HIDDEN>
> Date: Tue, 23 Apr 2019 16:40:10 +0200
> Cc: Eli Zaretskii <eliz@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	yyoncho <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
> 
> For starters, the module code in emacs-module.c (e.g.
> module_make_string) has essentially the same requirements. So we could
> at least move json_make_string, json_build_string, and json_encode
> into coding.[ch] (and rename them).

If we want to make this more general-purpose, we should time the code
with very long strings.  It could be that beyond some length the UTF-8
verification, if it fails, will make the conversion slower, in which
case we probably should not take the shortcut beyond that length
limit.

Or we might document that non-UTF-8 strings will be slower to convert,
if that's acceptable.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 15:04:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 11:04:01 2019
Received: from localhost ([127.0.0.1]:54042 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwxl-0001Sd-6L
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:04:01 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41021)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIwxj-0001SF-Uz
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 11:04:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35285)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIwxe-0005EO-Ot; Tue, 23 Apr 2019 11:03:54 -0400
Received: from [176.228.60.248] (port=3258 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIwxe-00060S-5Z; Tue, 23 Apr 2019 11:03:54 -0400
Date: Tue, 23 Apr 2019 18:03:47 +0300
Message-Id: <83ftq84vcc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Andy Moreton <andrewjmoreton@HIDDEN>
In-reply-to: <vz1imv4n5bi.fsf@HIDDEN> (message from Andy Moreton on Tue, 23
 Apr 2019 15:50:57 +0100)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <vz1imv4n5bi.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Andy Moreton <andrewjmoreton@HIDDEN>
> Date: Tue, 23 Apr 2019 15:50:57 +0100
> 
> > What applications do we have where en/decoding strings has critical
> > effect on performance?
> 
> One possible candidate is the LSP packages from ELPA/MELPA (eglot,
> lsp-mode, etc) which use JSON-RPC to communicate with the external
> language servers. Their interactive performance may be sensitive to JSON
> overheads.
> 
> I don't yet use these tools, so perhaps someone who does can indicate if
> faster JSON handling is important for these tools.

JSON performance already got sped up: that's what this bug report and
the associated commits were all about.  I was asking which other
applications that do NOT use JSON might have string conversion a
bottleneck.

Or did I misunderstand what you were saying?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 14:58:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 10:58:53 2019
Received: from localhost ([127.0.0.1]:54037 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwsk-0001JU-HO
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:58:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39171)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIwsi-0001JI-TT
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:58:49 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35153)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIwsc-0000sH-Kk; Tue, 23 Apr 2019 10:58:42 -0400
Received: from [176.228.60.248] (port=2917 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIwsb-0006dX-HC; Tue, 23 Apr 2019 10:58:42 -0400
Date: Tue, 23 Apr 2019 17:58:35 +0300
Message-Id: <83h8ao4vl0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN> (message from
 Dmitry Gutov on Tue, 23 Apr 2019 17:22:34 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 23 Apr 2019 17:22:34 +0300
> 
> On 23.04.2019 15:15, Eli Zaretskii wrote:
> > I thought about this.  It could make sense to have a UTF-8 specific
> > function to encode and decode strings.  With encodings other than
> > UTF-8 it becomes trickier, and probably likewise with buffer text,
> > where we need to take the gap into account.
> 
> Doing that for buffer text as well might be helpful.

In what use cases would this be helpful?  Most cases of decoding text
in a buffer happen when we read text from files, where we already have
an internal optimization for plain ASCII files.  We could perhaps try
a similar optimization for UTF-8 instead of just ASCII.

Use cases where we read without decoding and then decode buffer
contents "by hand" are relatively rare, certainly when the stuff to
decode is so large that the performance gains will be tangible.

> So that's why I mentioned decode-coding-string (though 
> code_convert_string would be a better choice; or decode_coding_object?), 
> as opposed to creating a new specialized function.

code_convert_string also handles encoding, though.

> What I can understand from our testing, this kind of change improves 
> performance for all kinds of strings when the source encoding is 
> utf_8_unix. Even for large ones (despite you expecting otherwise).

I tested 10K strings, and the advantage there already becomes
relatively small.  10K characters may be a lot for strings, but it
isn't for buffers.  The optimization we use as part of decoding
insert-file-contents avoids the problem by inserting the ASCII part
directly and starting to decode from the first non-ASCII character.
With strings and with text already in the buffer this is not currently
possible, or at least not easily.

> Again, the patch, or several, shouldn't be particularly hard to write, 
> and we can try them out with different scenarios.

If someone wants to work on such patches, I'm sure they will be
welcome.  But we should have clear use cases and good test cases to
time them, IMO.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 14:51:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 10:51:17 2019
Received: from localhost ([127.0.0.1]:54025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwlR-00018r-4S
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:51:17 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36513)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIwlO-00018U-6H
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:51:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:33230)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1hIwlJ-0004xg-0w
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:51:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50895)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIwlH-0001rO-RX
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 10:51:08 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
 FREEMAIL_REPLY,RDNS_NONE,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIwlG-0004xG-TG
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 10:51:07 -0400
Received: from [195.159.176.226] (port=59828 helo=blaine.gmane.org)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1hIwlG-0004wr-Mu
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 10:51:06 -0400
Received: from list by blaine.gmane.org with local (Exim 4.89)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1hIwlD-000czz-2W
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 16:51:03 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
Date: Tue, 23 Apr 2019 15:50:57 +0100
Message-ID: <vz1imv4n5bi.fsf@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN>
 <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.50 (windows-nt)
Cancel-Lock: sha1:gSzd/zDufe+KnoaNkt/AWT4VJYg=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 195.159.176.226
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

On Tue 23 Apr 2019, Eli Zaretskii wrote:

>> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Date: Tue, 23 Apr 2019 14:52:21 +0300
>> 
>> I wonder if having this optimization built-in in
>> decode-coding-string or thereabouts could give us performance gains
>> somewhere else as well.
>
> I thought about this.  It could make sense to have a UTF-8 specific
> function to encode and decode strings.  With encodings other than
> UTF-8 it becomes trickier, and probably likewise with buffer text,
> where we need to take the gap into account.
>
> What applications do we have where en/decoding strings has critical
> effect on performance?

One possible candidate is the LSP packages from ELPA/MELPA (eglot,
lsp-mode, etc) which use JSON-RPC to communicate with the external
language servers. Their interactive performance may be sensitive to JSON
overheads.

I don't yet use these tools, so perhaps someone who does can indicate if
faster JSON handling is important for these tools.

    AndyM





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 14:40:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 10:40:34 2019
Received: from localhost ([127.0.0.1]:53989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwb4-0000sG-Bm
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:40:34 -0400
Received: from mail-ot1-f49.google.com ([209.85.210.49]:34129)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1hIwb2-0000s2-0I
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:40:32 -0400
Received: by mail-ot1-f49.google.com with SMTP id h2so2554699otm.1
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 07:40:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=pmr348/49a8h841o5i8vXfuQbsuYWRIY95bXTeWj2h0=;
 b=LKBE4jeC01Emckz+snk44+j0xR16BR7R3Jrtt4Ou/d22IgUlhJUm2u1SfLKKjNCQwO
 l1m7zuQeg5oxjFrtdHnyVLBJcqwHGU5f1yWL1GSxJt7LOz/COX61qNW/Yjkdl3YuC+tO
 duEoE3s6tk9nAPFjOLRojKYbTQOG7AYNd+mgokA/N6kcpBCLC9znVPNyGKDYXIzBIT08
 iOTxEeu9bJDIUtJdSnPZIYpOPR+zXcx2Zb8Lq9LDQU0VXj9AsQfS7ctNC7SEAv4DAvcf
 A+HbRhIWQF85OcHf3bC65nEKl7tQ6Z+tBIrvHGYiB3I9LHuDwaRq0xTuprhQ3daIZrE6
 MIlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=pmr348/49a8h841o5i8vXfuQbsuYWRIY95bXTeWj2h0=;
 b=DRQNh8z5OlwKcsDvoG+uEw7NBCztydMyOwjiuy/VD0XXr1Gl8iCgUY+ZnqT3QdHW3r
 uP5DydyRlsyqytWDEDi22tfw24QZUwtoVXPugBirRrhk+GWrA9lLCuwzPoVZsnvijMZm
 tUvd1RREl5dJJr2+5ymbIEQx/Xn9qPX9+2zP8xZQv40RihLxHKCLrcLXZBmJw078fdIw
 DoxzdkhJVbmHbgtcPDwD3c+F91dRq/jG9eBztD6RjAHyAeeV+3jUIbdz8wFDiUbrxw1f
 0RFJoTJppRdtF56Dc2XkVMV1q85S8bDvaU03HT+TPXWP/Bbn0kWUxuUmH9r6zgZjPsHd
 fUDQ==
X-Gm-Message-State: APjAAAVAqveCqzeuSmPUXl3pGBW3/iQ2J/uNQQ2IiQAtRnUnWX5FPtBr
 rUtPONu8KHxYrKfAaIBAfKqdUXma6agiXgsECzc=
X-Google-Smtp-Source: APXvYqwj1DFdKar6JVPEk/SaZCI/5f5eNa/nYmmKszqjjlk/1NbgTohzwkVyCrH+23XFHuEdw1brMhKR4262Jkztl7o=
X-Received: by 2002:a9d:62c8:: with SMTP id z8mr14983090otk.144.1556030425772; 
 Tue, 23 Apr 2019 07:40:25 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN> <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
In-Reply-To: <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Tue, 23 Apr 2019 16:40:10 +0200
Message-ID: <CAArVCkQJExs60PbhXrUtSYS94brHEDNoeHmk0Qpu5aNWN7rTnw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Dmitry Gutov <dgutov@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 yyoncho <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Di., 23. Apr. 2019 um 16:25 Uhr schrieb Dmitry Gutov <dgutov@HIDDEN>:
>
> On 23.04.2019 15:15, Eli Zaretskii wrote:
> > I thought about this.  It could make sense to have a UTF-8 specific
> > function to encode and decode strings.  With encodings other than
> > UTF-8 it becomes trickier, and probably likewise with buffer text,
> > where we need to take the gap into account.
>
> Doing that for buffer text as well might be helpful. Other encodings are
> much less of a priority, I would say.
>
> > What applications do we have where en/decoding strings has critical
> > effect on performance?
>
> It wouldn't be critical most of the time, but even a few % performance
> improvement across the board, basically for free, might be welcome.
>
> So that's why I mentioned decode-coding-string (though
> code_convert_string would be a better choice; or decode_coding_object?),
> as opposed to creating a new specialized function.
>
> What I can understand from our testing, this kind of change improves
> performance for all kinds of strings when the source encoding is
> utf_8_unix. Even for large ones (despite you expecting otherwise). The
> only kinds of input where this should result in a (likely minor)
> slowdown would be ones where the contents do not correspond to the
> declared encoding.
>
> Again, the patch, or several, shouldn't be particularly hard to write,
> and we can try them out with different scenarios.


For starters, the module code in emacs-module.c (e.g.
module_make_string) has essentially the same requirements. So we could
at least move json_make_string, json_build_string, and json_encode
into coding.[ch] (and rename them).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 14:24:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 10:24:42 2019
Received: from localhost ([127.0.0.1]:53947 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwLi-0000Sn-EL
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:24:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIwLg-0000Sa-Il
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:24:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34244)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIwLb-00066x-2R; Tue, 23 Apr 2019 10:24:35 -0400
Received: from [176.228.60.248] (port=4799 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIwLa-0000yG-Dh; Tue, 23 Apr 2019 10:24:34 -0400
Date: Tue, 23 Apr 2019 17:24:28 +0300
Message-Id: <83k1fk4x5v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQVRSAAezsBXVW6CKbn-7cQAYq1OP4=VSd3DdX4LMfk=wQ@HIDDEN>
 (message from yyoncho on Tue, 23 Apr 2019 16:27:59 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
 <CACCVLQX1J3NmKaimWZ2BTaZRz_yEM_o1a1t99dwjDV0nEnJ2zQ@HIDDEN>
 <83sgu850me.fsf@HIDDEN>
 <CACCVLQVRSAAezsBXVW6CKbn-7cQAYq1OP4=VSd3DdX4LMfk=wQ@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Tue, 23 Apr 2019 16:27:59 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  Modules doing what?
> 
> Modules that have to create a lot of strings(e. g. parser module aiming to replace elisp code to get a
> performance improvement).

If they use JSON, the solution is already here.

I don't think we should discuss hypothetical examples, because we can
never time and profile those to see whether string import into Emacs
is indeed the bottleneck.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 14:22:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 10:22:45 2019
Received: from localhost ([127.0.0.1]:53943 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIwJp-0000Pc-0D
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:22:45 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:35112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIwJn-0000PQ-UY
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 10:22:44 -0400
Received: by mail-wr1-f51.google.com with SMTP id o12so17155009wrn.2
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 07:22:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=suwcfV/AfBHKcjYtwaVPhgaOQ+yRxrdSLIgwAHTau9Y=;
 b=Yuj1NlcSMj4ESMQCeKdJ5Vn24HByHgX7pjKE8njEa6am8ZmQPVOvPasiWosPVlPa9C
 ocCV/JZcdoVNMd6cXqQWrpZvAhtO9dsPzXHU7jYv7NHQrPGLvzugdh8Ewq8b9cZImuBM
 stcMTDGtZe8TN5T3Fp8jn5Xf7KR1uJAOTulOmI0Uy1BfnT0xkTpUC/5RGfhrKvWDM00x
 0vYKFSDXbHj+7luPDexwmRom1Ukj1m7e/t03rP9Cn8sc0iZxBeBVLo91Kw7rAPHXdRvf
 91PTGTBCpLXt24DNmMugMEF2zy2ABpx2ZiT8id9x0/Luv+vgRQZRLXuZy04PA9VRuR8P
 TDQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=suwcfV/AfBHKcjYtwaVPhgaOQ+yRxrdSLIgwAHTau9Y=;
 b=c08dND2QefZUYZWehsapCzEOjUKYhwyiQ1L75tfG1ZDGNXeK66ogRPMLjj3qEOD0z9
 qpHu/2V1DtF1dyzfcoUpJq2ijFStC1TT4sUZqFJJFmKZ4FJF7MdEBQ7eH9cRFHh/FBrV
 bIpyadG3OnI2ZpQUMwbpVOEGNVVchN0T0tZV9xJolpsirnLU55+6mkhheGvwFds3vkRf
 szaK5fDR6hl3u5NuqqdNbU96t0bKb2TtOoI98pq9ophtybtkYoKEsPGAtFAJBCWVuUFb
 BixA+eAhBrrtmwMMC29bVxgr9xJ9h+OOME8oK/xVnxsG33J5YYQxYlAiJdat+r/io2qI
 Meqg==
X-Gm-Message-State: APjAAAW4QhiSt1f0Zxe59oSs6DACG/LzbBDQXEm8YePk+XBlafaURz1e
 FbXrEmVTir7PmCmnDvs4fUxlIA+y
X-Google-Smtp-Source: APXvYqz28k2YIAXx+SBkC9YvEx6a+6TQ2bkKH3IkeCtLE18VXkF85+pSY0YPOiVfkZq4kvDjHJ4ToA==
X-Received: by 2002:adf:c743:: with SMTP id b3mr16115020wrh.261.1556029357550; 
 Tue, 23 Apr 2019 07:22:37 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id 204sm19220367wmc.1.2019.04.23.07.22.35
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 07:22:35 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <6308ceff-479b-2ce7-2072-41e683978c7c@HIDDEN>
Date: Tue, 23 Apr 2019 17:22:34 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83wojk534g.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 15:15, Eli Zaretskii wrote:
> I thought about this.  It could make sense to have a UTF-8 specific
> function to encode and decode strings.  With encodings other than
> UTF-8 it becomes trickier, and probably likewise with buffer text,
> where we need to take the gap into account.

Doing that for buffer text as well might be helpful. Other encodings are 
much less of a priority, I would say.

> What applications do we have where en/decoding strings has critical
> effect on performance?

It wouldn't be critical most of the time, but even a few % performance 
improvement across the board, basically for free, might be welcome.

So that's why I mentioned decode-coding-string (though 
code_convert_string would be a better choice; or decode_coding_object?), 
as opposed to creating a new specialized function.

What I can understand from our testing, this kind of change improves 
performance for all kinds of strings when the source encoding is 
utf_8_unix. Even for large ones (despite you expecting otherwise). The 
only kinds of input where this should result in a (likely minor) 
slowdown would be ones where the contents do not correspond to the 
declared encoding.

Again, the patch, or several, shouldn't be particularly hard to write, 
and we can try them out with different scenarios.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 13:28:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 09:28:19 2019
Received: from localhost ([127.0.0.1]:52760 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIvT8-0007IC-Rc
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:28:19 -0400
Received: from mail-lf1-f52.google.com ([209.85.167.52]:37047)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIvT6-0007I0-SO
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:28:17 -0400
Received: by mail-lf1-f52.google.com with SMTP id h126so1124879lfh.4
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 06:28:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=0vwuGvZJuuojjIAP8iJLzPc/u15UihE41+MoGi5zL78=;
 b=RxOWclM34a73S+V+6uMiIML6xbBMI6Qjovwi9gmXf18zvRUnmXlW0WQutvJZlz2FO3
 8OHdMeSZIB4A2nXGrgpQVhrCZHqHweVoO0YZvaZ7/e1hRiA44yNmEWL3GoeMRhy7XtBE
 t1HTQ8K9/25mvsc2NS/ixa1+5j5Aqg4bYWC/NhbbRGoh92fSImMHzxTQpUKd0bGzJAsd
 PmKAfC2v/26hOtQamTnQ0lOfcGum7iy9G34QSB2semybigOSv5J0y0epDDKXj1ekTcbY
 SJmco7cbqj+LlPXQUSAtTzAWEoeVoygn+uJVqWM006Wf5nGLQ4Of9c6wl4B7yNv5wkVh
 hn8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=0vwuGvZJuuojjIAP8iJLzPc/u15UihE41+MoGi5zL78=;
 b=Qg7j1h2yAfPgNtEqFCp+e8xisYfTNqBEOHqsR7iZuKBLQoXQqwb+bE9CJjC6UFUjWN
 V2lCwBlwvqm2LkkX474FK7acnJnblGxV9LJLaY5qpRaQms3VqnH3TqpQJx2eKm38cBug
 mF3PnjiNMh8rUrBclNe97e8NEaHb1L1uOTc5NH1+ZzFTMzjb3gYp704BgBMrl4t1FUOW
 rY2B42DSFkR3vUPWrv8DhdomaLOzRBKsQVH/mmZ7Aw0lYacmLE2FdoRV2/7jRR6Hgoe2
 qlsnwa7Vze34py6psWBuDHjMjMgVdgWmiyluxMNh9Eim/7Oi0WeD6cHuwbrzWLPJfVUB
 nmwA==
X-Gm-Message-State: APjAAAVZUtw+ZRkb2TMpZlDBKGqiYAu6ysYHamxXfRoTuQ5Qlvv+qvqz
 4mqwJNqDnosZi+F6ztJJ2N7Cyf9JV484l5n2L9c=
X-Google-Smtp-Source: APXvYqzh2E8X30hiGbNNfDwAivxRoxlFTlbVSTT5sCWB5Mx6Oako/IsWeD74JRiGsexAuf3gNKo9WIZg522Eoxdr61o=
X-Received: by 2002:a19:8017:: with SMTP id b23mr14525991lfd.12.1556026090975; 
 Tue, 23 Apr 2019 06:28:10 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
 <CACCVLQX1J3NmKaimWZ2BTaZRz_yEM_o1a1t99dwjDV0nEnJ2zQ@HIDDEN>
 <83sgu850me.fsf@HIDDEN>
In-Reply-To: <83sgu850me.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 23 Apr 2019 16:27:59 +0300
Message-ID: <CACCVLQVRSAAezsBXVW6CKbn-7cQAYq1OP4=VSd3DdX4LMfk=wQ@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000069f5d80587328e45"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000069f5d80587328e45
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

Modules doing what?
>

Modules that have to create a lot of strings(e. g. parser module aiming to
replace elisp code to get a performance improvement).

Ivan

--00000000000069f5d80587328e45
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli,</div><br><div class=3D"gmail_quote"><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">Modules doing what?<br></blockquot=
e><div><br></div><div>Modules that have to create a lot of strings(e. g. pa=
rser module aiming to replace elisp code to get a performance improvement).=
</div><div><br></div><div>Ivan=C2=A0</div></div>
</div>

--00000000000069f5d80587328e45--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 13:19:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 09:19:21 2019
Received: from localhost ([127.0.0.1]:52737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIvKT-00072V-BB
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:19:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45579)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIvKQ-000721-Nm
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:19:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33085)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIvKJ-0003g0-M5; Tue, 23 Apr 2019 09:19:12 -0400
Received: from [176.228.60.248] (port=4751 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIvKI-0002cX-Lf; Tue, 23 Apr 2019 09:19:11 -0400
Date: Tue, 23 Apr 2019 16:19:04 +0300
Message-Id: <83mukg506v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <0296121e-42b9-de92-e922-adf77bca0ed9@HIDDEN> (message from
 Dmitry Gutov on Tue, 23 Apr 2019 14:39:50 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN> <83o94y54ws.fsf@HIDDEN>
 <a38ce405-0778-c8c4-b915-6ca84a760bd3@HIDDEN> <834l6p58d1.fsf@HIDDEN>
 <0296121e-42b9-de92-e922-adf77bca0ed9@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 23 Apr 2019 14:39:50 +0300
> 
> On 23.04.2019 13:22, Eli Zaretskii wrote:
> 
> >>> Yes, but I'm slightly surprised why you loop from the end of the
> >>> string and not from the beginning.
> >>
> >> To avoid creating an additional pointer variable.
> > 
> > I don't think it matters, and looping forward is more natural and may
> > even be slightly faster.
> 
> OK. It was mostly a matter of taste for me anyway. (I would be 
> interested in any examples of "slightly faster", though).

It's a hunch.  I think modern processors and their caches deal with
incrementing better than with decrementing.  Maybe I'm wrong.

> significant up-front cost for initializing the decoder, right?

That, and the general disadvantage of going over the text twice
instead of just once.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 13:10:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 09:10:52 2019
Received: from localhost ([127.0.0.1]:52713 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIvCF-0006iW-Th
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:10:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43243)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIvCE-0006iJ-Ov
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:10:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:32923)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIvC9-0001ge-FH; Tue, 23 Apr 2019 09:10:45 -0400
Received: from [176.228.60.248] (port=4233 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIvC9-0001sz-03; Tue, 23 Apr 2019 09:10:45 -0400
Date: Tue, 23 Apr 2019 16:10:39 +0300
Message-Id: <83pnpc50kw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?S=C3=A9bastien?= Chapuis <sebastien@HIDDEN>
In-reply-to: <CAN2Hsvz1smMVuUMj+Hkmvxq8QrZPkLX9-M49m5+EJd3EgD3WCg@HIDDEN>
 (message from =?utf-8?Q?S=C3=A9bastien?= Chapuis on Tue, 23 Apr 2019
 20:37:54 +0800)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
 <CAN2Hsvz1smMVuUMj+Hkmvxq8QrZPkLX9-M49m5+EJd3EgD3WCg@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, yyoncho@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Sébastien Chapuis <sebastien@HIDDEN>
> Date: Tue, 23 Apr 2019 20:37:54 +0800
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Ivan Yonchovski <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
> 
> I am thinking to module_make_string

When/where is that performance-critical?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 13:09:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 09:09:59 2019
Received: from localhost ([127.0.0.1]:52708 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIvBP-0006gl-Fe
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:09:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43063)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIvBN-0006gW-Kz
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 09:09:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:32915)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIvBI-0000xF-3J; Tue, 23 Apr 2019 09:09:52 -0400
Received: from [176.228.60.248] (port=4176 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIvBG-0001le-Ui; Tue, 23 Apr 2019 09:09:51 -0400
Date: Tue, 23 Apr 2019 16:09:45 +0300
Message-Id: <83sgu850me.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQX1J3NmKaimWZ2BTaZRz_yEM_o1a1t99dwjDV0nEnJ2zQ@HIDDEN>
 (message from yyoncho on Tue, 23 Apr 2019 15:37:33 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
 <CACCVLQX1J3NmKaimWZ2BTaZRz_yEM_o1a1t99dwjDV0nEnJ2zQ@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Tue, 23 Apr 2019 15:37:33 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  What applications do we have where en/decoding strings has critical
>  effect on performance?
> 
> Dynamic modules.

Modules doing what?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 12:38:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 08:38:16 2019
Received: from localhost ([127.0.0.1]:52681 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIugh-0005wU-Pi
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:38:16 -0400
Received: from mail-wr1-f65.google.com ([209.85.221.65]:45256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sebastien@HIDDEN>) id 1hIugd-0005wE-2z
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:38:13 -0400
Received: by mail-wr1-f65.google.com with SMTP id s15so19965376wra.12
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 05:38:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=chapu-is.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=/G1BmlYmVRVi/dnUklAsJsux+PE6UD+ufeFO1NZLRYc=;
 b=kbv8S1XFfT3vjktwNVQLcd1ago/xazkyVgG8xOIPwZkBJrVGqmabhRuhzpgNR4XDfv
 4ReVtn3FTUtvsN7RWwmgHJpTJNKiZUiqJeYRSz0PYSmoxKmetJTISzyyZLL9SPwnJ2Qg
 G4g/Tji5ZEvafNcIsllX4xlZFCN7aP8GOVLurOO5jeZhuFeNvjmFvfRLX4RXCHuinAkq
 2rjyshJr7CHh2xKWy+YjE0yUtXiNIslpdMF12POHzQZmyWcDusaou6MiHOZduEr5ix/P
 RW2FbPq6Hr7l3glKpP0Jjw6Fjarmm2/dBui1gKQLU4/iRae9KogkUsEBRigUcOPOq+Uy
 YPDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=/G1BmlYmVRVi/dnUklAsJsux+PE6UD+ufeFO1NZLRYc=;
 b=bODKSqMcGKeotiJdpQF1lp3YGdldbyQEiCXayRiWtWC8U8oadX9pZC+9uLRf+NOd1o
 SMHqJbKRcBYPgjiV+M14pCb1HKOccBckbmDS7bEZkikfOQNu5M6tbi5Sv/sopSj6VJac
 kmnLZtZ+XjOWuhS3WKpP7lGsXpZYMhHoN9Add/Dxa7d65ttdE2JIxVdUd5oK6y+yWySQ
 WexvF076WmLjGyB1nyaCSeOil6WqoHYl1CbbtMo32igD+lZ3BEy9FLMMyyukk0B6AmcQ
 Gy2y7KZahChw8x2yUFbjawciepJcIn7HCTjGm18Q8sOPLKsZQmEGENnxfEDgPVBs2OJ8
 e3kA==
X-Gm-Message-State: APjAAAXP214ygqfOqaz0dbPQxN8HNM3GDhiFcabvyth1ICBZ/0dShs9q
 /duZLD2OigsuxjC+bIzObSwj6cD5R7tywYu/xznF0Q==
X-Google-Smtp-Source: APXvYqyOaccBs2UiyVv2+PAPMVO5WZcAWW38OqZ9IqU1NA2+mAuKSABPzztZLAPAXkN+af38/2KFy/Ye/whxvULiTds=
X-Received: by 2002:a5d:428c:: with SMTP id k12mr17447883wrq.279.1556023085293; 
 Tue, 23 Apr 2019 05:38:05 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
In-Reply-To: <83wojk534g.fsf@HIDDEN>
From: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>
Date: Tue, 23 Apr 2019 20:37:54 +0800
Message-ID: <CAN2Hsvz1smMVuUMj+Hkmvxq8QrZPkLX9-M49m5+EJd3EgD3WCg@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, Ivan Yonchovski <yyoncho@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> And this particular bug report can probably be closed.

I agree, thank you all for working on this.

> What applications do we have where en/decoding strings has critical
effect on performance?

I am thinking to module_make_string

Le mar. 23 avr. 2019 =C3=A0 20:15, Eli Zaretskii <eliz@HIDDEN> a =C3=A9cri=
t :
>
> > Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> > From: Dmitry Gutov <dgutov@HIDDEN>
> > Date: Tue, 23 Apr 2019 14:52:21 +0300
> >
> > I wonder if having this optimization built-in in
> > decode-coding-string or thereabouts could give us performance gains
> > somewhere else as well.
>
> I thought about this.  It could make sense to have a UTF-8 specific
> function to encode and decode strings.  With encodings other than
> UTF-8 it becomes trickier, and probably likewise with buffer text,
> where we need to take the gap into account.
>
> What applications do we have where en/decoding strings has critical
> effect on performance?
>
> > And this particular bug report can probably be closed.
>
> Assuming the others confirm.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 12:37:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 08:37:52 2019
Received: from localhost ([127.0.0.1]:52677 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIugK-0005vV-Hc
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:37:52 -0400
Received: from mail-lj1-f182.google.com ([209.85.208.182]:39239)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIugI-0005vI-R1
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:37:51 -0400
Received: by mail-lj1-f182.google.com with SMTP id l7so13359253ljg.6
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 05:37:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=oi4Flq6YeYQlgGPUsXPkPe+oBE4H6VSZWZ8mxViNjTA=;
 b=VnKqehlOqXlf97YqhFL6m54J8YVySZS9oWKM5jIdGHbRROpo7+Tg738YSMhvonuQFc
 7Gm6ZZ8LGHjUmqi/sMcdG1fjHnQUBggJEl9dWnrWj/jYc77NhRF+8B9l9R09aOC3JBiC
 m4vKetJLMYXAd2hTnqlEKpwy6gUERlXJMFu+Cv7c8YH1GiyroCuQYCpE/6ea6juMWueq
 cGbVTIX2+dFuPu1zLy45P3ZGCIVDwjbb1QS5za7HE4HiQcsP22vegGvF/tqT4N63nfSX
 gy6oQc4MNU+Outb5IHKApQt3BjLISN/6yq6PvpDBKkzGDDh3gDqaNiPCV/mzOP0tKG8v
 A8qQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=oi4Flq6YeYQlgGPUsXPkPe+oBE4H6VSZWZ8mxViNjTA=;
 b=U3Ypprv2WSlIt9siR3eEyXYYR21/xVZW7fCueEICGtvTxc23gId3JaOgvMxqSJ2W4X
 dl4TD6zcFx0gPTmBppv7AkPlz+22GHLJdH57jxj3rHEeMYZ04ugmu78OVQkxdivpgAtJ
 vwt/nhHycqkoi6oASHBkSuSDgP07KBPH6QRAhiow11OBPi48t0B1Kur89lOMFvIUZw+r
 mW0Hdt3iKxHAdCGXRip4Mpq1mhMi2NG19PZL91A2oABt2qmlTUorFXbUbZRYB/5Mcf0q
 AEHBem8ic/glK9rNGTp/IscCcR/7iM4m0O3qFfvg+CMiihY7Z//2SOoF6cIDa6uXNfQV
 wkkA==
X-Gm-Message-State: APjAAAUHAl1lpryin2+sfBdWvg43WCXsiTOjfrLXVag5Q8Q4AaTAHBdP
 7tYUPMt+TGZQKitmsnexQlo/WnTQin9B/6Ja5Zs=
X-Google-Smtp-Source: APXvYqxSDKXjhKvmo5MYOmtAAuMNFfD9tbFB8anL/7k3dvbObal04LqQlLAWeJjCbbDqn/HZG2PxER+vL3E+MhiE/7M=
X-Received: by 2002:a2e:8895:: with SMTP id k21mr2321125lji.43.1556023064849; 
 Tue, 23 Apr 2019 05:37:44 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
 <83wojk534g.fsf@HIDDEN>
In-Reply-To: <83wojk534g.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 23 Apr 2019 15:37:33 +0300
Message-ID: <CACCVLQX1J3NmKaimWZ2BTaZRz_yEM_o1a1t99dwjDV0nEnJ2zQ@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000000af42a058731daeb"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000000af42a058731daeb
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

What applications do we have where en/decoding strings has critical
> effect on performance?
>

Dynamic modules.

Thanks,
Ivan

--0000000000000af42a058731daeb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli,</div><div><br></div><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">What applications do we=
 have where en/decoding strings has critical<br>
effect on performance?<br></blockquote><div><br></div><div>Dynamic modules.=
</div><div><br></div><div>Thanks,</div><div>Ivan</div></div></div>

--0000000000000af42a058731daeb--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 12:16:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 08:16:01 2019
Received: from localhost ([127.0.0.1]:52648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIuLB-0005OG-62
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:16:01 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33477)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIuL8-0005O1-J4
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 08:16:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60205)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIuL1-0005U9-12; Tue, 23 Apr 2019 08:15:52 -0400
Received: from [176.228.60.248] (port=4835 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIuL0-0005lh-HG; Tue, 23 Apr 2019 08:15:50 -0400
Date: Tue, 23 Apr 2019 15:15:43 +0300
Message-Id: <83wojk534g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN> (message from
 Dmitry Gutov on Tue, 23 Apr 2019 14:52:21 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN> <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 23 Apr 2019 14:52:21 +0300
> 
> I wonder if having this optimization built-in in
> decode-coding-string or thereabouts could give us performance gains
> somewhere else as well.

I thought about this.  It could make sense to have a UTF-8 specific
function to encode and decode strings.  With encodings other than
UTF-8 it becomes trickier, and probably likewise with buffer text,
where we need to take the gap into account.

What applications do we have where en/decoding strings has critical
effect on performance?

> And this particular bug report can probably be closed.

Assuming the others confirm.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 11:52:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 07:52:33 2019
Received: from localhost ([127.0.0.1]:52606 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hItyT-0004pF-8S
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:52:33 -0400
Received: from mail-lj1-f173.google.com ([209.85.208.173]:36252)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hItyR-0004oz-4Z
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:52:31 -0400
Received: by mail-lj1-f173.google.com with SMTP id l23so2639093lja.3
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 04:52:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=pyQZuoC1z+xhz7Pw6glmeJS5et0zAC/AMHSoWIY/+Ts=;
 b=joTswp7NEHkTM0oU/b9ZNa386ck7KSFh2EvJ80pFGTq+8x0nJrCYcFmKBniWaUEpgs
 CqKeC+3QJm5gF5M/4Oim7Fzc4DX61ZDPwGdItO907lHdvT8WZ9gznVYgMOZGNDgi/MdW
 lvzqTN7eHiwjv6bjXaTkusWcfDVf+CgIzlDwsD8DsbmNXPR8U3sn/0esOtTMZhgkvV1i
 TQAhc+IpG0y1FpGh0a8ZKRdrsiq64CU+Re64aj16WE8o3L0sl0pbA5NMpglP7R2lPoT0
 LXyRlwMwgbY+1NxtodJgI0rRDbPFFoFolsX6di4UIgX5SINTBKM2sgbHi0p51JXBTIfD
 DH4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=pyQZuoC1z+xhz7Pw6glmeJS5et0zAC/AMHSoWIY/+Ts=;
 b=IJ+5kDO2RjHG6bQFuFaMcDFm7S2irddnOCCUb+H8P1kl3XJ8y7DyuY2TbRC5obrWTG
 7Z99heMDEBZEo71ZWyVDdtCuN8BFSggSpECFKxYsZV8X9ATJCUCDfVOuPpqpbmrawQBJ
 DDidZxviVR3l+e+BnhTivVvcJW6ckDL0SNWrxIWTWt80PCGRVxR8Gl/Oy8VlxWNoMaol
 CUjTy5spnoVrX5jpqWTni0xMEBTXgSDQBsgPuJ0UU3pcJzlzuAR9TdjQA1MAeTZeJtZm
 +E5F3UTnmQ+9zpaW3j6WSUt5ahs9njW01YEbWyl1dHzzvOOz4RT+ubcrHj2MbYgtGlte
 gLhA==
X-Gm-Message-State: APjAAAVQNyigBBtw66K+/TprTtCXrSxeWZndnlnMfrX0qb8qCmOMfan3
 VQMj+LnLtBNQO6hAmvdlkpSm5Mh0
X-Google-Smtp-Source: APXvYqy01yjG4rct8PUmmHraxhMh94jvXrBRljGWIXGkgLb9H3v8eGxmTzy71sw+9Zo8wDT1e8/3mQ==
X-Received: by 2002:a2e:85d2:: with SMTP id h18mr12978997ljj.128.1556020344724; 
 Tue, 23 Apr 2019 04:52:24 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id m4sm3324024ljc.28.2019.04.23.04.52.22
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 04:52:23 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN> <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <83ftqa8qsg.fsf@HIDDEN> <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
 <83muki6y6r.fsf@HIDDEN> <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
 <83h8aq6v6a.fsf@HIDDEN> <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
 <834l6q6ozn.fsf@HIDDEN> <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
 <83zhoi59ao.fsf@HIDDEN> <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
 <83wojm57sl.fsf@HIDDEN> <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
 <83ftq96azk.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <e58af8f3-16ef-41da-b48e-e07ead2dd6f8@HIDDEN>
Date: Tue, 23 Apr 2019 14:52:21 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83ftq96azk.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 22.04.2019 23:28,
 Eli Zaretskii wrote: >> Cc: sebastien@HIDDEN, 
 yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org >> From: Dmitry Gutov >> Date: Mon,
 22 Apr 2019 22:55:40 +0300 >> >> I wonder what concl [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: chapu.is]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.208.173 listed in list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (raaahh[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 1.0 FREEMAIL_REPLY         From and body contain different freemails
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 23:28, Eli Zaretskii wrote:
>> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Date: Mon, 22 Apr 2019 22:55:40 +0300
>>
>> I wonder what conclusions you're going to make from the current results.
> 
> Ask me when I see them.

Asking. :-)

Though you have probably mentioned them in the other email (significant 
up-front cost for initializing the decoder, right?). I wonder if having 
this optimization built-in in decode-coding-string or thereabouts could 
give us performance gains somewhere else as well.

And this particular bug report can probably be closed.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 11:44:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 07:44:58 2019
Received: from localhost ([127.0.0.1]:52593 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hItr8-0004dt-DR
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:44:58 -0400
Received: from mail-lj1-f175.google.com ([209.85.208.175]:36459)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hItr6-0004dd-Lf
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:44:57 -0400
Received: by mail-lj1-f175.google.com with SMTP id l23so2618377lja.3
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 04:44:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=8T5PkBO8xfp4OVzUc6aAMaLepvGDtxcblZUmSFqOBkI=;
 b=I8VGRkqX+GlxFi1f4t8aze0WwIYSjUr+c0yBD1BNpBTuSaWih/6wh8Rtg2LnfH5wOH
 Z5eQ1ZmRalNt7Lb1PsmZ/c2sJnnoqwnx88b4nDqVg6deeCQ7XIlafjaH0Wy2tWcGO1Hv
 s1TjCKtT3eZ98T2vjANwGAf6laP6s+3dw2EQKKb6jTm6EVqpjNSw0x/HwwWRHNanh89s
 C8P8dlxJe8pnYAu/RV4OMBRp+4qMD1IrvXDJeklvgqoiqnqErtH97ekub5e0pexxlBvt
 8LdVt7K6vI/TCEjCJ4p8N2ONmyreDvo7uMmqXat44j7EJNWw1J7VJPQzLlIM+SnR26Ia
 AUQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=8T5PkBO8xfp4OVzUc6aAMaLepvGDtxcblZUmSFqOBkI=;
 b=YAtw0ktipUjkiHbHmns4CP97RG3F8iWA8o6LRgAg41EDtvpa39gcqGX3KfkdYNhyep
 VQ4UVtKIZytbsu+ET2TK7wbEF/gNc+JiFy91MtdKOqDOgPPIDSnXTKEoNm9JWAJk2AUd
 63zTZg/CwKnxjZoA0IE6QpEeMKnNL/S45OuAECycb/s3SYQ1fQtUBjNSqqul+IRgh8Bd
 BAvjrUHkZfNnB1l4G8L8Y38AlpY+L64Lhijm+Ax/wYWzWpPgxiRlYU/9h2c4HDPTyvEc
 G4lvpOguWPTkZT/JUeRx09Nz+WCBxffNCwuZElmkiVu1AqXupZKHlMxkEHNni5CgRu+V
 B6Hg==
X-Gm-Message-State: APjAAAU2MnLy41JNAm8L/jo+8NlEJULa8wsUT8dGkyGRqokf2jfHz2jS
 jjmbt086Z5HrbsKWUyH/nRbzo5+d
X-Google-Smtp-Source: APXvYqza/xjnajvoKxZ84fxzu0FUWeuNI0PZkYj7dlJqtdHR2YGjovyubHugMeoyZXExyYu1Z/9CEg==
X-Received: by 2002:a2e:8149:: with SMTP id t9mr13371292ljg.2.1556019890477;
 Tue, 23 Apr 2019 04:44:50 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id 30sm3284712ljv.79.2019.04.23.04.44.48
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 04:44:49 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Alex Gramiak <agrambot@HIDDEN>
References: <87ftq96gww.fsf@HIDDEN> <83imv56gke.fsf@HIDDEN>
 <87bm0x6cnq.fsf@HIDDEN> <12721b41-c493-8193-b820-9ab4b229f102@HIDDEN>
 <877ebl5sjx.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b2d15b04-e172-f955-abb5-b4759183e2ce@HIDDEN>
Date: Tue, 23 Apr 2019 14:44:47 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <877ebl5sjx.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 6:06, Alex Gramiak wrote:

> I tried making a couple patches in other areas to json.c that I hoped
> would slightly improve performance, which I'll include here for
> posterity. The first one uses json_dumpb over json_dumps, but from what
> I can tell using it is either slower or just within error. The second
> uses the *_nocheck functions where applicable, but the results seemed to
> be quite similar. I suppose this means that jansson's utf-8 checking is
> performant.

You might also want to try it on larger JSON documents, documents that 
include more numbers, etc.

With a JSON string this small, the benchmark loop might be taking most 
of the runtime.

Anyway, thank you for the try and the benchmarking. At this point I'm 
still hoping for larger gains, and they'll probably come from some 
higher-level changes.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 11:40:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 07:40:04 2019
Received: from localhost ([127.0.0.1]:52582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hItmN-0004WV-RE
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:40:04 -0400
Received: from mail-lf1-f53.google.com ([209.85.167.53]:38622)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hItmL-0004Vp-KG
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 07:40:02 -0400
Received: by mail-lf1-f53.google.com with SMTP id v1so2686967lfg.5
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 04:40:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=SNEEZzMt1ieEKeU3kFgFqGneWwNsNv9WrfB13wVyVCM=;
 b=thPN6JsqrBu8fDwWdb+QnkpfeOI1Jn0aqwbLNUZ57Hsc8fuct1yB6JFrX4oaXdigBU
 JKSMAiWASxhhs+/OjC9KqawPhO5/d5CLxAr1jXK7ftXTMQWDMLePm1yDhYr/VHavocla
 FAEeMbuDTf9jkv57P9J3FzG/Sp6ymKIXZkqG9BFGLakfM+wz0IyZ2tOXxSVR3iTCEjSS
 Ul3ECYn/+yuFLiglYkQVXScM4np8rDuUSfEyxbvOXt2x9DHgHK3N20Pq+nQN+26+9NVM
 YsURtMcYhtwjCXDHHVojp8vbusMuQY6gLzfkNt+KxkOcACAwSEAkIbGG592AKv+Nfd3o
 LT1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=SNEEZzMt1ieEKeU3kFgFqGneWwNsNv9WrfB13wVyVCM=;
 b=LuXH1elwOIBxFXfFo1+AzHAf+kJm1aqs5MvnslwoaWNvBi+RCMzwF1W8p+bfE5rGgo
 wYXadLbU2uzwY0MPZ9Znh+ewEPQli0SQBvsNj9FAbnp6qnTdeNMwnfmbJ2edairsr2aU
 s+C3aA59bxD0imIEq01RaMQv303xWQeK+4yG3Gzu2lLlDsVdfibYTyDfWQ05vWpVzAfN
 4egJBTkMpiODIxTDrBnDUb+4/KfKkT9sohq/2QK4sT5gndF1WI/JDfJBV/1W6jfeovin
 EJh+b064PQ+ynARTIcMfmyRkTutO58MY6DR8r2xXJ49UxZkvFPT8PZz7V8w/r+iifQyi
 besw==
X-Gm-Message-State: APjAAAWsbsjUi/B9NexXzE7dqXz99muMiSNCdiyEPwv48hLZbRo7iXQW
 Kv3tadndjGPueEb1ElSmOSJjXaLe
X-Google-Smtp-Source: APXvYqxKEE51YP5PReGx/1k52/wRvwpUJ58aQ9/mt3oHiPDm8haeoS5HDX4L6vGnXlNu4tLB/vSN5A==
X-Received: by 2002:a19:cb09:: with SMTP id b9mr13755216lfg.55.1556019595242; 
 Tue, 23 Apr 2019 04:39:55 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id o17sm3245497ljc.66.2019.04.23.04.39.52
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 04:39:54 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN> <83o94y54ws.fsf@HIDDEN>
 <a38ce405-0778-c8c4-b915-6ca84a760bd3@HIDDEN> <834l6p58d1.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <0296121e-42b9-de92-e922-adf77bca0ed9@HIDDEN>
Date: Tue, 23 Apr 2019 14:39:50 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <834l6p58d1.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 13:22, Eli Zaretskii wrote:

>>> Yes, but I'm slightly surprised why you loop from the end of the
>>> string and not from the beginning.
>>
>> To avoid creating an additional pointer variable.
> 
> I don't think it matters, and looping forward is more natural and may
> even be slightly faster.

OK. It was mostly a matter of taste for me anyway. (I would be 
interested in any examples of "slightly faster", though).

>>> I guess that's expected when the strings in JSON are short enough.
>>
>> Longer strings take a proportional amount of time to encode, though
>> (only 2x as fast per character, IIRC).
> 
> I was talking about decoding.  Assuming that decode_coding_utf_8 has
> some setup overhead before it starts the loop of processing the bytes,
> that overhead will become less significant with longer strings.  And
> indeed, if I make the strings in large.json be 10K characters (can
> this happen in real-life JSONs?),

Everything can happen, but I'm not aware of a particular application.

> the speedup from using
> make_specified_string for valid UTF-8 input goes down to just 40% for
> unoptimized builds and 20% for optimized (see the timing data below).
> But it's still faster even for such large strings, so I installed a
> variant of what we were discussing.

Thank you.

And for small strings, your numbers seem even more encouraging than mine.

> Comparing with json.el shows that we've got 8-fold to ten-fold speedup
> in optimized builds.
> 
> Here are my timings for the various variants ("large" means with JSON
> input where all strings were enlarged to 10K characters):
> 
>    variant                       | unoptimized | optimized
>    ------------------------------+-------------+----------
>    curent master                 |    3.563    |   0.664
>    curent master, large          |  174.0      |  43.34
>    no validation                 |    0.980    |   0.326
>    no validation, large          |  105.1      |  33.13
>    coding_system directly        |    2.962    |   0.660
>    coding_system directly, large |  173.4      |  43.19
>    UTF-8 validation              |    0.980    |   0.334
>    UTF-8 validation, large       |  105.9      |  34.36

0.334 vs 0.644, I like that. :-)

> In all cases, the times are from 10 benchmark loops, after subtracting
> the time used by GC.

I figured we might be saving a bit on GC pauses as well (doing and 
allocating less stuff), but they are harder to time, of course.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 10:44:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 06:44:39 2019
Received: from localhost ([127.0.0.1]:52525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIsul-0001A2-DS
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:44:39 -0400
Received: from mail-lf1-f48.google.com ([209.85.167.48]:39067)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIsuj-00019q-VZ
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:44:38 -0400
Received: by mail-lf1-f48.google.com with SMTP id d12so11360210lfk.6
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 03:44:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=AZVgIuEWSk0OCxq9rcxRLjlqoWT+oOSe0cBumW5yLow=;
 b=Ah1xNcEdNEgwNBDyveRj83eeo01WhmB7XQMbuixM2sWqxqoQJzSFLr0X4Jsvf2qqRx
 Gh0GyCIXasK7jVpnl2fsXeXBKMwj6nmPPcUZwPunoimK9lgJ/eJaZc8F7+9fZuL0GLLb
 zpVU4v+mlcyIqkwedAQTjTq/HnzGoEHoIW4wON5roSTAl4R9a2obl3jKtlHokO8hg1Ga
 RyUjkLsic5e/sBt6S8nAVR80U8y628SA8E9lFja5m3ttgUyppYJFekqi54q30HhGG92D
 aiGgn4ddzoNPiEsMKQ+T1SiTwXYapvN8C/xAGFQcKjlZwrklFtvzrcdYbPoEs9twH3Rf
 UhBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=AZVgIuEWSk0OCxq9rcxRLjlqoWT+oOSe0cBumW5yLow=;
 b=GeUobG1ozNfU9iKuxKh/zij7w7P7fs2RSnQ3GiBc/w7M1XAa3dsgM+efVdT7eyu4Hu
 y+873rqfYU7BmcKXVdt2D3XGN0sEosbaQoKWzvZHlgpsrlcMdTqt+4De93lh75KpLp5y
 PJ10+WbfVMWw+6vC8a6QuBnlIcG2UjXSl6a1O7WIRneP+mJl9ijMAPkftgj1FhePTzJ8
 X5EfUvNVR+90USPMm8fQmSk7Jr0t0GLUYRa4REVOCO5Y8hkfBhU4InlFLS8tSyc1+mWz
 gz+G839XcQe9D+lYSSrJJ4V5KSN7Y+kM/ttmAaca5lqcLMNj03kxYPxQd+gQhzzOzQYT
 IxFA==
X-Gm-Message-State: APjAAAV0tl0epIYBiJpo22hCOv7q2QVcQh2jUQk9UIqIbI6178XnVLGd
 I5zE5MM6dknE3gIDZVgKrmFonhXy
X-Google-Smtp-Source: APXvYqxF+KBsW77d7uelhuS7srADTs75iIa5Y3pyDsgRdW5G0D4ROMfC5RGQMmBVtL1GGGnoAVYHvg==
X-Received: by 2002:ac2:48a5:: with SMTP id u5mr13208924lfg.115.1556016271436; 
 Tue, 23 Apr 2019 03:44:31 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id v11sm3632199lfb.68.2019.04.23.03.44.28
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 23 Apr 2019 03:44:30 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, Philipp Stephani <p.stephani2@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> <83muki54tm.fsf@HIDDEN>
 <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN> <83a7gh5kie.fsf@HIDDEN>
 <CAArVCkRGvG8PSWLj6pNtHa9Vh1O+2dBsrzqDioNYHQs8mpobDg@HIDDEN>
 <83zhoh3t2d.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b1117d17-788f-bdbe-0e1a-b3ad15b49c5b@HIDDEN>
Date: Tue, 23 Apr 2019 13:44:27 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83zhoh3t2d.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 23.04.2019 13:38, Eli Zaretskii wrote:
>> It's special in the sense that both the JSON RFC and Jansson require
>> UTF-8 for interchange, so we don't have to deal with raw bytes and can
>> assume all text is UTF-8-encoded.
> We agreed to disagree about this long ago.  Can we please stop arguing
> about this time and again?

Even if we don't intend to trust Jansson on this, returning valid UTF-8 
is in the contract. So it should be perfectly reasonable to discard any 
invalid UTF-8 strings it returns and signal an error, rather than try to 
somehow decode them.

Leading to easier to follow code, for one thing. Right now it's not 
obvious that the "else" branch should never be taken in practice.

At this point I'm out of arguments. It is, of course, your call.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 10:38:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 06:38:33 2019
Received: from localhost ([127.0.0.1]:52508 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIsoq-00010n-VA
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:38:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39073)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIsoo-00010a-AO
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:38:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58954)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIsoi-0000t0-OK; Tue, 23 Apr 2019 06:38:24 -0400
Received: from [176.228.60.248] (port=2607 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIsoh-0003q4-Q7; Tue, 23 Apr 2019 06:38:24 -0400
Date: Tue, 23 Apr 2019 13:38:18 +0300
Message-Id: <83zhoh3t2d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
In-reply-to: <CAArVCkRGvG8PSWLj6pNtHa9Vh1O+2dBsrzqDioNYHQs8mpobDg@HIDDEN>
 (message from Philipp Stephani on Tue, 23 Apr 2019 11:46:58 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> <83muki54tm.fsf@HIDDEN>
 <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN> <83a7gh5kie.fsf@HIDDEN>
 <CAArVCkRGvG8PSWLj6pNtHa9Vh1O+2dBsrzqDioNYHQs8mpobDg@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, yyoncho@HIDDEN,
 dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philipp Stephani <p.stephani2@HIDDEN>
> Date: Tue, 23 Apr 2019 11:46:58 +0200
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	yyoncho <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
> 
> > The interests of libjansson developers aside, I disagree that
> > low-level text decoding functionality should signal an error, let
> > alone abort.  It is up to the application to decide whether having raw
> > bytes in strings is legit or not.  This is our policy everywhere,
> > including when UTF-8 is the standard encoding, so I don't think this
> > case is special in any way.
> 
> It's special in the sense that both the JSON RFC and Jansson require
> UTF-8 for interchange, so we don't have to deal with raw bytes and can
> assume all text is UTF-8-encoded.

We agreed to disagree about this long ago.  Can we please stop arguing
about this time and again?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 10:22:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 06:22:51 2019
Received: from localhost ([127.0.0.1]:52482 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIsZf-0000ZN-Bc
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:22:51 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIsZd-0000ZB-Vd
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 06:22:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58669)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIsZY-0006a2-7Q; Tue, 23 Apr 2019 06:22:44 -0400
Received: from [176.228.60.248] (port=1637 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIsZX-0002AJ-4X; Tue, 23 Apr 2019 06:22:43 -0400
Date: Tue, 23 Apr 2019 13:22:34 +0300
Message-Id: <834l6p58d1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <a38ce405-0778-c8c4-b915-6ca84a760bd3@HIDDEN> (message from
 Dmitry Gutov on Tue, 23 Apr 2019 00:03:30 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN> <83o94y54ws.fsf@HIDDEN>
 <a38ce405-0778-c8c4-b915-6ca84a760bd3@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 23 Apr 2019 00:03:30 +0300
> 
> On 22.04.2019 20:24, Eli Zaretskii wrote:
> 
> > Yes, but I'm slightly surprised why you loop from the end of the
> > string and not from the beginning.
> 
> To avoid creating an additional pointer variable.

I don't think it matters, and looping forward is more natural and may
even be slightly faster.

> > I guess that's expected when the strings in JSON are short enough.
> 
> Longer strings take a proportional amount of time to encode, though 
> (only 2x as fast per character, IIRC).

I was talking about decoding.  Assuming that decode_coding_utf_8 has
some setup overhead before it starts the loop of processing the bytes,
that overhead will become less significant with longer strings.  And
indeed, if I make the strings in large.json be 10K characters (can
this happen in real-life JSONs?), the speedup from using
make_specified_string for valid UTF-8 input goes down to just 40% for
unoptimized builds and 20% for optimized (see the timing data below).
But it's still faster even for such large strings, so I installed a
variant of what we were discussing.

Comparing with json.el shows that we've got 8-fold to ten-fold speedup
in optimized builds.

Here are my timings for the various variants ("large" means with JSON
input where all strings were enlarged to 10K characters):

  variant                       | unoptimized | optimized
  ------------------------------+-------------+----------
  curent master                 |    3.563    |   0.664
  curent master, large          |  174.0      |  43.34
  no validation                 |    0.980    |   0.326
  no validation, large          |  105.1      |  33.13
  coding_system directly        |    2.962    |   0.660
  coding_system directly, large |  173.4      |  43.19
  UTF-8 validation              |    0.980    |   0.334
  UTF-8 validation, large       |  105.9      |  34.36

In all cases, the times are from 10 benchmark loops, after subtracting
the time used by GC.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 09:47:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 05:47:17 2019
Received: from localhost ([127.0.0.1]:52402 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIs1F-0008Ae-1s
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 05:47:17 -0400
Received: from mail-oi1-f173.google.com ([209.85.167.173]:33006)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1hIs1D-0008AR-Cn
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 05:47:15 -0400
Received: by mail-oi1-f173.google.com with SMTP id e5so10786539oii.0
 for <31138 <at> debbugs.gnu.org>; Tue, 23 Apr 2019 02:47:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=jSuwsgx6PRHfUZIvNVxKrobIoOYfucKpl9D1vo3a6hg=;
 b=fJWxIcAtY0uUAdnI+YvlIuXGUg10ZWd2nMri6mfdJIRf1OBrnoiMDuP8OiDiDfbdDN
 TJp4YpOcVnSPC3GMuU/jAvcGdI3g0gVojgtxsKw6p+PkB9VO2Cvy5CQIdPJDtsrf1/OQ
 LbHN/ElK1qkXhIkCVeV28qizXl9bd6LNZB72+JxTG6XiLwnv/SMTOdFW/c1YXeBhBYXF
 I3lJOIL0FfELcYXMeDyeB5pXY/1sKvn531VKZ1pDcgN2dF5juDzfjbOoMmYeoqY6Qpqd
 7qifbbhfU2opd4ri81UhwcPRaJvLm5JLq5PZMwzAuhQImDaM+8BWCXSDUDFsq9eXrcy6
 KGjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=jSuwsgx6PRHfUZIvNVxKrobIoOYfucKpl9D1vo3a6hg=;
 b=kBU5f6camYU+5wuC8picDUBao34ANo4aubOleExI5LWjwauBSzZUDR3Hi2CfHKdX1r
 J1W+5Oy42Qlls45PYZJlPZhoN7dLwyKAxSa76oZ7bNUNm+SFfmDJci4UG8mkZtwJMcxJ
 2VgsLtdV0IRgIncE+W0tDbMsw3ENE+I8wIzXGwpdNd7e/M9CkafvjKxP/3beG7eObAI4
 SqlJm5GdQQa5rwtYu4Glxp/6wJa+DuIrHJmgTuwr101QI+l28RoFfelth/VzMtUBMd5q
 BxIaZknVDyMtlgKHwQp1emIv549MoB84TMqTwIglr6DOSj/zTo3ohuWdqGhsM3J1xMeo
 JVRA==
X-Gm-Message-State: APjAAAUqrsesFIbcF0VE/ksQT/sIgKM+Gx6awLmPjZ0b3jbyRDp68+NQ
 HhkJ8znvkLsKDBuu1/6mA0NTkQTobPTbwjkY5+c=
X-Google-Smtp-Source: APXvYqxznIBr4eay0ik8taWfm2bJTqchDf2g3JsyvNZMacZMPs08/hX7sAtCispSvhHGV5M+GKMcF/YfS8P1X4u5fnI=
X-Received: by 2002:aca:47d7:: with SMTP id u206mr1202504oia.9.1556012829239; 
 Tue, 23 Apr 2019 02:47:09 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> <83muki54tm.fsf@HIDDEN>
 <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN> <83a7gh5kie.fsf@HIDDEN>
In-Reply-To: <83a7gh5kie.fsf@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Tue, 23 Apr 2019 11:46:58 +0200
Message-ID: <CAArVCkRGvG8PSWLj6pNtHa9Vh1O+2dBsrzqDioNYHQs8mpobDg@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Am Di., 23. Apr. 2019 um 08:00 Uhr schrieb Eli Zaretskii :
 > > > Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN, >
 > 31138 <at> debbugs.gnu.org > > From: Dmitry Gutov > > Date: Tue, 23 [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: chapu.is]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.167.173 listed in list.dnswl.org]
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (p.stephani2[at]gmail.com)
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (p.stephani2[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.0 FREEMAIL_REPLY         From and body contain different freemails
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 yyoncho <yyoncho@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Di., 23. Apr. 2019 um 08:00 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
>
> > Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
> >  31138 <at> debbugs.gnu.org
> > From: Dmitry Gutov <dgutov@HIDDEN>
> > Date: Tue, 23 Apr 2019 01:23:44 +0300
> >
> > On 22.04.2019 20:26, Eli Zaretskii wrote:
> > > I don't think we should abort, we don't do that anywhere else.
> >
> > The key word here is "validation". If certain folks in this discussion
> > are right, libjansson always returns valid utf-8 encoded strings, or
> > intends to.
> >
> > So if we implement fast validation for multibyte strings as well, the
> > "else" branch should never be taken, and it would make sense to abort in
> > that case. Not necessarily abort as in "exit Emacs", but maybe signal an
> > error. The libjansson developers might in the end be thankful for bug
> > reports.
>
> The interests of libjansson developers aside, I disagree that
> low-level text decoding functionality should signal an error, let
> alone abort.  It is up to the application to decide whether having raw
> bytes in strings is legit or not.  This is our policy everywhere,
> including when UTF-8 is the standard encoding, so I don't think this
> case is special in any way.

It's special in the sense that both the JSON RFC and Jansson require
UTF-8 for interchange, so we don't have to deal with raw bytes and can
assume all text is UTF-8-encoded. The test suite contains a few tests
to ensure that passing non-UTF-8-strings always results in an error.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 06:00:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 02:00:30 2019
Received: from localhost ([127.0.0.1]:52187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIoTk-0000gw-IN
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 02:00:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58021)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIoTg-0000gh-77
 for 31138 <at> debbugs.gnu.org; Tue, 23 Apr 2019 02:00:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55349)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIoTa-00066F-Fi; Tue, 23 Apr 2019 02:00:18 -0400
Received: from [176.228.60.248] (port=1267 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIoTY-0004r7-GG; Tue, 23 Apr 2019 02:00:17 -0400
Date: Tue, 23 Apr 2019 09:00:09 +0300
Message-Id: <83a7gh5kie.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN> (message from
 Dmitry Gutov on Tue, 23 Apr 2019 01:23:44 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> <83muki54tm.fsf@HIDDEN>
 <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 23 Apr 2019 01:23:44 +0300
> 
> On 22.04.2019 20:26, Eli Zaretskii wrote:
> > I don't think we should abort, we don't do that anywhere else.
> 
> The key word here is "validation". If certain folks in this discussion 
> are right, libjansson always returns valid utf-8 encoded strings, or 
> intends to.
> 
> So if we implement fast validation for multibyte strings as well, the 
> "else" branch should never be taken, and it would make sense to abort in 
> that case. Not necessarily abort as in "exit Emacs", but maybe signal an 
> error. The libjansson developers might in the end be thankful for bug 
> reports.

The interests of libjansson developers aside, I disagree that
low-level text decoding functionality should signal an error, let
alone abort.  It is up to the application to decide whether having raw
bytes in strings is legit or not.  This is our policy everywhere,
including when UTF-8 is the standard encoding, so I don't think this
case is special in any way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Apr 2019 03:06:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 23:06:41 2019
Received: from localhost ([127.0.0.1]:52112 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIllX-0004Y1-2q
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 23:06:39 -0400
Received: from mail-pg1-f179.google.com ([209.85.215.179]:37402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1hIllS-0004Xl-QW
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 23:06:37 -0400
Received: by mail-pg1-f179.google.com with SMTP id e6so6810935pgc.4
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 20:06:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=nCxl5liqJAVrIul7v3V9om+OtdppXN4ulz8JXzZLEds=;
 b=f+4QkYR+USC4v9mn6/DryxQIO2Lt85JepM5ilv+owK0aBOBXq6bAiRqAh4W/s5VUbN
 fwDcrqgOdaLY8moWSmn/F845jEr1n/5f5AYyxAF1SRCn8+WnajgMsEOnpkXzgmVAfpRH
 DK5EIzMEjWfnr7CUHm7A/FjB/pUOTKBS6qD90E4edinaSdSIITzPYdvnBl6JKwCIBCvL
 sNkETV9adzZcImK7qPLm0aZFHzV0fvQWQ0WyKg/Nj3xvP6gLko4IFPBLnbZtG2z6deRX
 X5fOCwN/n1TD0M/KiU+lD1PyH2F/Y4shhgsRKw2/wgG5xWkWlp0BJ6cmRyNwzyyz/Hcx
 TshQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=nCxl5liqJAVrIul7v3V9om+OtdppXN4ulz8JXzZLEds=;
 b=tTbla+es+iEq6KR+/Urib1cruSXmhJqAOdPXgHbzU2fYqWoWXhzm8RPq5HBx2B0AD8
 VStEmHfLWhWXROV80KLqTCxXwPmEYHj9kBfZFZLbxyhDx8IPZYPOsLJEipMtN3GaKx8M
 GVGMfLkJM0W/K9qY1usNiVaEF7RbfhBZCxT70t/zbH8k1lFk/kBiXIkT94z1+9tUQYYy
 G3BBf41hl3MEWq1NCZkIO5mjTtClIlNl+AHBARlr7gxeqU6MvcEVluJH3HeJ6AD3uHOT
 ksmiZVSZy8SFjJVvZ11zM0VPqWthYuFAAUsAGx/a/uKoPn4WKT/gqs6gEaR5IuslHsyL
 WBAw==
X-Gm-Message-State: APjAAAVCz1iNGIUizPHsfI6/VkR3eOMNLxoxMalDzbmWaflodk96Xiv3
 I4aJXuPsER+8382WtUUAayDxQwNL
X-Google-Smtp-Source: APXvYqzG3fY3peTDSiGmu4zanHX91UZTj/b7LGdYwbOZdG/yTNtGlkZD1PrIOHZRl9zu81unAX8f0A==
X-Received: by 2002:a63:360c:: with SMTP id d12mr21986765pga.404.1555988788507; 
 Mon, 22 Apr 2019 20:06:28 -0700 (PDT)
Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302])
 by smtp.gmail.com with ESMTPSA id i10sm32419566pfj.7.2019.04.22.20.06.26
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 22 Apr 2019 20:06:27 -0700 (PDT)
From: Alex Gramiak <agrambot@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
References: <87ftq96gww.fsf@HIDDEN> <83imv56gke.fsf@HIDDEN>
 <87bm0x6cnq.fsf@HIDDEN>
 <12721b41-c493-8193-b820-9ab4b229f102@HIDDEN>
Date: Mon, 22 Apr 2019 21:06:26 -0600
In-Reply-To: <12721b41-c493-8193-b820-9ab4b229f102@HIDDEN> (Dmitry Gutov's
 message of "Mon, 22 Apr 2019 23:05:30 +0300")
Message-ID: <877ebl5sjx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 22.04.2019 22:52, Alex Gramiak wrote:
>> The following might work, though I'm not
>> sure how applicable this is now to the jansson library:
>
> Peformance patches are 200% better when they come together with benchmark
> results.

Right, I should have explained: I meant that since AFAIU the size of
json_int_t is usually going to be the same size as EMACS_INT, the same
code will usually be generated for json.c. It might bring a very slight
benefit to other parts of Emacs, but not worth fussing over.

I tried making a couple patches in other areas to json.c that I hoped
would slightly improve performance, which I'll include here for
posterity. The first one uses json_dumpb over json_dumps, but from what
I can tell using it is either slower or just within error. The second
uses the *_nocheck functions where applicable, but the results seemed to
be quite similar. I suppose this means that jansson's utf-8 checking is
performant.


Benchmark for the first patch:
  (setq v ["\nasd=D1=84=D1=8B=D0=B2\u001f\u007ffgh\t"])
=20=20
  (progn (garbage-collect)
         (benchmark-run-compiled 100000
           (json-serialize v)))

Results for the first patch: 1.1050s applied vs. 1.1078s without.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=json-dumpb.diff
Content-Description: json_dumpb

diff --git a/configure.ac b/configure.ac
index b4a9b30691..2dba99838f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2982,6 +2982,10 @@ AC_DEFUN
   if test "${HAVE_JSON}" = yes; then
     AC_DEFINE(HAVE_JSON, 1, [Define if using Jansson.])
     JSON_OBJ=json.o
+    OLDLIBS="$LIBS"
+    LIBS="$LIBS $JSON_LIBS"
+    AC_CHECK_FUNCS(json_dumpb)
+    LIBS="$OLDLIBS"
   fi
 
   # Windows loads libjansson dynamically
diff --git a/src/json.c b/src/json.c
index 928825e034..361581c2f4 100644
--- a/src/json.c
+++ b/src/json.c
@@ -31,7 +31,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "coding.h"
 
 #define JSON_HAS_ERROR_CODE (JANSSON_VERSION_HEX >= 0x020B00)
-
+#undef HAVE_JSON_DUMPB
 #ifdef WINDOWSNT
 # include <windows.h>
 # include "w32common.h"
@@ -53,6 +53,11 @@ DEF_DLL_FN (json_t *, json_integer, (json_int_t value));
 DEF_DLL_FN (json_t *, json_real, (double value));
 DEF_DLL_FN (json_t *, json_stringn, (const char *value, size_t len));
 DEF_DLL_FN (char *, json_dumps, (const json_t *json, size_t flags));
+# ifdef HAVE_JSON_DUMPB
+DEF_DLL_FN (void, json_dumpb, (const json_t *json, char *buffer,
+                               size_t size,
+                               size_t flags));
+# endif
 DEF_DLL_FN (int, json_dump_callback,
 	    (const json_t *json, json_dump_callback_t callback, void *data,
 	     size_t flags));
@@ -104,6 +109,9 @@ init_json_functions (void)
   LOAD_DLL_FN (library, json_real);
   LOAD_DLL_FN (library, json_stringn);
   LOAD_DLL_FN (library, json_dumps);
+# ifdef HAVE_JSON_DUMPB
+  LOAD_DLL_FN (library, json_dumpb);
+# endif
   LOAD_DLL_FN (library, json_dump_callback);
   LOAD_DLL_FN (library, json_integer_value);
   LOAD_DLL_FN (library, json_real_value);
@@ -605,6 +613,10 @@ usage: (json-serialize OBJECT &rest ARGS)  */)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
 
+#ifdef HAVE_JSON_DUMPB
+  USE_SAFE_ALLOCA;
+#endif
+
 #ifdef WINDOWSNT
   if (!json_initialized)
     {
@@ -625,16 +637,34 @@ usage: (json-serialize OBJECT &rest ARGS)  */)
   json_parse_args (nargs - 1, args + 1, &conf, false);
 
   json_t *json = lisp_to_json_toplevel (args[0], &conf);
-  record_unwind_protect_ptr (json_release_object, json);
 
+#ifdef HAVE_JSON_DUMPB
+  /* Called with NULL to determine the size of buffer needed.  */
+  size_t size = json_dumpb (json, NULL, 0, 0);
+  char *string = SAFE_ALLOCA (size);
+
+  size = json_dumpb (json, string, size, JSON_COMPACT);
+
+  json_release_object (json);
+
+  if (!size)
+    json_out_of_memory ();
+
+
+  return SAFE_FREE_UNBIND_TO (count, json_make_string (string, size));
+#else
   /* If desired, we might want to add the following flags:
      JSON_DECODE_ANY, JSON_ALLOW_NUL.  */
   char *string = json_dumps (json, JSON_COMPACT);
+
+  json_release_object (json);
+
   if (string == NULL)
     json_out_of_memory ();
   record_unwind_protect_ptr (json_free, string);
 
   return unbind_to (count, json_build_string (string));
+#endif
 }
 
 struct json_buffer_and_size

--=-=-=
Content-Type: text/plain


Benchmark for the second patch:

  (setq v (with-current-buffer (find-file-noselect
                                "~/emacs/test/src/json-tests.el")
            (vector (buffer-substring-no-properties (point-min)
                                                    (point-max)))))

    (progn (garbage-collect)
           (benchmark-run-compiled 1000
             (json-serialize v)))
           
Results for the second patch: 0.7815s applied vs. 0.7962s without.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=json_*_nocheck.diff
Content-Description: nocheck

diff --git a/src/json.c b/src/json.c
index 928825e034..3aa6be7212 100644
--- a/src/json.c
+++ b/src/json.c
@@ -46,12 +46,14 @@ DEF_DLL_FN (size_t, json_array_size, (const json_t *array));
 DEF_DLL_FN (json_t *, json_object, (void));
 DEF_DLL_FN (int, json_object_set_new,
 	    (json_t *object, const char *key, json_t *value));
+DEF_DLL_FN (int, json_object_set_new_nocheck,
+	    (json_t *object, const char *key, json_t *value));
 DEF_DLL_FN (json_t *, json_null, (void));
 DEF_DLL_FN (json_t *, json_true, (void));
 DEF_DLL_FN (json_t *, json_false, (void));
 DEF_DLL_FN (json_t *, json_integer, (json_int_t value));
 DEF_DLL_FN (json_t *, json_real, (double value));
-DEF_DLL_FN (json_t *, json_stringn, (const char *value, size_t len));
+DEF_DLL_FN (json_t *, json_stringn_nocheck, (const char *value, size_t len));
 DEF_DLL_FN (char *, json_dumps, (const json_t *json, size_t flags));
 DEF_DLL_FN (int, json_dump_callback,
 	    (const json_t *json, json_dump_callback_t callback, void *data,
@@ -97,12 +99,13 @@ init_json_functions (void)
   LOAD_DLL_FN (library, json_array_size);
   LOAD_DLL_FN (library, json_object);
   LOAD_DLL_FN (library, json_object_set_new);
+  LOAD_DLL_FN (library, json_object_set_new_nocheck);
   LOAD_DLL_FN (library, json_null);
   LOAD_DLL_FN (library, json_true);
   LOAD_DLL_FN (library, json_false);
   LOAD_DLL_FN (library, json_integer);
   LOAD_DLL_FN (library, json_real);
-  LOAD_DLL_FN (library, json_stringn);
+  LOAD_DLL_FN (library, json_stringn_nocheck);
   LOAD_DLL_FN (library, json_dumps);
   LOAD_DLL_FN (library, json_dump_callback);
   LOAD_DLL_FN (library, json_integer_value);
@@ -131,12 +134,13 @@ init_json_functions (void)
 #define json_array_size fn_json_array_size
 #define json_object fn_json_object
 #define json_object_set_new fn_json_object_set_new
+#define json_object_set_new_nocheck fn_json_object_set_new_nocheck
 #define json_null fn_json_null
 #define json_true fn_json_true
 #define json_false fn_json_false
 #define json_integer fn_json_integer
 #define json_real fn_json_real
-#define json_stringn fn_json_stringn
+#define json_stringn_nocheck fn_json_stringn_nocheck
 #define json_dumps fn_json_dumps
 #define json_dump_callback fn_json_dump_callback
 #define json_integer_value fn_json_integer_value
@@ -394,9 +398,10 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
                table test is not `equal'.  */
             if (json_object_get (json, key_str) != NULL)
               wrong_type_argument (Qjson_value_p, lisp);
-            int status = json_object_set_new (json, key_str,
-                                              lisp_to_json (HASH_VALUE (h, i),
-                                                            conf));
+            int status
+              = json_object_set_new_nocheck (json, key_str,
+                                             lisp_to_json (HASH_VALUE (h, i),
+                                                           conf));
             if (status == -1)
               {
                 /* A failure can be caused either by an invalid key or
@@ -508,12 +513,9 @@ lisp_to_json (Lisp_Object lisp, struct json_configuration *conf)
   else if (STRINGP (lisp))
     {
       Lisp_Object encoded = json_encode (lisp);
-      json_t *json = json_stringn (SSDATA (encoded), SBYTES (encoded));
+      json_t *json = json_stringn_nocheck (SSDATA (encoded), SBYTES (encoded));
       if (json == NULL)
         {
-          /* A failure can be caused either by an invalid string or by
-             low memory.  */
-          json_check_utf8 (encoded);
           json_out_of_memory ();
         }
       return json;

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 22:23:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 18:23:57 2019
Received: from localhost ([127.0.0.1]:51815 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIhLx-0001z8-Ha
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 18:23:57 -0400
Received: from mail-lj1-f175.google.com ([209.85.208.175]:38989)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIhLv-0001yv-Da
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 18:23:55 -0400
Received: by mail-lj1-f175.google.com with SMTP id l7so11634908ljg.6
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 15:23:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=Dr7ZXX4CVeI3HqzN+gL8BbeMPUKpYBrOLv/TOXwjppE=;
 b=sAueOxmiViuWpwS7A/EIdjjI2WKDMQQnzni0v0TyMKIktw+tJZ1R1zZFm3+9MAT9t3
 Zm0leqXwSL2yZshCw1lsDK3AMgsbm1tocuNxBldU9p6xbGV9nMtati08K/zbtTo7gj84
 hp+dpuelQDmNQmwn1T5TrsEWYq/AKGcCCbM7R8a/fc8euSuHEe6hugKDv6OVRGf148Qt
 dCCfDDmoLh71jbUq6yJVjsgDoYn8XKKmcL6jd98jibghzFBSW5Sa8NRFa4/YLR436GiO
 74H/edDDxdEfYFog5Z2JmyJSi5HIQ5VZE9oRkuByEjDrWLlsOjteLElZ/u3JzyOJy3Cs
 LYZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=Dr7ZXX4CVeI3HqzN+gL8BbeMPUKpYBrOLv/TOXwjppE=;
 b=CLPWxr11dYwCBp2suArT12WxtuGDxpO/OubvZbydw95CuvfJtiI2b2ur8XCdeIXVC5
 DHg4jzMhrPVe3nfRAW+JzNSWbyXC1XZSY8bW4iJ+wD0aaTS58L//nnqw4QAxSuAfKCc2
 PdrhqVoCa4Rbf8qoLRMp+xk/rPzroXc/X/hVro16DeOxarjsqoA6FmjzhTSfW12hnMVS
 sNyOqIqiPzaxvbuZHLxiwBtYJdf6v+Ih/kiIyPLAM8z04npvUMjRTfIvAjK1Ie4FmX9H
 CjFvO/aOZutMTvkv3sng/GRW9D3MidEeFoPfZj9MP4/OBLThVOE7SNcDiKnE0Nvek5Lk
 0nAw==
X-Gm-Message-State: APjAAAWONHVlrn6D5JtoquY3+LAeXfXfc+SdrU0LRH1qnAhcTX/bUvUW
 +Mh/dSn6FJHCEOM8B4dbdxhwAWIZ
X-Google-Smtp-Source: APXvYqxjq8j4MaqInxqLV84Us38oebA/u+cEmeVZ4tO+IK8/5bQBtMIRiRP1wA9yNGaCTtNWwGrBFQ==
X-Received: by 2002:a2e:9918:: with SMTP id v24mr11599406lji.181.1555971828959; 
 Mon, 22 Apr 2019 15:23:48 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id o79sm3247156lff.50.2019.04.22.15.23.46
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 15:23:47 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> <83muki54tm.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <d43e6c65-8ae3-d88c-8738-38026dc08a22@HIDDEN>
Date: Tue, 23 Apr 2019 01:23:44 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83muki54tm.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 20:26, Eli Zaretskii wrote:
> I don't think we should abort, we don't do that anywhere else.

The key word here is "validation". If certain folks in this discussion 
are right, libjansson always returns valid utf-8 encoded strings, or 
intends to.

So if we implement fast validation for multibyte strings as well, the 
"else" branch should never be taken, and it would make sense to abort in 
that case. Not necessarily abort as in "exit Emacs", but maybe signal an 
error. The libjansson developers might in the end be thankful for bug 
reports.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 21:03:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 17:03:42 2019
Received: from localhost ([127.0.0.1]:51732 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIg6I-0006M8-Cm
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 17:03:42 -0400
Received: from mail-lf1-f45.google.com ([209.85.167.45]:38098)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIg6F-0006Lt-U1
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 17:03:40 -0400
Received: by mail-lf1-f45.google.com with SMTP id v1so1191607lfg.5
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 14:03:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=NfK4sDmNLUCSmfR1jCSPxigqExsasjG0MNTnFxi02Uw=;
 b=E59n99Os1gfYT89AUZdIJrY7GVxdUz8oQiEb+l7cdCGpVkHvqYHZQLAWgmrPpo+H32
 YFugGUkz4BHATdPqQy6hsiRcOg1Eh2wztSIEKFPC63efek0MHmUhBw8yx25F76Cm0Fu9
 6yiS40EJDwnUGkPHpzdz9PJeTgB/4Um4TyYfRBUrAYkMarMJr5Qqi7T/8ITUKLD88uW5
 mb23lb0q8cl3NzqgPsJq0UHH+qOntsROvN/lcRKp6fhIcwp9P7C7R1q/RkT7+7DrNbzN
 rt1UqZqb1pGcWqb8sU7aClWKtuMN/4dIDP1+vtYSBvoOndPSw4ZiYa4sqqlKOoHIfjb9
 QX4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=NfK4sDmNLUCSmfR1jCSPxigqExsasjG0MNTnFxi02Uw=;
 b=budV8hYOaIMt+IZt3GfzAcMsIFwT1kQE2Q4hNznjvj5qGLCDjZd+azrZXexUdKBovT
 tkidRway0e08md2E6WtmiFkZvq2CrABVXrKkGGfyU1v53lp4zjJ/ND8ouKRrlcp6u9v5
 5RZWj1qzFKmggjjc7e/vClrpkzIR1do9U5xCSE7EhKRD4yC2UQrgLbiyBvO6Gxa4hw7+
 9T6mml4/roNiJg7fjSteSj8v/UfhtwVTDe9jWLVfjRClCj8cmWiWv1OPnMMtaeMbasXB
 /3tD5ZMgyjeeLHaPV63JIV+yyDbOTONH9rYDcieEBbnBE+Tla2VvjiUcdhuhbNbY2GoS
 FREQ==
X-Gm-Message-State: APjAAAUMWCO6QUsJihoeTJXi+4Z5CX9z+SKisDHOHciwuv8CYoMD7bB9
 4Ce2Q+TAKJEQTL2g6rmLa2mDU2wj
X-Google-Smtp-Source: APXvYqxR1+T0StxokFhIrwB4sFhN3t2NhigpEaIsZBZByUpGsobHe5yLdPcHGGtLES4KqaVMQjF3rg==
X-Received: by 2002:a19:c51a:: with SMTP id w26mr11996392lfe.59.1555967013940; 
 Mon, 22 Apr 2019 14:03:33 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id 77sm2901821ljs.58.2019.04.22.14.03.32
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 14:03:33 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN> <83o94y54ws.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <a38ce405-0778-c8c4-b915-6ca84a760bd3@HIDDEN>
Date: Tue, 23 Apr 2019 00:03:30 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83o94y54ws.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 20:24, Eli Zaretskii wrote:

> Yes, but I'm slightly surprised why you loop from the end of the
> string and not from the beginning.

To avoid creating an additional pointer variable.

> I guess that's expected when the strings in JSON are short enough.

Longer strings take a proportional amount of time to encode, though 
(only 2x as fast per character, IIRC).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 21:00:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 17:00:45 2019
Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIg3Q-0006HX-SK
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 17:00:45 -0400
Received: from mail-lf1-f68.google.com ([209.85.167.68]:42451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIg3M-0006HH-KM
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 17:00:41 -0400
Received: by mail-lf1-f68.google.com with SMTP id w23so9966936lfc.9
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 14:00:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=TXqN5Ajabxn8clUKzJi/55XQg/1/m/xfDEhdoXzAQZI=;
 b=PK5Ob1oazoyEc5UIPripxTSAE1p/okP9MVURuPeP0zRHPmk3ZG+aHmXUl7u+7wOcQ7
 +7GyXIThVXI88VxXf/tmr/8ZV4vzzU1+0ettLbWOunAjIHjINdgrMQuze+ZR3q+hDREd
 RtFID0wQdaORA8f9xJ6MLQITnSYyS98XW3Hh5D+wkByzU95p0THomg6vlUd6Z85AaiB7
 AGHxZaUjrii+iLFoz9Z9xy1K90uQevFXMB8oUMBRjBAySlgdOfq6QY1yAvNbaaGzWBUW
 MFZv3eEsPPn8EuGYOQ/QFfjVwC0MmR47msjjM2F1c6ncR9b3usrIveoFXUvUINnpgsuU
 1tlw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=TXqN5Ajabxn8clUKzJi/55XQg/1/m/xfDEhdoXzAQZI=;
 b=B1Wu3ZoVWLtxrTFLyCbHj8NlyU1bverFk9EQHKu2FpmoMYqums+EGbRhTg9JNbmI12
 deELVPDEvXQZcACuTS6YuxV/C9sLKHS9vbuI2GdV/6PwXL9vmjftxwz6LYBV9O2p7WIl
 VHb9Ohoapbiz29EV4IbCKL1UTdtHJyTtcZsIudxkoArlEYaglnPzj9UJxNKBG3MlGG2o
 Nz0iN76KGLN0dFk5ldr7WBiyFxZRQ2ZmsjNhQYbFYwQ/zpkZYH51qCKubc5tnTPhPVat
 l5csqsSPwMrxiGgaIgk7cICwowzkODzq+Ya98woLkdpCg3olByBzSxCsVgTKoXFViTrm
 OfGw==
X-Gm-Message-State: APjAAAUN+6lefmdokF3lKtUu9JlPsL6CReIT17QkVAt0tc7iadlG+L9M
 7SNbtH94ld9arOgOTb3H6b8vn6qW
X-Google-Smtp-Source: APXvYqyghOF6OV+uO3Bft8kL3cRFrLLoVo0BfGD39Tyuy93JXiJvta+hDxHh8DUl4TkbDbnPWaQ0Rw==
X-Received: by 2002:a19:7d42:: with SMTP id y63mr3562910lfc.92.1555966834072; 
 Mon, 22 Apr 2019 14:00:34 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id s24sm2908771ljs.30.2019.04.22.14.00.31
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 14:00:32 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <83pnpe55hp.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <46f710a2-1e2d-335e-99cf-340fd84b4ef8@HIDDEN>
Date: Tue, 23 Apr 2019 00:00:29 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83pnpe55hp.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22.04.2019 20:12, Eli Zaretskii wrote:

> Like this:
> 
> diff --git a/src/json.c b/src/json.c
> index 16500bc..48aeccf 100644
> --- a/src/json.c
> +++ b/src/json.c
> @@ -225,8 +225,12 @@ json_has_suffix (const char *string, const char *suffix)
>   static Lisp_Object
>   json_make_string (const char *data, ptrdiff_t size)
>   {
> -  return code_convert_string (make_specified_string (data, -1, size, false),
> -                              Qutf_8_unix, Qt, false, true, true);
> +  struct coding_system coding;
> +  setup_coding_system (Qutf_8_unix, &coding);
> +  coding.mode |= CODING_MODE_LAST_BLOCK;
> +  coding.source = data;
> +  decode_coding_object (&coding, Qnil, 0, 0, size, size, Qt);
> +  return coding.dst_object;
>   }
>   
>   /* Create a multibyte Lisp string from the NUL-terminated UTF-8
> 
> 
> How does this fare in your benchmarks?

It's not nothing, but it doesn't remotely compare to avoiding the 
decoder entirely. Here's a table with different patches and 
corresponding timings. Your last patch is at the end.

I have to admit that somehow my previous measurement of the "none" 
performance was off, maybe due to cold disk cache, maybe due to busy CPU 
or whatever. So it's not 51s but faster.

| patch                        | runtime (s) |
|------------------------------+-------------|
| none (current master)        |        36.8 |
| no validation                |        21.7 |
| ascii_only check             |        21.8 |
| using coding_system directly |        34.5 |

I have also tried your suggested scenario (where the file is read only 
once), but it made the "none" case faster by 2 seconds. So I decided 
against repeating all tests with it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 20:28:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 16:28:32 2019
Received: from localhost ([127.0.0.1]:51704 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIfYG-0005Qm-MI
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 16:28:32 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51583)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIfYE-0005QZ-Cj
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 16:28:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47355)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIfY8-0000hW-KE; Mon, 22 Apr 2019 16:28:24 -0400
Received: from [176.228.60.248] (port=2029 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIfY7-0003Pp-H0; Mon, 22 Apr 2019 16:28:24 -0400
Date: Mon, 22 Apr 2019 23:28:15 +0300
Message-Id: <83ftq96azk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 22:55:40 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
 <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 22:55:40 +0300
> 
> I wonder what conclusions you're going to make from the current results.

Ask me when I see them.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 20:05:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 16:05:41 2019
Received: from localhost ([127.0.0.1]:51667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIfC9-0004qa-Km
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 16:05:41 -0400
Received: from mail-lf1-f45.google.com ([209.85.167.45]:44618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIfC8-0004qN-DO
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 16:05:40 -0400
Received: by mail-lf1-f45.google.com with SMTP id h18so9845336lfj.11
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 13:05:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=FlHkO80gNpaJngZVWRez9QQwnYC2uPeT1R9/zJVogm0=;
 b=BSAU9+Ted4hakRGjMQFQnrpY/NgAG1U6xFy2L3iJEiK+BquQSTZN2DfloWqzd62X7r
 VPBbwlqaEppYTbQdX/AQOXGdpYBXAeDF7FDvC++0p9dZkC4CIeiTEPuAeXjydZb8Fdvj
 3g/O/YybN/A5OUGiFyh9QDcCrSiQyPKEI+/Wwvs3B/6D8aN69y4SV/adQ1bM1YS3BIWA
 Cyqw201PQuLaWImP4uGkHdvQq2tJwfcp3WaD9BlHD1FZG8mwsM3SsXEzTG0MlJvkam9H
 stG2p+Jqjecvo5KtTMTjAXThh4v7wdhcOhP5e2MznK4Z680NYRFKWkk6LBjsdi35sDew
 emjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=FlHkO80gNpaJngZVWRez9QQwnYC2uPeT1R9/zJVogm0=;
 b=tMTg4z6SxAAFjxHARFvtJNCyB2XNiEUe0OBr2rq2sHngM3p2d/s0x0LuGJV8xeuOa8
 9IKaCccCA+GYJQH4fU0LkeJkLGg7Z+YfdtbjfN3FWtTcFk3sQL9vJXqn3Ogpir786zHR
 Tkj4Sra9NqKGXXpgP3698gQrHjBZ3rpMghO8AdmUUvOPBzXvG93UtjqA8xQjCXsfnLKl
 0vVLzdviZaGQS3Km4RIhR521RXlrwmAvuXSucapl7bv+GDkeiGJmfZjuF3Jj5jmwyoDb
 SoC3GTrvZx2dn+eOPslgg31KTmY0dKzd5m5fV1WackrJ+y5FWKiTOm/37u0KT4NeOLgX
 FRgA==
X-Gm-Message-State: APjAAAU2zz6QImJ5I7kVnMXAWPdklA+rw2Ldi/FlqMpOo3IgKvvOoJRZ
 yE8wm9339WWe3MmCgFy8h54fjZ9D
X-Google-Smtp-Source: APXvYqy8boLYzdoB0FMLafFwjh/q3HCDvhIBe7oFQs+1CuvyxW/jGQxGpJJIHlb7RCut4/hbB+h1cA==
X-Received: by 2002:ac2:51a1:: with SMTP id f1mr3835996lfk.129.1555963534369; 
 Mon, 22 Apr 2019 13:05:34 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id w22sm2804630ljd.42.2019.04.22.13.05.32
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 13:05:33 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Alex Gramiak <agrambot@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87ftq96gww.fsf@HIDDEN> <83imv56gke.fsf@HIDDEN>
 <87bm0x6cnq.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <12721b41-c493-8193-b820-9ab4b229f102@HIDDEN>
Date: Mon, 22 Apr 2019 23:05:30 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <87bm0x6cnq.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 22:52, Alex Gramiak wrote:
> The following might work, though I'm not
> sure how applicable this is now to the jansson library:

Peformance patches are 200% better when they come together with 
benchmark results.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 19:55:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 15:55:53 2019
Received: from localhost ([127.0.0.1]:51657 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIf2f-0004ZT-CI
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 15:55:53 -0400
Received: from mail-lf1-f44.google.com ([209.85.167.44]:39098)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIf2d-0004ZH-Ux
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 15:55:52 -0400
Received: by mail-lf1-f44.google.com with SMTP id d12so9857785lfk.6
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 12:55:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=MSTkMV9N9ZdfNUouLDmyiMi1KcKLXsakRmSV/PSie18=;
 b=HorkrNVCECpkeCVe75Q0ekTPNf75WoPXOExywzkALW3hxpbZtKH4efQWMCobNbw/Mg
 B6+owVA3w/IzjGzyU9oP47KPhUhrSZDWOu11A7y1yTAmDLyda9xJXU1jnIawyb7hpzKY
 4ajYF6jZeHknz2lMhf3uDxY12czJnujxojblHP/2oP7cKwrPXkqaukLKhY32rqS5hkOX
 dUQfLCoRsywzMoqVWxAQgPmCxb8i3FJ41+eIwkUKXPCgdWBrLFgUoTATGdGmtNhkt5Uv
 ysa1TsJCPBbWEBAdfRVgCB5SSRVtfef2zNBfkhcfhxY2Vuz2gbQSXLoT3qhhK0s441Fv
 lbDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=MSTkMV9N9ZdfNUouLDmyiMi1KcKLXsakRmSV/PSie18=;
 b=onB6a+raznluAe0Z1cE9tGSGIeNfpnDPQePPbyTwlM4HfkNTRqGE0jK1ilZzRDfSiN
 gzSzFPLQ1/WiAMKhtZnZt1XzvJJJ6NdaWSGGR1T6Z7594QQrGnigCht7P/YFfMoTjxPX
 YvCvneHlt2NN9THIhQBRRnz7eaIvVQjeKAd5EdAIJnwmCL27h/s4kHcswOvAnmuAjDuF
 QhAJsOVCWEUesejVJbDUTxzR/yFWmG4rC25DCSy1QCGRG9rJzoSNa8Qwif5eXmKQxSIV
 xHV1g3SPOROjfL/9dbeuAiWLx2tfLLetFsLSFuwFeEiVwFhOEKvjNta+qBlnMxMbLp1M
 WYEg==
X-Gm-Message-State: APjAAAXXlY0/+HxpWZ25i9bLdyKZ6oE/VDZgYnZ14TCjjPqmfxLucqGe
 8jRn7lh7awEqJDVHXovACFZIlgbf
X-Google-Smtp-Source: APXvYqwhcE1gXCrH2y9EXeT/s4GNx93K+Qx25KEJmwdnkKlsqYDgw+eyt1nZ4Q0LPNG+H5REdW1r3w==
X-Received: by 2002:ac2:52b1:: with SMTP id r17mr3480207lfm.39.1555962945386; 
 Mon, 22 Apr 2019 12:55:45 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id y20sm3213470lfe.8.2019.04.22.12.55.42
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 12:55:43 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> <83wojm57sl.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b3b1dd84-cc3b-e3dc-b034-b95608a8f3a5@HIDDEN>
Date: Mon, 22 Apr 2019 22:55:40 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83wojm57sl.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 19:22, Eli Zaretskii wrote:
> You and others are welcome to profile the code looking
> for opportunities to optimize even more, but I'd be surprised if you
> find something significant.  In particular, UTF-8 decoding validates
> as part of the decoding loop, and is already optimized for ASCII, so
> it will be interesting to see what kind of gains we could have in
> json_make_string by testing for ASCII up front.

I wonder what conclusions you're going to make from the current results.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 19:52:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 15:52:18 2019
Received: from localhost ([127.0.0.1]:51647 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIezC-0004Tk-AK
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 15:52:18 -0400
Received: from mail-pl1-f170.google.com ([209.85.214.170]:46810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1hIezA-0004TU-Sn
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 15:52:17 -0400
Received: by mail-pl1-f170.google.com with SMTP id o7so4034122pll.13
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 12:52:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=sxofnjW+ZIVAt1iDYiU4m8WwvRYEd4ZMF46HuhfzNkA=;
 b=buSUsAkCd9VbEu3AWxqdVngtbVW2p3EdTwVYhwacGcquPNXyuCVIwLLZqoBRR7Yc1g
 PFSYcjvHJ/VPcwMWzxrGat6aWZ4UNoMy9wqg53MklfFEp7/GrPwJ/q83saYGSUkye7F4
 eZnli3G0/5iULeyfMw1rSa03/dOQf/EbZXECfMOjQTYJRxYYfoH0LKrp3ba8OiT7EySn
 XToh+XnwcdRlm3YhKaZ4mCjGrHokLLuLG0SgwfJzemY67pR9arzNoxyxlmqM7eagk3w+
 egsSp2ENnC18B4thg5KfAcsguxsW/9PDUROGerhzT1mzPJId/K6QydlyaUo0EgGogkjd
 NeUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=sxofnjW+ZIVAt1iDYiU4m8WwvRYEd4ZMF46HuhfzNkA=;
 b=p72915Sf7f9ASTh13uJejMvFVsifFPQeyx1WMuE/t487HygZDeVMKSAauZn2l+31jO
 tyOUyfWvfcaZs5HejdmnOSP1Vl9SJorYzckKdmiiiLvxcha+Qh+aGi0DqdjqtwcaASgX
 ArRMpRX+LEWyeamBBd8SO2jWEcqefUL+K3AtRa0mxYqxVrpSsRnL6MkKa8SSf3nE2BU1
 wJMxCYmdadKghPB9C734DjfTIc8m7mdMxbKTj1FvG2J4dR3M/eNjesMqybymp5RKm0lt
 +lEBvobnda59mQNKSNrjBIKUy8osg9aM+UqICdjR3vViigxRFsoBNlsRhg5nv6KbOsNd
 6y3A==
X-Gm-Message-State: APjAAAWYMhUga5jhU8hqX/TgI07XbyRvNYyOKNItnb4FIeFnGjwxNHfp
 Xp12wjOP1Ck9gE2x85udjRQ=
X-Google-Smtp-Source: APXvYqzsb1kXw2B0jATxjfZa4UosIIb2GJfO7wL9RzDk8ir/sZXtUNRov2cBVjhQMTP1vqEv/KB/mg==
X-Received: by 2002:a17:902:4a:: with SMTP id
 68mr22312117pla.212.1555962729729; 
 Mon, 22 Apr 2019 12:52:09 -0700 (PDT)
Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302])
 by smtp.gmail.com with ESMTPSA id u17sm17681029pfn.19.2019.04.22.12.52.07
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 22 Apr 2019 12:52:08 -0700 (PDT)
From: Alex Gramiak <agrambot@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
References: <87ftq96gww.fsf@HIDDEN> <83imv56gke.fsf@HIDDEN>
Date: Mon, 22 Apr 2019 13:52:09 -0600
In-Reply-To: <83imv56gke.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 22 Apr
 2019 21:27:45 +0300")
Message-ID: <87bm0x6cnq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: dgutov@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Alex Gramiak <agrambot@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
>> Date: Mon, 22 Apr 2019 12:20:15 -0600
>> 
>> P.S. Would applying the following diff be okay? It's a simple
>> optimization that avoids an overflow check (the sizeof comparison is
>> optimized out even in -O0)
>
> I don't understand what this optimizes, since AFAIU INT_TO_INTEGER
> already produces a fixnum if possible.

I was attempting to avoid the FIXNUM_OVERFLOW_P check that make_(u)int
does, but I wasn't taking into consideration that EMACS_INT can hold
non-fixnum values due to bits needed for the Lisp_Object tag. You can
disregard my previous diff. The following might work, though I'm not
sure how applicable this is now to the jansson library:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=sizeof.diff
Content-Description: sizeof

diff --git a/src/lisp.h b/src/lisp.h
index c2cb89de9d..c45e35178e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2661,8 +2661,10 @@ make_uint (uintmax_t n)
 }
 
 /* Return a Lisp integer equal to the value of the C integer EXPR.  */
-#define INT_TO_INTEGER(expr) \
-  (EXPR_SIGNED (expr) ? make_int (expr) : make_uint (expr))
+#define INT_TO_INTEGER(expr)                                    \
+  (sizeof (expr) < sizeof (EMACS_INT)                           \
+   ? make_fixnum (expr)                                         \
+   : (EXPR_SIGNED (expr) ? make_int (expr) : make_uint (expr)))
 
 
 /* Forwarding pointer to an int variable.

--=-=-=
Content-Type: text/plain


The above assumes that INTTYPEBITS is less than 8, which I suppose could
be put in there as well as a sanity check.

> Not sure what you meant by "usual case".

I just meant the case where json_int_t does not have a greater size than
EMACS_INT.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 18:28:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 14:28:24 2019
Received: from localhost ([127.0.0.1]:51586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIdfy-0002RE-OI
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 14:28:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIdfx-0002R2-1J
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 14:28:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45690)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIdfj-0003RV-KD; Mon, 22 Apr 2019 14:28:09 -0400
Received: from [176.228.60.248] (port=2573 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIdff-0005pF-6d; Mon, 22 Apr 2019 14:28:05 -0400
Date: Mon, 22 Apr 2019 21:27:45 +0300
Message-Id: <83imv56gke.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alex Gramiak <agrambot@HIDDEN>
In-reply-to: <87ftq96gww.fsf@HIDDEN> (message from Alex Gramiak on Mon, 22
 Apr 2019 12:20:15 -0600)
Subject: Re: bug#31138: Native json slower than json.el
References: <87ftq96gww.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: dgutov@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Alex Gramiak <agrambot@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 12:20:15 -0600
> 
> P.S. Would applying the following diff be okay? It's a simple
> optimization that avoids an overflow check (the sizeof comparison is
> optimized out even in -O0)

I don't understand what this optimizes, since AFAIU INT_TO_INTEGER
already produces a fixnum if possible.  It sounds like a step
backward, because the whole point of INT_TO_INTEGER is that the
programmer doesn't need to bother about the magnitude of the value.

> in the usual case of a JSON integer fitting into an EMACS_INT.

Not sure what you meant by "usual case".  Does this include a 32-bit
build of Emacs?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 18:20:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 14:20:28 2019
Received: from localhost ([127.0.0.1]:51578 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIdYJ-0002FV-QQ
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 14:20:28 -0400
Received: from mail-pf1-f174.google.com ([209.85.210.174]:44083)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1hIdYG-0002FH-E6
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 14:20:24 -0400
Received: by mail-pf1-f174.google.com with SMTP id y13so6075653pfm.11
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 11:20:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:user-agent:mime-version;
 bh=dJnUItwkpWyb26ifaW60XZVmNIrEITEi4+ngAnn8P9s=;
 b=hhlm7Ly89Fex7GkYfn2yWE3wz6LP4wukQGath7qoYliwSYQhDDiTBS2Y833sjxvvME
 L5DWK0SUlx+pplsvR7pH9hsjfaEU5jVJjYiwimijVRcufpJEb/ag4Cozfw7v5bGnkQ/6
 15QStdLJoFebVU9Ty44JInwu526CWmor8F/VMXkWxOfnWceuqYXFGaZmkJPo6rTXHqqx
 CkN+/dQYrCEvFMCuM91k5rryoC2VsqmrjsO5H7CYtOGGAcw8QFSLlTNKyEEVmXwPfzSp
 0qiP7hh7OMXmyo0yt2YXjBPz/AvljnoVSrifpC3/qpUjJs+TSY3moS6pszoAevnHE4T/
 rOtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :mime-version;
 bh=dJnUItwkpWyb26ifaW60XZVmNIrEITEi4+ngAnn8P9s=;
 b=tKdQxUm2sMZnZHg1Z8s8oapLK5ZyhYQg2VvcIKTGPCsfz88bxFTeXlcYeF1CFaeyS4
 Zx+yYv6dXr/kU06QMeh2Wo0Sj3koiM2dWk0xUqYQQGSwL16sZmMtWbRtalxpq8QyFUlA
 pEB0lJrLIkcIoCGZ/VcL5HK0vPD8kuF2/GG82TRDiFY/DPhwOCRtVNNOx2KPdZYtN/+V
 FmSO5j7dc6VCPkSo7Kr2objB0hG7vgCw431YkzSSnxqVQCbFFg1C62cu8wA3Ng4xHvZn
 snaQSwYQwcePoZc0WjQ3HgaBhBd4V+daItjns50Y2sHrXMEnkeJf8geGydVf/gghbTxd
 /XGQ==
X-Gm-Message-State: APjAAAVhRoZFWvzQjkLnFiB82MjMv/unqvES2KrcQHkW+5JyJC52dA0j
 2bToGS9wh3whVdJEklDm6ug=
X-Google-Smtp-Source: APXvYqwVXzdtJumRAmdWCq+kLWebn6FZ3kO8npPoqTQwr06OqBdPUdXcqUzN1N2ZIwQSufHBWkHSjg==
X-Received: by 2002:a63:4144:: with SMTP id o65mr20202565pga.241.1555957218632; 
 Mon, 22 Apr 2019 11:20:18 -0700 (PDT)
Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302])
 by smtp.gmail.com with ESMTPSA id e16sm243742pgv.89.2019.04.22.11.20.16
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 22 Apr 2019 11:20:17 -0700 (PDT)
From: Alex Gramiak <agrambot@HIDDEN>
To: 31138 <at> debbugs.gnu.org
Subject: Re: bug#31138: Native json slower than json.el
Date: Mon, 22 Apr 2019 12:20:15 -0600
Message-ID: <87ftq96gww.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

If the validation is done on the Emacs side, then perhaps it would be
beneficial to use the json_*_nocheck function alternatives to disable
libjannson's validation, namely json_stringn_nocheck and
json_object_set_new_nocheck.

[1] jansson.readthedocs.io/en/stable/apiref.html#c.json_stringn_nocheck

P.S. Would applying the following diff be okay? It's a simple
optimization that avoids an overflow check (the sizeof comparison is
optimized out even in -O0) in the usual case of a JSON integer fitting
into an EMACS_INT.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=sizeof.diff
Content-Description: sizeof

diff --git a/src/json.c b/src/json.c
index 928825e034..9faf1f80ca 100644
--- a/src/json.c
+++ b/src/json.c
@@ -836,7 +836,10 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
     case JSON_INTEGER:
       {
 	json_int_t i = json_integer_value (json);
-	return INT_TO_INTEGER (i);
+        if (sizeof (json_int_t) <= sizeof (EMACS_INT))
+          return make_fixnum (i);
+        else
+          return INT_TO_INTEGER (i);
       }
     case JSON_REAL:
       return make_float (json_real_value (json));

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 17:27:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 13:27:03 2019
Received: from localhost ([127.0.0.1]:51515 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcid-0000wp-Ei
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:27:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36331)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIcib-0000wM-NE
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:27:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44597)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIciW-0001QH-J6; Mon, 22 Apr 2019 13:26:56 -0400
Received: from [176.228.60.248] (port=2772 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIciV-0007Jj-Nj; Mon, 22 Apr 2019 13:26:56 -0400
Date: Mon, 22 Apr 2019 20:26:45 +0300
Message-Id: <83muki54tm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 20:11:33 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
 <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 20:11:33 +0300
> 
> I was kind of expecting to continue on the "fast validation" route, and 
> check whether DATA contains non-ASCII bytes in the exact way we want 
> them. And simply abort otherwise.

I don't think we should abort, we don't do that anywhere else.

> > You can see one example of that in
> > w32select.c:w32-get-clipboard-data.
> 
> Hmm, I'm not seeing any calls to code_convert_string in w32select.c.

Of course!  Look for decode_coding_object.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 17:25:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 13:25:13 2019
Received: from localhost ([127.0.0.1]:51511 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcgq-0000u0-VU
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:25:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIcgp-0000th-Kg
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:25:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44561)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIcgj-0000Vd-Un; Mon, 22 Apr 2019 13:25:06 -0400
Received: from [176.228.60.248] (port=2657 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIcgg-0006zg-PV; Mon, 22 Apr 2019 13:25:05 -0400
Date: Mon, 22 Apr 2019 20:24:51 +0300
Message-Id: <83o94y54ws.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 20:05:46 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 20:05:46 +0300
> 
> > I meant make a loop that literally checks only for
> > ASCII_CHAR_P, and nothing more.
> 
> Is this (attached) what you had in mind?

Yes, but I'm slightly surprised why you loop from the end of the
string and not from the beginning.

> It's a bit faster again (naturally). At this point I don't see any 
> statistically significant performance difference from the no_validation 
> patch.

I guess that's expected when the strings in JSON are short enough.

The next question is what speedup you will see from the optimized
decoding version I just posted.  Then we could decide whether testing
for valid UTF-8 non-ASCII text is justified.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 17:12:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 13:12:48 2019
Received: from localhost ([127.0.0.1]:51501 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcUp-0000b1-Nw
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:12:48 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33749)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIcUo-0000ap-1g
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:12:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44427)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIcUY-0002pL-0u; Mon, 22 Apr 2019 13:12:31 -0400
Received: from [176.228.60.248] (port=1892 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIcUW-00065O-Rt; Mon, 22 Apr 2019 13:12:29 -0400
Date: Mon, 22 Apr 2019 20:12:18 +0300
Message-Id: <83pnpe55hp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: dgutov@HIDDEN
In-reply-to: <83tveq56jr.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 22
 Apr 2019 19:49:28 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN>
 <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN>
 <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN>
 <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 22 Apr 2019 19:49:28 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
> 	31138 <at> debbugs.gnu.org
> 
> Btw, we could somewhat speed up even the case where we do call
> code_convert_string, by avoiding the call to make_specified_string.

Like this:

diff --git a/src/json.c b/src/json.c
index 16500bc..48aeccf 100644
--- a/src/json.c
+++ b/src/json.c
@@ -225,8 +225,12 @@ json_has_suffix (const char *string, const char *suffix)
 static Lisp_Object
 json_make_string (const char *data, ptrdiff_t size)
 {
-  return code_convert_string (make_specified_string (data, -1, size, false),
-                              Qutf_8_unix, Qt, false, true, true);
+  struct coding_system coding;
+  setup_coding_system (Qutf_8_unix, &coding);
+  coding.mode |= CODING_MODE_LAST_BLOCK;
+  coding.source = data;
+  decode_coding_object (&coding, Qnil, 0, 0, size, size, Qt);
+  return coding.dst_object;
 }
 
 /* Create a multibyte Lisp string from the NUL-terminated UTF-8


How does this fare in your benchmarks?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 17:11:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 13:11:45 2019
Received: from localhost ([127.0.0.1]:51496 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcTp-0000ZD-5I
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:11:45 -0400
Received: from mail-lj1-f196.google.com ([209.85.208.196]:45272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIcTm-0000Ye-NQ
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:11:43 -0400
Received: by mail-lj1-f196.google.com with SMTP id y6so10891535ljd.12
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 10:11:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=w3ykxEcVcrQ3WiQt9NqIakwY8egbvS9DbV0F59K4LtA=;
 b=UQNmwrOWBVR9CZ8ycpwm7qlMlAr6EH6NX/4Y+YO/HWW7pdHAQAL2lMT4+9p6dgi+IN
 RlL+KHFWPUGVZzM/GPFN4ZFy8PnHxMgKO9U5+20GlG3UnRc60eAN0KeEByaLRkegL4Ed
 oznZMkN6+TipUf0uT5zmGfk4QGY0bkS+/wmdjDkY6xYEOnK/YN50Pp1Fqb9ZEkyRa9oG
 Wiq1Ad7hpxN0+xt+g6+lypETv1CkhrjChYeBiOWk16WcrJiy97gt2D0J0WJHlsKYcLnT
 d91f4vSwxLX8R8HlcCvbS5LrhpV1+FdZjhK0QN/u+F5fdpDS0v97QyDqdhZvuqv/McSV
 5bug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=w3ykxEcVcrQ3WiQt9NqIakwY8egbvS9DbV0F59K4LtA=;
 b=Srg2puFQ21aizwTBeM7FepV7D4T4miZ5lJteU3pVqrTM3REsisfL/LZ/fMi3emuYQw
 6T9VdzS1SkgkQopjfpv5KgVrxG1qQ6kfuBSieucYLK0fo/aLH9KQBtTfypgs0Ui8vHUN
 l9A+JqdcwNm+Oshe0TPxstPYwhXT6AHn3xGmwih9PKmH/KJCWM03rqwo8kOkSvxKqN5u
 QVemvnb60R7dZqLQFsBcjtSHpuOFU+GJRHVf6HPpk8e3Zadr9f+wIfvtr3c/MO8XZLsL
 JZ4HlPHdtBwrmyxk8eJ12GQ7c7VFHD0aNWIm9k730fbiZMeUmQxMEdUWkLTo5KjAnKX0
 deHQ==
X-Gm-Message-State: APjAAAUPFPXr+6nxSZFvfRy6hkwRPXQpq4diHioISqo80fL5jLcCHRT5
 2dFfjQ6w+ff9mU5wFJ5FMwM6hKIT
X-Google-Smtp-Source: APXvYqzjYpPy5snCzKdV6Gu6vizrDa32ToWLFwzatWi2zNn2rrQ+Sn6kri99SuNlR0qyXKcyhoaNKA==
X-Received: by 2002:a2e:42cf:: with SMTP id h76mr10831381ljf.95.1555953096476; 
 Mon, 22 Apr 2019 10:11:36 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id s64sm2810849lje.49.2019.04.22.10.11.34
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 10:11:35 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83tveq56jr.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5653b312-38ac-b8f5-1da4-a8f4c1ebe586@HIDDEN>
Date: Mon, 22 Apr 2019 20:11:33 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83tveq56jr.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22.04.2019 19:49, Eli Zaretskii wrote:

> Btw, we could somewhat speed up even the case where we do call
> code_convert_string, by avoiding the call to make_specified_string.
> That's because decode_coding_object, called by code_convert_string to
> perform the decoding, is capable of decoding a C string, if we set up
> its argument accordingly.

Guess we could test that with a non-ascii sample.

I was kind of expecting to continue on the "fast validation" route, and 
check whether DATA contains non-ASCII bytes in the exact way we want 
them. And simply abort otherwise.

> You can see one example of that in
> w32select.c:w32-get-clipboard-data.

Hmm, I'm not seeing any calls to code_convert_string in w32select.c.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 17:06:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 13:06:00 2019
Received: from localhost ([127.0.0.1]:51485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcOG-0000Pj-0K
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:06:00 -0400
Received: from mail-lf1-f51.google.com ([209.85.167.51]:43140)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIcOE-0000PT-AE
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 13:05:58 -0400
Received: by mail-lf1-f51.google.com with SMTP id i68so9481018lfi.10
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 10:05:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=y2eEvz3qSobPxdl7MzKMBf02nd//HhTMSh3oZ5P7Vjc=;
 b=J8aLP3b//fRXyok1l/3QSKw2Qe/G3WQ2nt9mKg4tvwEITd0zO8Q0+XojyyyCJmCnKq
 IbWA7RIIle2fAxSZT5vGa3UDjNMLX06MyHah8cFDdaHwigiUs0LgpylXE/JUUeYHZYIt
 lrdfDY+H9kBTvIa29XH4Dg0w1Zo0XZt2VAhSwTmfHgcSW1pd7Mi53+Yzk+Mc/rvRqey9
 UlRO4+sVbnvbo7ANRRxW5H2JcqmzyPomXvOgPlOaVcpvBUbFA5QatteIcJ/emrPdL5xo
 TY3aT9pSmCnmf5H4BhPLb9hjTLUWFqOzS2lTL/kpL55T1IkEZKmyZFsmosgYph7F9Sof
 q97w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language;
 bh=y2eEvz3qSobPxdl7MzKMBf02nd//HhTMSh3oZ5P7Vjc=;
 b=D2/G5HCi2d/fircrgtUUSgEXPjpudf2BmQ0wLzeG7MzvfIsHyhIReZ0p9C/AqDopM1
 27/CzcHTvU2eAqGfGssq2ZFhDDETtE1Jb/Fbt1+0W0aG7rkCbGskDgwpTco0j/xq3Q3Z
 8KXo247E3vG7SKVdZFlS9fzuXEs4Imh2YDj45EmRjkIItQco01wIvPOBGMm68ay+4o+D
 RLchGVeZ28sNpe67hJziHH5EywoeJJqc3vHTAQeqCtUz1Ge5Jq8z/JgvmnlL7pcGhwwW
 M25wM9OXZLi02NdxuiFlnIYwI5tcdaFY8ENDLlP+vMSDhs8MRJw+mP4tBqezv9dAD5NC
 Kf7g==
X-Gm-Message-State: APjAAAVCZ9bqB/hiEYuOqhv823rwbIyNUp23Ek5g9lTPS0r/ltPCes9B
 cmdYWWzjqOiTlsLuCE2HNXcPPslc
X-Google-Smtp-Source: APXvYqyEjnPHVCS2RUJ1GedNzWjyf9zD6b9EA6/ozGVKCzA9EZDg45ZOI53/SEGLgz2QBuuDjieCkw==
X-Received: by 2002:ac2:554a:: with SMTP id l10mr9829624lfk.45.1555952752099; 
 Mon, 22 Apr 2019 10:05:52 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id y23sm3010563lfy.31.2019.04.22.10.05.49
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 10:05:50 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <f52fa88f-48ff-7d9a-a8f4-7d66cb16bf2f@HIDDEN>
Date: Mon, 22 Apr 2019 20:05:46 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83v9z657i0.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------572849FB77C0E71A19035E03"
Content-Language: en-US
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

This is a multi-part message in MIME format.
--------------572849FB77C0E71A19035E03
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 22.04.2019 19:28, Eli Zaretskii wrote:
> I meant make a loop that literally checks only for
> ASCII_CHAR_P, and nothing more.

Is this (attached) what you had in mind?

It's a bit faster again (naturally). At this point I don't see any 
statistically significant performance difference from the no_validation 
patch.

--------------572849FB77C0E71A19035E03
Content-Type: text/x-patch;
 name="json_make_string_ascii_test_v2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="json_make_string_ascii_test_v2.diff"

diff --git a/src/json.c b/src/json.c
index 928825e034..9c03d09ca6 100644
--- a/src/json.c
+++ b/src/json.c
@@ -225,8 +225,25 @@ json_has_suffix (const char *string, const char *suffix)
 static Lisp_Object
 json_make_string (const char *data, ptrdiff_t size)
 {
-  return code_convert_string (make_specified_string (data, -1, size, false),
-                              Qutf_8_unix, Qt, false, true, true);
+  char* ptr = (char*)data + size;
+  bool ascii_only = true;
+
+  while (ptr > data) {
+    if (!ASCII_CHAR_P(*ptr))
+      {
+        ascii_only = false;
+        break;
+      }
+    ptr--;
+  }
+
+  if (ascii_only)
+    /* Wasn't sure if the last arg should better be true here, but
+       it doesn't seem to affect the behavior or correctness, so far. */
+    return make_specified_string (data, -1, size, false);
+  else
+    return code_convert_string (make_specified_string (data, -1, size, false),
+                                Qutf_8_unix, Qt, false, true, true);
 }
 
 /* Create a multibyte Lisp string from the NUL-terminated UTF-8

--------------572849FB77C0E71A19035E03--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:58:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:58:52 2019
Received: from localhost ([127.0.0.1]:51478 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcHM-0006ap-7n
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:58:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIcHK-0006aY-Kb
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:58:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44265)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIcHF-0001h1-Dq; Mon, 22 Apr 2019 12:58:45 -0400
Received: from [176.228.60.248] (port=1028 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIcHC-0005NB-LF; Mon, 22 Apr 2019 12:58:45 -0400
Date: Mon, 22 Apr 2019 19:58:33 +0300
Message-Id: <83r29u564m.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ivan <yyoncho@HIDDEN>
In-reply-to: <96a3f438-6470-44f2-968a-ecf05db76c8c@HIDDEN> (message from
 Ivan on Mon, 22 Apr 2019 19:53:05 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
 <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
 <837ebm8o4e.fsf@HIDDEN>
 <CACCVLQUVR3cZYe3BUmnD6bKm22GuXT6fuNpE7tMrsKXwrruoFg@HIDDEN>
 <83bm0y6uxn.fsf@HIDDEN> <96a3f438-6470-44f2-968a-ecf05db76c8c@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Ivan <yyoncho@HIDDEN>
> Date: Mon, 22 Apr 2019 19:53:05 +0300
> 
> Do you know whether this library was considered when implementing the 
> json parser?
> 
> https://github.com/zserge/jsmn

See http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00528.html.
Looks like the answer is yes.

> Based on my limited understanding I think that it might be better fit 
> for what we are trying to solve.

Feel free to tell why on emacs-devel.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:53:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:53:17 2019
Received: from localhost ([127.0.0.1]:51466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIcBx-0006SA-4j
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:53:17 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:37395)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIcBv-0006Rx-Eh
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:53:15 -0400
Received: by mail-wm1-f45.google.com with SMTP id v14so15157396wmf.2
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 09:53:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding:content-language;
 bh=ITI2egyEU3c5gkJEnXKMzHOdWoFMlPDB1he8rO6jfaU=;
 b=lQ4Bh+VGaSzFiM+js4PCTsXLIIUSnx8UxzNatrWxG2fem+hemf3xFbPDqaV4uZpbbq
 kxKG+3rooWeef7APw5KQsZGKznV0Vuqhd69sLcbbDM8HLQo5D0VCJws7gcTmqkrqy4CD
 DBalZW2x4FfmG726kCp+F7VPm54Wcx2AoQMnXi5yrXrMciipeM/VFvyKfjVK3PdhqeMx
 JAa2r6A7MEgNb5f7t6py1NLidBTZGX7d/b5kS3KuGYl0/+d4ija2yK07Az6En1zlWkKc
 Bgv00WzEIzIUqGITzRUjRr0TalPmKdZhETmdP8s/Xh/7Qf0MrAmgwFE7zTlkiy0fTyd8
 65xw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-transfer-encoding
 :content-language;
 bh=ITI2egyEU3c5gkJEnXKMzHOdWoFMlPDB1he8rO6jfaU=;
 b=FixaRLjI4+pp/xS9fkDOp0ffR97ZKfjLL2LGf53MAfpamXbTN1IRP+19FzoKfG+ecj
 Ulg8Rp/Y1PqCnXl1B1usVqDFxg163uBGpsStInPGWfFjoYb1kr3klPGnYaw6q0bPbrkk
 G+SKx7jwdwYUPyweXtFSFp4YdywAWoHPEBOjEfF02LJ09VYRjfXVDy2EQTGOYpy2++lT
 iCQRlVh2K5Q3nhVeVAyFf0Uiz4m2+urWO54SubbMbgpBZ/RML6SwVn+1EtPjWuN9q2DT
 7xE8pD7kWENwz2Wf01jbJsOEQrIi5D99ZQWCz+nenXhBRHXjNxarWGChslP9F3CXwTTL
 21YA==
X-Gm-Message-State: APjAAAVyjOaF028a+76VTb9/q/SeH81QYYMTmX6FRWnXwiduHCTWvS0F
 5feCmu3OtK9NdAXyehHu7IDj+iHJ8PE=
X-Google-Smtp-Source: APXvYqxTaQ317slrCO8iOtR34+cLhyLB8fOP3+u/a5WRYXXkLx5NBmhvcCxzN3uHFjk9FyNpuCqq4Q==
X-Received: by 2002:a7b:cc91:: with SMTP id p17mr12873751wma.38.1555951989101; 
 Mon, 22 Apr 2019 09:53:09 -0700 (PDT)
Received: from ?IPv6:2a00:4802:28f:9000:34:85ce:b419:51a8?
 ([2a00:4802:28f:9000:34:85ce:b419:51a8])
 by smtp.gmail.com with ESMTPSA id h12sm12198901wrq.95.2019.04.22.09.53.07
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 09:53:07 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, dgutov@HIDDEN
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
 <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
 <837ebm8o4e.fsf@HIDDEN>
 <CACCVLQUVR3cZYe3BUmnD6bKm22GuXT6fuNpE7tMrsKXwrruoFg@HIDDEN>
 <83bm0y6uxn.fsf@HIDDEN>
From: Ivan <yyoncho@HIDDEN>
Message-ID: <96a3f438-6470-44f2-968a-ecf05db76c8c@HIDDEN>
Date: Mon, 22 Apr 2019 19:53:05 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <83bm0y6uxn.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Eli, Dmitry,


Do you know whether this library was considered when implementing the 
json parser?

https://github.com/zserge/jsmn

Based on my limited understanding I think that it might be better fit 
for what we are trying to solve.


Thanks,

Ivan



On 4/22/19 4:17 PM, Eli Zaretskii wrote:
>> From: yyoncho <yyoncho@HIDDEN>
>> Date: Mon, 22 Apr 2019 16:00:13 +0300
>> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>,
>> 	31138 <at> debbugs.gnu.org
>>
>> JSON spec is stable. FYI json.el parser is 568 loc. Both formats have a similar complexity with json being a
>> bit simpler(fewer data structures).
> Then I hope someone will try implementing that as part of Emacs, and
> we will see the resulting performance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:51:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:51:12 2019
Received: from localhost ([127.0.0.1]:51452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIc9w-0006Nj-0o
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:51:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIc9u-0006NV-0j
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:51:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44118)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIc9o-0004GI-Qy; Mon, 22 Apr 2019 12:51:04 -0400
Received: from [176.228.60.248] (port=4489 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIc9o-0003YB-AI; Mon, 22 Apr 2019 12:51:04 -0400
Date: Mon, 22 Apr 2019 19:50:54 +0300
Message-Id: <83sgua56hd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <db91293d-9d69-a55d-ee02-d5e73253be6d@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 19:44:18 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
 <db91293d-9d69-a55d-ee02-d5e73253be6d@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 19:44:18 +0300
> 
> In the meantime, I'd like to report that the aforementioned patch, even 
> though too-complex and not entirely correct, provides practically all 
> the performance improvement we get from the no-validation patch.
> 
> IOW, with my test scenario:
> 
> current master:  51s
> no_validation:   21s
> ascii_test:      22s

That's good to hear, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:49:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:49:47 2019
Received: from localhost ([127.0.0.1]:51443 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIc8Z-0006Kg-9h
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:49:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57782)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIc8X-0006KQ-4q
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:49:45 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44086)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIc8Q-0003Dn-Qp; Mon, 22 Apr 2019 12:49:38 -0400
Received: from [176.228.60.248] (port=4401 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIc8Q-0003OI-Bf; Mon, 22 Apr 2019 12:49:38 -0400
Date: Mon, 22 Apr 2019 19:49:28 +0300
Message-Id: <83tveq56jr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 19:16:15 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 19:16:15 +0300
> 
> +  if (size == nchars)
> +    /* Wasn't sure if the last arg should better be true here, but
> +       it doesn't seem to affect the behavior or correctness, so far. */
> +    return make_specified_string (data, -1, size, false);
> +  else
> +    return code_convert_string (make_specified_string (data, -1, size, false),
> +                                Qutf_8_unix, Qt, false, true, true);

Btw, we could somewhat speed up even the case where we do call
code_convert_string, by avoiding the call to make_specified_string.
That's because decode_coding_object, called by code_convert_string to
perform the decoding, is capable of decoding a C string, if we set up
its argument accordingly.  You can see one example of that in
w32select.c:w32-get-clipboard-data.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:44:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:44:31 2019
Received: from localhost ([127.0.0.1]:51427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIc3T-00048d-JZ
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:44:31 -0400
Received: from mail-lj1-f176.google.com ([209.85.208.176]:45662)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIc3S-00048R-3d
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:44:30 -0400
Received: by mail-lj1-f176.google.com with SMTP id y6so10819155ljd.12
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 09:44:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=6wk2Zm+KNYfcxngv4JcQKToyao34vqZmx76sJTyT9HU=;
 b=i41HiHRF8NIzc3UDFbN69PGU4qiNtdmkN5vDKTsaNL5cl378NNtruAYDdkhvgnBvEK
 C488OZMlsySCdwtBEwQhpYjvHHvFuTC7G2X+BTlN9AIfX47wNq0LYYL/iijoXXVuO3pC
 4vsCxLQt5w5qUuvb0zEMBcuGrp4/aqTm4fuEFvuUohb/aKCWh3JK/mb23v5VBx403Ubl
 yvP0gVK/YtjNMIQeM7XVLKujeKhGNQ+gpweoIRjqmAqG6caJjU7e4ak/goyhRmkr9KYW
 CtXtCZRbsu1tG8VenmPMvvfYr2w1k8WdxijDh58VxnUoDl8ymzBUZtPprz2i9G7B/e+j
 sukA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=6wk2Zm+KNYfcxngv4JcQKToyao34vqZmx76sJTyT9HU=;
 b=So1z5g728dQRDdFfBmDxbXu2WhtL1X0NWcAO6SSPx6KsYbzaXPryDZfbjN5zVdvOd9
 +7Jnxlar56ihcU8ySAiHL3N2sZkEiSUldLuOCdAJ6sCPpM+IzWotJmPeNBvYlUsJOUd6
 Odgv5IoJywyaM89DYjHAeWMjCWal5qfOp5thuQBI100RrgDNl3FA6Lnw0Zq49NNaknDv
 A7XeR5AAPJ7XYaVnmxc/aTn0W5TlRAN3e4z/W554S5i2q/BkKQU/EFtZyQbnr+VqumEg
 R+CJ/4rz9J5wb7oreUYX5PFbFBXQeKynOV83sE0OIl19pK67Aj11QvvJYfHGGtxD9ptO
 M5Ig==
X-Gm-Message-State: APjAAAV8/x0ddhrBJfd7zPtiDc9WdSP9sn1fz65k/vdW4vXyCG9RpBYV
 WYCqHHdP2fomkgzswy+uVrWqrUA0
X-Google-Smtp-Source: APXvYqyBap80G8vVK9rkJtDRuKCpKFznsiOsJ5UazfC4PkskIP2IWLF7+jQhByyxluwmn8NPRQb6gQ==
X-Received: by 2002:a2e:9ec3:: with SMTP id h3mr10899504ljk.131.1555951463223; 
 Mon, 22 Apr 2019 09:44:23 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id h6sm3015954lfp.1.2019.04.22.09.44.20
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 09:44:22 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> <83v9z657i0.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <db91293d-9d69-a55d-ee02-d5e73253be6d@HIDDEN>
Date: Mon, 22 Apr 2019 19:44:18 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83v9z657i0.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22.04.2019 19:28, Eli Zaretskii wrote:
>> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>>   31138 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Date: Mon, 22 Apr 2019 19:16:15 +0300
>>
>> All right. Does the attached json_encode_string_ascii_test.diff look
>> good to you?
> 
> The size == nchars case not necessarily true just for ASCII, I think,
> and the code in parse_str_as_multibyte is more complex than needed
> just for ASCII.  I meant make a loop that literally checks only for
> ASCII_CHAR_P, and nothing more.  I think it makes sense to see first
> how much can we speed up things for pure ASCII JSONs.

OK, I'll try to do what you've described here.

In the meantime, I'd like to report that the aforementioned patch, even 
though too-complex and not entirely correct, provides practically all 
the performance improvement we get from the no-validation patch.

IOW, with my test scenario:

current master:  51s
no_validation:   21s
ascii_test:      22s

>> +  if (size == nchars)
>> +    /* Wasn't sure if the last arg should better be true here, but
>> +       it doesn't seem to affect the behavior or correctness, so far. */
>> +    return make_specified_string (data, -1, size, false);
> 
> It should make no difference for ASCII, but I think I prefer to use
> 'true' there, for consistency with the other cases.

I left 'false' there for testing, to make sure we hit both branches of 
the condition (the tests still pass).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:29:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:29:14 2019
Received: from localhost ([127.0.0.1]:51391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIbog-0003ei-JU
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:29:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54076)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIboe-0003eP-6L
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:29:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43655)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIboY-0007Tk-HB; Mon, 22 Apr 2019 12:29:06 -0400
Received: from [176.228.60.248] (port=3061 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIboW-0005UG-Ub; Mon, 22 Apr 2019 12:29:05 -0400
Date: Mon, 22 Apr 2019 19:28:55 +0300
Message-Id: <83v9z657i0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 19:16:15 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
 <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 19:16:15 +0300
> 
> All right. Does the attached json_encode_string_ascii_test.diff look 
> good to you?

The size == nchars case not necessarily true just for ASCII, I think,
and the code in parse_str_as_multibyte is more complex than needed
just for ASCII.  I meant make a loop that literally checks only for
ASCII_CHAR_P, and nothing more.  I think it makes sense to see first
how much can we speed up things for pure ASCII JSONs.

> +  if (size == nchars)
> +    /* Wasn't sure if the last arg should better be true here, but
> +       it doesn't seem to affect the behavior or correctness, so far. */
> +    return make_specified_string (data, -1, size, false);

It should make no difference for ASCII, but I think I prefer to use
'true' there, for consistency with the other cases.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:22:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:22:53 2019
Received: from localhost ([127.0.0.1]:51370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIbiW-0003UC-Re
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:22:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53374)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIbiV-0003Tz-GR
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:22:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43536)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIbiP-0003BT-2k; Mon, 22 Apr 2019 12:22:45 -0400
Received: from [176.228.60.248] (port=2668 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIbiO-0000rh-H4; Mon, 22 Apr 2019 12:22:44 -0400
Date: Mon, 22 Apr 2019 19:22:34 +0300
Message-Id: <83wojm57sl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 19:00:13 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
 <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 19:00:13 +0300
> 
> On 22.04.2019 18:50, Eli Zaretskii wrote:
> > (You should have used
> > insert-file-contents-literally instead.)

(And, to answer your question: insert-file-contents doesn't use
code_convert_string, it decodes text as it being read, directly in the
buffer's gap.)

> I wonder if there's a counterpart for that for HTTP responses returned 
> by url-retrieve.

There is, if we need: bind coding-system-for-read to 'no-conversion'.

> > And I don't think we will be
> > able to speed up the general-purpose decoding routines: no one said
> > the original file is encoded in UTF-8.
> 
> We could speed up certain important cases, like where the bytes are 
> identical between the source and the destination.

Not sure what you mean by "source" and "destination".

In any case, coding.c is already heavily optimized, certainly in the
UTF-8 case.  You and others are welcome to profile the code looking
for opportunities to optimize even more, but I'd be surprised if you
find something significant.  In particular, UTF-8 decoding validates
as part of the decoding loop, and is already optimized for ASCII, so
it will be interesting to see what kind of gains we could have in
json_make_string by testing for ASCII up front.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:16:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:16:27 2019
Received: from localhost ([127.0.0.1]:51356 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIbcH-0003J3-Pl
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:16:27 -0400
Received: from mail-wr1-f65.google.com ([209.85.221.65]:44476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIbcG-0003Iq-4e
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:16:24 -0400
Received: by mail-wr1-f65.google.com with SMTP id c5so7508603wrs.11
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 09:16:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=BUW/83HveZQE7Omxwxc33TcAPlYmffR0jqN2JUsKC78=;
 b=mQKz8QEBNjvIj/c53+kva4e/5BzzqzgEpcoVzXOEsEbBlpl3cyk+BM09kcm6PTnpcr
 4KdihqfQxTppI84PnkQ8cPawGtt7wZg1hBmBCkvAMTchWF3JHS7AFdX+knxuwhFTG/GO
 Hq9XowFo5aOXcxVLLa/U+66zGNoCsZK1ucgJzvAf74JmmxX8cYyFqhNA11blBM/RHNA7
 R9++UmhX75FCkn3LQCUMCniBZYXTo2ODjSl65MY8Xkc9LQk7Cm5axXQY5swmeJwvsU5z
 14UpWv8oT2eHHckF96Ma9eHAISAwyWKmbJfc2s4jRFXaiImNegws0WdHReVcmUUMnHQk
 YsGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language;
 bh=BUW/83HveZQE7Omxwxc33TcAPlYmffR0jqN2JUsKC78=;
 b=PXCf+TjDWeYuslmXt0bDBSg8e1by/pdiFKKSFj5NbUqxkvZIRcvxPRAYa7vDaQsxPC
 /waJOz2doTRWu+1Ihqr6aTZEkvVw5Pa22cVZ3oXdDF2a7740staQuKfbgkp6yKFc4jZM
 Hbti0AoVmY8mTBRpMHh2mLYE78bKYnJvT/n2bhcQXeNBAzWiMl2NqMtMtzdTmFtZuA8Y
 TFW3OyAxqRAZCIyQjZwVidDeftv2LVIT3DNqEY5u/wd7k7wY5bMcB3OVzR4S7QWMK4Tr
 9DSm4RSWJ1zSxWHaIrAtfku/TaiuViZouXZVMOpgaJmd1OO+IwtemycWxVp05XblXb0Y
 Q4tQ==
X-Gm-Message-State: APjAAAUF5Mj3xBRG/8ZmrdT8yhlIqeZLHLQB6qyTbfJmvi9aR44re/c6
 0TNz5iDj6Dnf9nFDvZLQMGo1YPCY
X-Google-Smtp-Source: APXvYqzQ98PBFVQW840BCSHQKq6Fm7lRosFKdW2vciLDyPHQbEs0jfcwDQdv/Ifg7JbyCOpWIezW8g==
X-Received: by 2002:adf:eed1:: with SMTP id a17mr13304393wrp.268.1555949778227; 
 Mon, 22 Apr 2019 09:16:18 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id o27sm1967742wro.40.2019.04.22.09.16.16
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 09:16:17 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
 <83d0lfag4x.fsf@HIDDEN> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> <8336ma6oia.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <ad51beb4-9ce8-2fac-0762-ce6c0eeb63f9@HIDDEN>
Date: Mon, 22 Apr 2019 19:16:15 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <8336ma6oia.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------0D8953A14BB051FFBFDF3DA1"
Content-Language: en-US
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

This is a multi-part message in MIME format.
--------------0D8953A14BB051FFBFDF3DA1
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 22.04.2019 18:36, Eli Zaretskii wrote:
> Let's start with just ASCII strings, and then consider moving to valid
> UTF-8 sequences.  I take it you can easily write a loop that ensures a
> string is pure ASCII?

All right. Does the attached json_encode_string_ascii_test.diff look 
good to you? In terms of correctness/safety, I mean.

> No, I meant a test of performance.  if we begin by testing for plain
> ASCII strings, then non-ASCII strings will take longer to convert.
> The existing tests are too short to support measurement of the effect,
> we need a larger JSON object with many non-ASCII strings.

Makes sense.

> Suit yourself, but I don't like investing hours in code just to hear
> "your best is not good enough" from those who triggered the changes to
> begin with.

I have code that parses JSON as well. Mentioned that before.

> I don't want to make changes that affect decoding everywhere, because
> having raw bytes in other cases is a more frequent phenomenon.  Let's
> just optimize JSON parsing, OK?
> 
> Should be 'true', right?

Erm, right. >_< Probably hit 'undo' one too many times.

I've attached this patch as json_make_string_no_validation.diff.

--------------0D8953A14BB051FFBFDF3DA1
Content-Type: text/x-patch;
 name="json_make_string_ascii_test.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="json_make_string_ascii_test.diff"

diff --git a/src/json.c b/src/json.c
index 928825e034..033fa27638 100644
--- a/src/json.c
+++ b/src/json.c
@@ -225,8 +225,17 @@ json_has_suffix (const char *string, const char *suffix)
 static Lisp_Object
 json_make_string (const char *data, ptrdiff_t size)
 {
-  return code_convert_string (make_specified_string (data, -1, size, false),
-                              Qutf_8_unix, Qt, false, true, true);
+  ptrdiff_t nchars, multibyte_nbytes;
+  parse_str_as_multibyte ((const unsigned char *) data, size,
+                          &nchars, &multibyte_nbytes);
+
+  if (size == nchars)
+    /* Wasn't sure if the last arg should better be true here, but
+       it doesn't seem to affect the behavior or correctness, so far. */
+    return make_specified_string (data, -1, size, false);
+  else
+    return code_convert_string (make_specified_string (data, -1, size, false),
+                                Qutf_8_unix, Qt, false, true, true);
 }
 
 /* Create a multibyte Lisp string from the NUL-terminated UTF-8

--------------0D8953A14BB051FFBFDF3DA1
Content-Type: text/x-patch;
 name="json_make_string_no_validation.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="json_make_string_no_validation.diff"

diff --git a/src/json.c b/src/json.c
index 928825e034..b06d411032 100644
--- a/src/json.c
+++ b/src/json.c
@@ -225,8 +225,7 @@ json_has_suffix (const char *string, const char *suffix)
 static Lisp_Object
 json_make_string (const char *data, ptrdiff_t size)
 {
-  return code_convert_string (make_specified_string (data, -1, size, false),
-                              Qutf_8_unix, Qt, false, true, true);
+  return make_specified_string (data, -1, size, true);
 }
 
 /* Create a multibyte Lisp string from the NUL-terminated UTF-8

--------------0D8953A14BB051FFBFDF3DA1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:00:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 12:00:24 2019
Received: from localhost ([127.0.0.1]:51306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIbMm-0002oE-Gv
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:00:24 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:36565)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIbMk-0002nw-Al
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 12:00:22 -0400
Received: by mail-wr1-f43.google.com with SMTP id b1so4958290wru.3
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 09:00:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=6JuUX0iJrq8wz9JPvqA8MCfHQaMCIPeP+yGmQFewDS0=;
 b=cQkWaiA83a0SylM6Ys2pmwx59gIp9OH5bthJCpnqcH2JbZhsbOklBfjDwAyGm1byZP
 Xu3jqm+DdUggcWmqXtpunc2NunsDjq5v4v2LtYi5MebW9xS9t7pmb8k+9w5KKzmE36zB
 xJFDCvy69/mH3HaGai6aRPvcQdvZia/MAOg3vLMbiAeikfEpE3naxxFPrkhEUQ/wwAzP
 DMnyR24Eg2KHmVzJuHyomr8HFJ5c0wD88Tgaa7UI1UpaXg8SDZD/Z5/o9YVQes7NpgwB
 FgkjaNqo5mppJhjNNVD3HrMQRYPwKFiqm5cnZ4dD+v86uKJb2OqoT4YczUHJjvx/oH0m
 8afw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=6JuUX0iJrq8wz9JPvqA8MCfHQaMCIPeP+yGmQFewDS0=;
 b=Aj+nstzwY2lqlsxugcIxf04pL/bd8ueNXGte0EgcmMBFsll460FCPbZhr/WuobhMIB
 lpJBcQ7jiyp2RDuipBvRx8jVZdv0m7BLiBdSSV5aPzYshsHNZjqy0zwN/IeIGdJyL0eo
 7cfLtyDxkoj0z9AW2vjXwWQAnHj5FRX+VKsoo8IV6xXsIFt2bID2qEYYYY7l4Xc0wn0b
 OOYCzCvJ+mepcD/FLw1MEBV2qN7lWNRDMSQ7g+nXIE9hNw+hcex/v1m11HfrgSWZ/G0O
 ixU1sHZ8tGeD6/N2igaSOdrL3kHMSNodVSuygbvwJEqBHuNSwBGVYTxet/uC/E/71Pzb
 70FQ==
X-Gm-Message-State: APjAAAX1362tlLoWUZgoB+lOMS3uimSaK01wVPREAgk2IoSTwTtEXrVh
 SZ+psosMijEn8F4PaX3Qo21hKUw8
X-Google-Smtp-Source: APXvYqzNSWAL9p+0Wxs2tr1QdnEwJd5ahR3FL+q3nkKaVbGZ5SoBgQ31yip5o24BYOs6onxWoQoc1A==
X-Received: by 2002:adf:d850:: with SMTP id k16mr7304551wrl.35.1555948816332; 
 Mon, 22 Apr 2019 09:00:16 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id x16sm5166831wrt.96.2019.04.22.09.00.14
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 09:00:15 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> <83zhoi59ao.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <ecead7ef-412d-0a11-c20d-942db9e479b1@HIDDEN>
Date: Mon, 22 Apr 2019 19:00:13 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83zhoi59ao.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 18:50, Eli Zaretskii wrote:
> (You should have used
> insert-file-contents-literally instead.)

I wonder if there's a counterpart for that for HTTP responses returned 
by url-retrieve.

> And I don't think we will be
> able to speed up the general-purpose decoding routines: no one said
> the original file is encoded in UTF-8.

We could speed up certain important cases, like where the bytes are 
identical between the source and the destination. I could be wrong here, 
though, this is already out of my depth.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:50:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:50:25 2019
Received: from localhost ([127.0.0.1]:51290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIbD7-0002WN-3c
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:50:25 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47049)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIbD5-0002W8-PC
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:50:24 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42758)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIbCz-0005yQ-6j; Mon, 22 Apr 2019 11:50:17 -0400
Received: from [176.228.60.248] (port=4644 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIbCy-0003Dx-Iw; Mon, 22 Apr 2019 11:50:17 -0400
Date: Mon, 22 Apr 2019 18:50:07 +0300
Message-Id: <83zhoi59ao.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 18:41:00 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
 <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 18:41:00 +0300
> 
> insert-file-contents probably uses code_convert_string somewhere inside, 
> right?

Yes, but that's irrelevant.  (You should have used
insert-file-contents-literally instead.)  And I don't think we will be
able to speed up the general-purpose decoding routines: no one said
the original file is encoded in UTF-8.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:41:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:41:10 2019
Received: from localhost ([127.0.0.1]:51282 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIb4A-0002G8-7B
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:41:10 -0400
Received: from mail-wm1-f51.google.com ([209.85.128.51]:51962)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIb49-0002Fn-0v
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:41:09 -0400
Received: by mail-wm1-f51.google.com with SMTP id 4so14898844wmf.1
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 08:41:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=JKemfku/MPMCo6RB+J6oU0+vZge48nm3OgEMLhtObs8=;
 b=HApAgojFKo2ugFYZUpl1Q+LWHb25ufVs26tAc8fOU95dUWcy2q9WwgaA7LykimTke9
 FJap9OsrFlJiXMQiI6xe05jhDApbtbJwz1noSIcTDZ9ko/RYx8DiznxMb2MPk5Gxcrhp
 8C6kaD2lzElD9UeyuMpcoR+muSIn3/3uFVPIkxXgKywweCOd8mv/lTGYn+ezo3F387O8
 VbmztCs/voY/8lVmLWPbR8XErHrDN1kXz3TuGYhqTE1X3ko9XtIHYnjZlxSkkbPFFpn0
 ABdNXQLSIsyHldbQixJ4ape1gQGlrv77aCkXV0dWXcBKYXpgU/yvTFWt3u0w/6JW7FMq
 zVZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=JKemfku/MPMCo6RB+J6oU0+vZge48nm3OgEMLhtObs8=;
 b=pLAYiByVZPgP4AytdGqviX1wcjkn+kUjTdbLxHJeS8DA+/PB2V4iF2SbcepEwL7lz6
 10wCo6wrLD6s2XuBsP3dTIH0u3bV3DSpFIngG7TqenBqQbBw8uW1Ab6oL6F99iOMhWpj
 cPkXr11wwY+qJPcqIk3jwVkRPM0kM4H69BtZyJefwVxuC+48QdDwzaDgs5YMKf99R9qt
 A9h+Bga7GxVIJXElxxsYusl5e1bfSt42j139n8h9mab3FNa/2xS2k143Jl+/H3FvEheP
 NykE7XoHIE+iwQ9yI6KNAAKwcSkv2dFway4G94eQSRgm3XsQLqu9bJYcFIi350rlVXYY
 iyLQ==
X-Gm-Message-State: APjAAAVrpUltPOfpV8wmJlTUzGzbqNHGtoljedeHEB1OKToei3S+1EG9
 kF0ZURY5nafhRxAT5MnazuawCoP5
X-Google-Smtp-Source: APXvYqwERuCRCMFjqWkTT6eA3z7BqLBxWTiVCulS84VXRgAJmpuRldk0an/cc3sN4mow4nJJ+4Swsw==
X-Received: by 2002:a1c:f205:: with SMTP id s5mr12926161wmc.124.1555947662978; 
 Mon, 22 Apr 2019 08:41:02 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id 62sm10378111wrm.18.2019.04.22.08.41.00
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 08:41:02 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> <834l6q6ozn.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <e7a1c0f7-e7af-9dc1-9bb1-ec75bc081fba@HIDDEN>
Date: Mon, 22 Apr 2019 18:41:00 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <834l6q6ozn.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 18:25, Eli Zaretskii wrote:

>> But not a better measurement of how json.c is actually used, I'm afraid
>> (unless you're trying to cut out the time Emacs spends reading from
>> disk). So even if my benchmark gives more attention to buffer-decoding
>> routines, it probably reflects practical usage too (JSON usually comes
>> from HTTP response, and it has to be decoded as well).
> 
> But it shows the upper limit of what we can expect,
Not if we manage to optimize the commonly-used subroutines as well.

insert-file-contents probably uses code_convert_string somewhere inside, 
right?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:36:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:36:31 2019
Received: from localhost ([127.0.0.1]:51272 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIazf-00027S-6u
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:36:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44843)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIazd-00027E-GI
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:36:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42564)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIazX-0001dO-Ld; Mon, 22 Apr 2019 11:36:23 -0400
Received: from [176.228.60.248] (port=3793 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIazW-0003Ay-SF; Mon, 22 Apr 2019 11:36:23 -0400
Date: Mon, 22 Apr 2019 18:36:13 +0300
Message-Id: <8336ma6oia.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 18:02:35 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
 <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 18:02:35 +0300
> 
> > (Let me know if you need help in writing the code for the above 2
> > tests.  I think parse_str_as_multibyte should help a lot.)
> 
> I do.
> 
> At the very least: am I supposed to use parse_str_as_multibyte similarly 
> to how make_string does, or to write a function similar to 
> parse_str_as_multibyte? I can more or less follow its logic, but I don't 
> understand if any of its callees cannot cope with improper input.

Let's start with just ASCII strings, and then consider moving to valid
UTF-8 sequences.  I take it you can easily write a loop that ensures a
string is pure ASCII?

> > I guess we should also have some test case with non-ASCII characters,
> > if we will introduce these optimizations.
> 
> We already do in test/src/json-tests.el, like I previously mentioned. 

No, I meant a test of performance.  if we begin by testing for plain
ASCII strings, then non-ASCII strings will take longer to convert.
The existing tests are too short to support measurement of the effect,
we need a larger JSON object with many non-ASCII strings.

> If we're talking about big changes and increases in complexity, sure, we 
> should weigh them. But if a simple change gives us even a 20-30% 
> improvement, why not take it? The reporter is not the only one who 
> parses JSON in Emacs.

Suit yourself, but I don't like investing hours in code just to hear
"your best is not good enough" from those who triggered the changes to
begin with.

> Speaking of bigger improvements... it seems that with the patch below, 
> and the fact that it passes the existing tests, we have at least 
> established that the contents of the C strings that libjansson returns 
> and our "decoded" strings are very often exactly the same. So most of 
> the time what code_convert_string does is not really conversion, but in 
> effect verification. I'm betting it's a frequent situation in other use 
> cases, too.

Of course.  Verification code almost always comes up empty-handed.  it
doesn't mean we can throw it away.

> So one optimization (more complex to implement, I'm sure) would be to 
> defer creating coding->dst_object inside decode_coding_object until 
> we're sure we need it (the source and destination bytes actually come 
> out different), and if we don't, return src_object in the end (I'm only 
> taking about the case when dst_object is Qt). That might improve 
> performance across the board, including during the encoding step. Or 
> might not, of course. What do you think?

I don't want to make changes that affect decoding everywhere, because
having raw bytes in other cases is a more frequent phenomenon.  Let's
just optimize JSON parsing, OK?

> 
> diff --git a/src/json.c b/src/json.c
> index 928825e034..2b0cc8a313 100644
> --- a/src/json.c
> +++ b/src/json.c
> @@ -225,8 +225,7 @@ json_has_suffix (const char *string, const char *suffix)
>   static Lisp_Object
>   json_make_string (const char *data, ptrdiff_t size)
>   {
> -  return code_convert_string (make_specified_string (data, -1, size, 
> false),
> -                              Qutf_8_unix, Qt, false, true, true);
> +  return make_specified_string (data, -1, size, false);
                                                   ^^^^^
Should be 'true', right?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:31:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:31:25 2019
Received: from localhost ([127.0.0.1]:51268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIauj-0001zb-FC
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:31:25 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:52001)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIaui-0001zP-D9
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:31:24 -0400
Received: by mail-wm1-f41.google.com with SMTP id 4so14866312wmf.1
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 08:31:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=u4HytY8wOepVS74ozCA3Nq164gFYu8TKMg12o/dripA=;
 b=nxXVlfRzfqK4gOou4XN1URw4FH4nZarGSGnybUOrIxbWh7oV9Me73pbFf9IYs9QeaQ
 uITmnUwbrrU8l1szfovCuDELEHZShDwVtE2V/Rlcb6WC8sF48Ycnt3QFV3dpPOt15Ow1
 F4Ogkhy+lDh9k7z1M6MtK8l1accVk71U+qbzIpbGstt8q1VIFbDugeWSU8Itgt+lpQbo
 TAuLihLe732HuX5Y5Cslhy98ML7RC/31Pins0eentZ95KuHeScS/BEMf+xMQnD3STOCK
 3izGOwQBJanEdJDSKyl3bqs1Y/3aWYAS/cRhBxIhaCuc1RFM7nhuuWdzFAz0M5WCru8h
 lCLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=u4HytY8wOepVS74ozCA3Nq164gFYu8TKMg12o/dripA=;
 b=FyB4q52q3Z1Q+nxz1jGnSeB48rCepHAwmSYkDN87CJEPqwqHJNogBkmWHU6jlFGUW7
 g1jYZMi+nO6wIDZ5gYyAE3iVVLGnncBOD6nLfwTVJxxWFopUtPVLFOtX40Mq73kv3XM5
 UDpAqYgNEQBpjWIGXfSlfw1PESpAHRU6N9YHn0vHnPqPc487F7Wqf4c2TQ3WYWSG/e/s
 dv67s23L4le32yDi30kx43xZ4wl+Gg8QPQ/65DVBaoFP3BGl9Q2yDVanUvU6Qg7Ygd4J
 WYj3RIYQVu7h60CGQroKYoXfOWAcYSdFQ3LXc+xCkZ9R2x2m72jf/KsWHgbwpJcMlqjx
 8B7g==
X-Gm-Message-State: APjAAAXsLu/L8I+7YtGqS2jeCUCoVVc0+5CWzCgw62E0YYiBFUaZ+vns
 Y2pVLsMXKa+wOnrrysMYRRKxJIx7
X-Google-Smtp-Source: APXvYqyS6uyVKBYRUkHDdfPFP910zn025aCzngaAZxmT2I1Yrnsq5F/KbwviBri8JNL4pO54JDobvw==
X-Received: by 2002:a1c:cb08:: with SMTP id b8mr132023wmg.59.1555947078391;
 Mon, 22 Apr 2019 08:31:18 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id b9sm18123912wmc.9.2019.04.22.08.31.16
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 08:31:17 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN> <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN>
 <83d0le8q8b.fsf@HIDDEN> <3ae05c72-88bb-8748-2a2c-beae2d9a2746@HIDDEN>
 <835zr66p21.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <256a3d8a-2d1a-4cf7-7217-46df4059d93e@HIDDEN>
Date: Mon, 22 Apr 2019 18:31:15 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <835zr66p21.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 18:24, Eli Zaretskii wrote:
>> That actually means that speeding up code_convert_string might
>> *potentially*  (e.g. if it's infinitely fast) yield more than 50%
>> performance improvement.
> code_convert_string doesn't do much, it just calls the encoding or
> decoding function.

Right. I don't mean that the change would be inside 
code_convert_string's implementation necessarily. Probably in some of 
functions it calls.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:26:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:26:04 2019
Received: from localhost ([127.0.0.1]:51262 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIapX-0001px-No
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:26:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42581)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIapW-0001pU-4U
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:26:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42340)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIapR-0000J4-0i; Mon, 22 Apr 2019 11:25:57 -0400
Received: from [176.228.60.248] (port=3153 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIapQ-0006BA-7H; Mon, 22 Apr 2019 11:25:56 -0400
Date: Mon, 22 Apr 2019 18:25:48 +0300
Message-Id: <834l6q6ozn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 16:58:05 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
 <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 16:58:05 +0300
> 
>  > AFAIU, doing so produces a better measurement of the JSON
>  > parsing part alone.
> 
> But not a better measurement of how json.c is actually used, I'm afraid 
> (unless you're trying to cut out the time Emacs spends reading from 
> disk). So even if my benchmark gives more attention to buffer-decoding 
> routines, it probably reflects practical usage too (JSON usually comes 
> from HTTP response, and it has to be decoded as well).

But it shows the upper limit of what we can expect, and it avoids the
danger of having unrelated factors obscuring the actual performance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:24:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:24:39 2019
Received: from localhost ([127.0.0.1]:51257 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIaoB-0001mq-8c
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:24:39 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIao8-0001mV-Si
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:24:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42323)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIao3-0007MZ-93; Mon, 22 Apr 2019 11:24:31 -0400
Received: from [176.228.60.248] (port=3065 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIao2-00062S-Lt; Mon, 22 Apr 2019 11:24:31 -0400
Date: Mon, 22 Apr 2019 18:24:22 +0300
Message-Id: <835zr66p21.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <3ae05c72-88bb-8748-2a2c-beae2d9a2746@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 16:54:19 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN> <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN>
 <83d0le8q8b.fsf@HIDDEN> <3ae05c72-88bb-8748-2a2c-beae2d9a2746@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: yyoncho@HIDDEN, sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 16:54:19 +0300
> 
> On 22.04.2019 10:16, Eli Zaretskii wrote:
> > Please don't forget that json-parse-string first_encodes_  the input
> > string in UTF-8, then passes it to libjansson, then_decodes_  each
> > string element it receives back.  So we do some non-trivial processing
> > besides make_specified_string, and removing decoding only saves part
> > of that.
> 
> That actually means that speeding up code_convert_string might 
> *potentially* (e.g. if it's infinitely fast) yield more than 50% 
> performance improvement.

code_convert_string doesn't do much, it just calls the encoding or
decoding function.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 15:02:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 11:02:48 2019
Received: from localhost ([127.0.0.1]:51246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIaT2-0001DY-8X
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:02:48 -0400
Received: from mail-wr1-f66.google.com ([209.85.221.66]:33419)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIaSz-0001DI-Td
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 11:02:47 -0400
Received: by mail-wr1-f66.google.com with SMTP id a3so6499875wrx.0
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 08:02:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=Ux1VD7S7y3PpihAdbhKGtW/Vi8uGcW04El3Y+oXJzg8=;
 b=svDLcDogA2/3Dl711bGix54zYFAjQxxT+1XWjZ50wUHCkSpkbJ4yIkikBbIKG4FmH4
 q3j4L6pgXTAVakjyEjhVs+QOCNN9kcisd+9jxJpIbZoSbsRVuai0r/81LeDpd+8XFKw1
 239WgGcP0zz6gUzKdApTwD2cvFiykkS+gBekuYj/4ClmJpI5VcN7Jg3DwYfqcyX7lf4P
 pneyNHNYzFh/DAL4z5UsaqPWOIToylZx6CRmVKFzFAac5SNwp0nExkjnr49g4CewDijr
 OdgpKG7E++XGOUNBGd4IZcdcfd4ToATTsXoY9pccGsxBWOasbU2PXx/KagQYOweuH8QN
 bwzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=Ux1VD7S7y3PpihAdbhKGtW/Vi8uGcW04El3Y+oXJzg8=;
 b=bSLOXjFtqt1gVCuy3lDR6cdPhqs9hRdn9IyR2JcOuhmn1hSS1DSkm/IQTzc5yao2SU
 E4G/9sHGaaqu/SuRffnGNGbA2TQ9ueXn9Kc4XsAhODJw5ubXWgu0pQM1c6CxtiqiB9TU
 W89vnfLEicBP/wu6SXNxb5ktlOBvVt455UyAWYhFqkMWEXDkwzsN2xhqvOMKNytDOZHO
 M3IiCPEeA3IWBaHwEqT8ACYWNTbmmhafTi2W87/H/opsjU9Mno0S8d3nxgLlS/6gEre9
 MTwvfLzquCOhpNt6/cfSXzUWj/cm/HP0Zl6JKWxeDRQoUVpmoHENGlEewHdW7xHCJri+
 K5PA==
X-Gm-Message-State: APjAAAV6z8+jCzBnwVGhMa/eewZWbimsPfXnEixWX9ugwyMwhyjzoy77
 K9IoEwxfkPegz+PH8BRHL/9/d/s5
X-Google-Smtp-Source: APXvYqy63+f5Kcy4zf8eXIO3QJW8Fdhvm1brsa6Eu4DQBTpWYDEUghoMFm/AAcVuYNqTE3mQvvhi4A==
X-Received: by 2002:adf:e547:: with SMTP id z7mr12802394wrm.295.1555945359433; 
 Mon, 22 Apr 2019 08:02:39 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id 11sm9791962wmk.17.2019.04.22.08.02.36
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 08:02:37 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> <83k1fm6vly.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <19b19dec-a5a0-e08d-6026-0b9621d38143@HIDDEN>
Date: Mon, 22 Apr 2019 18:02:35 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83k1fm6vly.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22.04.2019 16:02, Eli Zaretskii wrote:

>> Thank you. Tried it, tests now pass, and the performance improvement is
>> the same. I compared the same benchmark (100 iterations, GC disabled for
>> the whole duration), and this patch takes
>>
>> src/emacs -Q --batch -l ~/examples/elisp/json-test.el
>> Elapsed time: 51.153870s
>>
>> down to
>>
>> $ src/emacs -Q --batch -l ~/examples/elisp/json-test.el
>> Elapsed time: 26.268435s
>>
>> Are you still against it? (Just checking).
> 
> I'm still against using that patch as is, yes.  I'm okay with using
> make_specified_string if before calling it we make sure the string is
> plain ASCII or a series of proper UTF-8 sequences.  Not sure how much
> of a performance hit would such tests cost us, but if you are
> interested, let's time them.

Sure.

> (Let me know if you need help in writing the code for the above 2
> tests.  I think parse_str_as_multibyte should help a lot.)

I do.

At the very least: am I supposed to use parse_str_as_multibyte similarly 
to how make_string does, or to write a function similar to 
parse_str_as_multibyte? I can more or less follow its logic, but I don't 
understand if any of its callees cannot cope with improper input.

> I guess we should also have some test case with non-ASCII characters,
> if we will introduce these optimizations.

We already do in test/src/json-tests.el, like I previously mentioned. 
And the simple patch (which you're against) passes them. I've put the 
patch at the end of this email so we're on the same page.

> Thanks.
> 
> P.S.  I'm still not sure these optimizations will make the OP happy,
> since at some point I heard them saying that our present performance
> is abysmally slow and inadequate.

Well... IIUC Node.js's JSON parsing is ~10 times as fast. Ruby's parser 
speeds vary from ~9 times as fast to ~3 as fast, for comparison.

For LSP usage, we are of course comparing with Node. But since we're 
still here, and lsp-mode has some users, reaching Node's performance 
level is likely not a life-or-death situation.

> If that wasn't a wild exaggeration,
> then halving the time will still be inadequate.  So maybe we should
> agree in advance whether 30% to 50% improvement will be "good enough",
> before we embark on this adventure.

If we're talking about big changes and increases in complexity, sure, we 
should weigh them. But if a simple change gives us even a 20-30% 
improvement, why not take it? The reporter is not the only one who 
parses JSON in Emacs.

Speaking of bigger improvements... it seems that with the patch below, 
and the fact that it passes the existing tests, we have at least 
established that the contents of the C strings that libjansson returns 
and our "decoded" strings are very often exactly the same. So most of 
the time what code_convert_string does is not really conversion, but in 
effect verification. I'm betting it's a frequent situation in other use 
cases, too.

So one optimization (more complex to implement, I'm sure) would be to 
defer creating coding->dst_object inside decode_coding_object until 
we're sure we need it (the source and destination bytes actually come 
out different), and if we don't, return src_object in the end (I'm only 
taking about the case when dst_object is Qt). That might improve 
performance across the board, including during the encoding step. Or 
might not, of course. What do you think?

diff --git a/src/json.c b/src/json.c
index 928825e034..2b0cc8a313 100644
--- a/src/json.c
+++ b/src/json.c
@@ -225,8 +225,7 @@ json_has_suffix (const char *string, const char *suffix)
  static Lisp_Object
  json_make_string (const char *data, ptrdiff_t size)
  {
-  return code_convert_string (make_specified_string (data, -1, size, 
false),
-                              Qutf_8_unix, Qt, false, true, true);
+  return make_specified_string (data, -1, size, false);
  }

  /* Create a multibyte Lisp string from the NUL-terminated UTF-8




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:58:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:58:17 2019
Received: from localhost ([127.0.0.1]:51163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIZSa-0007y0-RB
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:58:17 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:39569)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIZSY-0007xj-1u
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:58:14 -0400
Received: by mail-wm1-f42.google.com with SMTP id n25so14569089wmk.4
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 06:58:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=k1MKG4olwWmuemW2msXvYYqfzkuNKgtaJ7pTRaeXZ5A=;
 b=L5TC8Vu3R1jh7Wc9Q+g6OsFDqfRrNwp2nJt+HEwSnkx0jd0jAvf07jbF6J+s+PBVAE
 4G2BSXGHRgONVLhHDMCn7LuDFLvwFsMH00WCXnmsfRWJV/bYuawo+uGyGzDtq2Tcs4DK
 2YEc+O/QQdTHyKD2spopD5q80u71/MttOBeAvCuF+Lt1N6hWxWQappokRjepvN/aBPQb
 BgdDMF6fFz3mhJajg2XtWy9IFPdT97zJ89i0Uz1WF6TxxRbEvBDUpkF+v8G1E83yxQJl
 F+bS/QhfI8vrq4FY7sJ1vrBBUA4Yer5v+/yUVflQoD0U6Up01fF9PO0DfpkCGY8m7o1u
 kdOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=k1MKG4olwWmuemW2msXvYYqfzkuNKgtaJ7pTRaeXZ5A=;
 b=r1D8xH6QmOZvBoI6zLQEZuDMaXuHxFwLvHomovSnf1SjsSVwuQ17L+j4T+UdGdnd+4
 lGoGv/UpYKm8UnPAVuyxZVYklD0uknc+/Nl0Klpe6XFDTUtAHbBFoKhqWNMJJTx/AFVV
 bJluj8eq7SNnwbIoHMi08ceG6Qmjg55z1G6CJXbXPn4yjBPmJxrRIurTtClJ9MSvqv/W
 vJ7DJLgFVn574eUBPmtePLIohws9AAtBbfN1fwEEmBl7QfWHq4N2YwtyXrZRxFJLCYoc
 NqkVmjCvKuyj2PjtpGBf/yhvVhJO9uvpDuxiSGZexrdBnY/Mcs4Tj78A+CwJhJ85ErBw
 QmEQ==
X-Gm-Message-State: APjAAAVJ9yoIRJFfebLiiKpRFJCaX8cAR07u8uZuZnLdmmOImt7w6Il8
 5GK8OxvhAOFsWvx2lUL1WYZbWqE8
X-Google-Smtp-Source: APXvYqyJIuxOwHABdUSMnMEmKjE8mJiHpOPHsUDw8Nt/gS2L3DQ3m2GrOQMBMyIPZ/WXymeGsTzFgQ==
X-Received: by 2002:a7b:c446:: with SMTP id l6mr12218877wmi.80.1555941487869; 
 Mon, 22 Apr 2019 06:58:07 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id a126sm12313644wmh.4.2019.04.22.06.58.06
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 06:58:07 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> <83h8aq6v6a.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b09b4c06-1558-4ff3-7fc0-5310d52d4c5a@HIDDEN>
Date: Mon, 22 Apr 2019 16:58:05 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83h8aq6v6a.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 16:12, Eli Zaretskii wrote:
> They are the same.  The difference is that you visit the file inside
> the benchmark loop, whereas I left only the conversion inside the
> loop.

Interesting. I'll try that out as well sometime.

 > AFAIU, doing so produces a better measurement of the JSON
 > parsing part alone.

But not a better measurement of how json.c is actually used, I'm afraid 
(unless you're trying to cut out the time Emacs spends reading from 
disk). So even if my benchmark gives more attention to buffer-decoding 
routines, it probably reflects practical usage too (JSON usually comes 
from HTTP response, and it has to be decoded as well).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:54:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:54:31 2019
Received: from localhost ([127.0.0.1]:50235 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIZOx-0007eg-7n
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:54:31 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:42159)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIZOv-0007eT-Al
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:54:29 -0400
Received: by mail-wr1-f46.google.com with SMTP id g3so15890846wrx.9
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 06:54:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=qk+a639+tn5dfvqVGmwCN2iqCmyUCN6gkCPeeoQ2MU4=;
 b=a3hmf6dw2U50DlhbHO9/9lUV4+WLg4udKapXDrCj+sQ1pB3uB0dFL4g+oQog+jXrVp
 cYA8SMfwFbMUd+k2goks2sKpk7bbLHEOxZLK9WNKzfOhsjd8g2WFqklP+dwGKrDgcMTz
 18kcYgos7pI6E/DZwfhO1FdO0GYRKBV6Vz8Xcq9Rvw15sD35cxjgJus3Jgle7Sf02o9g
 /+MZcV4Vao9kTXJOeDlPrwebxO2OTcS+J7ndtQeaaJaz6YRcnJ6662tu3shKNU53MKTF
 7dywsB0LvjQSwWR4V77jizQR8zicBalOqvihCWOD0pmuixWDilUiCLnfxkzePW5977as
 tPxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=qk+a639+tn5dfvqVGmwCN2iqCmyUCN6gkCPeeoQ2MU4=;
 b=AYxVUSL6U7L2WjdB4aXhsDx6h3imzj30v14eFp/27CK58/riCaEY3bKKeNfr04AX58
 muQt2AAajy5UA4eRUzDpUfoT5ePWp3X7nFAcniOEjuiUUCoV6D1EHWFCvVkw/+E78zEq
 adutgxvIbOVG88xIc4sJatGAVukBu4BUv4cjTNbsp9wTOoDHJBxPH+k4P5wOV7fML+zH
 lZlTBhePJFlEe2h9hlqXvu+S0oMrKvj0uRRZfCX91PKx+Ft4QyiNQ1BPXbvsqlfBxbQ6
 o2GhfnLE1XaepLYQKTZBSpLT8CtmWWyUjSFtj1hxEf0+dRI+Z0v0xvrjEvhoaLbNPRfW
 h6aA==
X-Gm-Message-State: APjAAAXFz0ldqEWk0TdXXyr2K/70xvz9tmSvBJxZwczc1xVuUwu4eHti
 y4PdxKhElqQDlZyYiS9YEUhXkg9T
X-Google-Smtp-Source: APXvYqxIjA7xlfoO4Wl7E84edepW/b/zkyjr8A4cGK9XmF73/6RKzxOBwmrsWuUQgsHH9pBOWrgMLw==
X-Received: by 2002:adf:dcc7:: with SMTP id x7mr7626762wrm.6.1555941262966;
 Mon, 22 Apr 2019 06:54:22 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id h206sm47177wmf.29.2019.04.22.06.54.21
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 06:54:21 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN> <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN>
 <83d0le8q8b.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <3ae05c72-88bb-8748-2a2c-beae2d9a2746@HIDDEN>
Date: Mon, 22 Apr 2019 16:54:19 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83d0le8q8b.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 10:16, Eli Zaretskii wrote:
> Please don't forget that json-parse-string first_encodes_  the input
> string in UTF-8, then passes it to libjansson, then_decodes_  each
> string element it receives back.  So we do some non-trivial processing
> besides make_specified_string, and removing decoding only saves part
> of that.

That actually means that speeding up code_convert_string might 
*potentially* (e.g. if it's infinitely fast) yield more than 50% 
performance improvement.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:17:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:17:43 2019
Received: from localhost ([127.0.0.1]:50196 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYpK-0006iy-I0
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:17:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46167)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIYpI-0006ik-8n
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:17:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40588)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIYpC-0008Qm-9q; Mon, 22 Apr 2019 09:17:34 -0400
Received: from [176.228.60.248] (port=3231 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIYpB-0008SS-Gx; Mon, 22 Apr 2019 09:17:34 -0400
Date: Mon, 22 Apr 2019 16:17:24 +0300
Message-Id: <83bm0y6uxn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUVR3cZYe3BUmnD6bKm22GuXT6fuNpE7tMrsKXwrruoFg@HIDDEN>
 (message from yyoncho on Mon, 22 Apr 2019 16:00:13 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
 <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
 <837ebm8o4e.fsf@HIDDEN>
 <CACCVLQUVR3cZYe3BUmnD6bKm22GuXT6fuNpE7tMrsKXwrruoFg@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 22 Apr 2019 16:00:13 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> JSON spec is stable. FYI json.el parser is 568 loc. Both formats have a similar complexity with json being a
> bit simpler(fewer data structures).

Then I hope someone will try implementing that as part of Emacs, and
we will see the resulting performance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:12:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:12:31 2019
Received: from localhost ([127.0.0.1]:50187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYkJ-0006aQ-Ix
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:12:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45377)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIYkI-0006a9-4C
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:12:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40496)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIYkC-0005WQ-Uy; Mon, 22 Apr 2019 09:12:24 -0400
Received: from [176.228.60.248] (port=2873 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIYkA-00046O-RU; Mon, 22 Apr 2019 09:12:23 -0400
Date: Mon, 22 Apr 2019 16:12:13 +0300
Message-Id: <83h8aq6v6a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 15:58:57 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
 <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 15:58:57 +0300
> 
> On 22.04.2019 15:07, Eli Zaretskii wrote:
> > I don't know why.  In my profiles I enlarged the iteration count to
> > 100, and also enlarged the sampling frequency.  Maybe that's the
> > reason.
> 
> I posted my invocations here, with all arguments. I didn't see yours.

They are the same.  The difference is that you visit the file inside
the benchmark loop, whereas I left only the conversion inside the
loop.  AFAIU, doing so produces a better measurement of the JSON
parsing part alone.

> > The percentage taken by decode_coding_utf_8 didn't change as
> > result, FWIW.
> 
> Maybe it's not the only bottleneck. What about produce_chars? And 
> malloc, of course. Here's the top of my profiling report again:

produce_chars is a subroutine of any decoding routine, including
decode_coding_utf_8, so I added that to the score.  In my profile,
produce_chars took 3.77%.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:12:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:12:02 2019
Received: from localhost ([127.0.0.1]:50176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYjq-0006Yr-6S
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:12:02 -0400
Received: from mail-wm1-f54.google.com ([209.85.128.54]:56121)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIYjo-0006YX-Fo
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:12:00 -0400
Received: by mail-wm1-f54.google.com with SMTP id o25so14388207wmf.5
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 06:12:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=5tc7439a9veyrBdVrMQoRsm4SmMIHujibvVSsnmGldQ=;
 b=OHebNJnJxUhy7CL559N2rf8K0a17GPZGoSDNR4LO3HL/f/vMN9hQ81Sywsf1lcRSPm
 DmktI+4i3cdvdG5D6lPgO1aHoxn7yU3ToLeq4PELKwF5M9R7qCuqf8+Y4ewxokjEUA5n
 muWaslQLznORQFUFPXSuhWrP7m6twsxG3auGjgBajcT/ti4yJR4eH1H/9dBYMhpMixlo
 roGY9+aRUp0rwXLHdHayLzlRsuldlUP2dKWv8cpW44FdGRDlG6pv/w+66X3YE7hRXG3w
 wpmyLki1XrUKfdWxihfQl17qR+ya4LKNBoJJWU0ybFOH4VN3LWmNqMmFCekHW/lmlgGq
 PShw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=5tc7439a9veyrBdVrMQoRsm4SmMIHujibvVSsnmGldQ=;
 b=BkPjbJSVQp6EBPFpAd3ORo3cMUUfM5xGItUi1TOfYMaEaHeec4nmPLmW+7xjgAfyft
 42aTcqx23OZ6yilFDeq3jgHOwCiOO8N2x1UIG/TsmuH4umma8J9g04nVQSkDOm9+cgq7
 cYqaeFF+vBWIEBOMB6c5bPKScz/BXLROdLfJ9zLA9/12qBuZi+IQYS2ZVrljU/Rpt5PM
 VF8va7FWD4RiaYctzVSOAzUtJdBwdtd6JG6FBEXAPfq/k3DjRe+TnoLzJABw9fiuqsck
 zXzg26wAlAxfN6hhsiPghGcY23eNKLmzSyO9594pYVnYHBDa7d76fzIJNQnL4pvZQSDa
 iopA==
X-Gm-Message-State: APjAAAWRcAO3chY6HYR7T804R0RqiQwXPLv61CV+aiQoil6jMGtb+9/c
 f/LWY4j4SkuGdIWsL69g9KSeNKzr
X-Google-Smtp-Source: APXvYqxEQAMQ4V//QZ9lzkkTjOSK97wOZBc3ZZ82mUmI5oXWqf/HuGo13yJn6ALrHL5px++rMmGa/g==
X-Received: by 2002:a7b:c458:: with SMTP id l24mr12771381wmi.75.1555938714495; 
 Mon, 22 Apr 2019 06:11:54 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id 4sm10112685wmg.12.2019.04.22.06.11.53
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 06:11:53 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <9ced2e6e-aed3-ba15-da93-85ff557deb88@HIDDEN> <83o94y6yfk.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <04adad65-cc86-7a2e-a94f-b1ca8ddf2c2a@HIDDEN>
Date: Mon, 22 Apr 2019 16:11:52 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83o94y6yfk.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 15:01, Eli Zaretskii wrote:

>> On 22.04.2019 1:12, Dmitry Gutov wrote:
>>> Considering libjansson manages to do both JSON parsing and string
>>> conversion in ~the same time make_specified_string only does string
>>> conversion on the returned strings, it most likely follows that
>>> make_specified_string could be made faster.
>>
>> ^ Sorry, I meant code_convert_string here.
> 
> That one is called both for encoding the input and for decoding the
> strings in the result of parsing.

Right. So only the call to code_convert_string from json_make_string. 
The decoding part.

So roughly:

String encoding plus libjansson parsing plus other logic in json.c takes 
~the same time as string decoding only.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:03:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:03:09 2019
Received: from localhost ([127.0.0.1]:50159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYbF-0006LB-7a
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:03:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43312)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIYbC-0006Ke-4b
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:03:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40338)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIYb6-0007dr-6p; Mon, 22 Apr 2019 09:03:00 -0400
Received: from [176.228.60.248] (port=2299 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIYb5-0000Tm-HC; Mon, 22 Apr 2019 09:03:00 -0400
Date: Mon, 22 Apr 2019 16:02:49 +0300
Message-Id: <83k1fm6vly.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 15:24:24 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
 <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 15:24:24 +0300
> 
> Thank you. Tried it, tests now pass, and the performance improvement is 
> the same. I compared the same benchmark (100 iterations, GC disabled for 
> the whole duration), and this patch takes
> 
> src/emacs -Q --batch -l ~/examples/elisp/json-test.el
> Elapsed time: 51.153870s
> 
> down to
> 
> $ src/emacs -Q --batch -l ~/examples/elisp/json-test.el
> Elapsed time: 26.268435s
> 
> Are you still against it? (Just checking).

I'm still against using that patch as is, yes.  I'm okay with using
make_specified_string if before calling it we make sure the string is
plain ASCII or a series of proper UTF-8 sequences.  Not sure how much
of a performance hit would such tests cost us, but if you are
interested, let's time them.

(Let me know if you need help in writing the code for the above 2
tests.  I think parse_str_as_multibyte should help a lot.)

I guess we should also have some test case with non-ASCII characters,
if we will introduce these optimizations.

Thanks.

P.S.  I'm still not sure these optimizations will make the OP happy,
since at some point I heard them saying that our present performance
is abysmally slow and inadequate.  If that wasn't a wild exaggeration,
then halving the time will still be inadequate.  So maybe we should
agree in advance whether 30% to 50% improvement will be "good enough",
before we embark on this adventure.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 13:00:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 09:00:33 2019
Received: from localhost ([127.0.0.1]:50155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYYi-0006H7-Oo
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:00:32 -0400
Received: from mail-lj1-f182.google.com ([209.85.208.182]:44876)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIYYh-0006Gr-RI
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 09:00:32 -0400
Received: by mail-lj1-f182.google.com with SMTP id h16so10203836ljg.11
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 06:00:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=YrxQ9BsyojA0JDxApgvSt7eVvEM4VEHz3DoLoqO1Z68=;
 b=hXnzpVd5wGOM+fKevyLKehKeKoLKWX81iFR80b7rfgOaBWtFiEddR9jZeccF714xqp
 QVk4KU+t+tiZ4I8dX1I9UMxbvTmHmtbdd1MEK/HO6TYeFbIaQBeitYD8g8ib31xoC5qv
 WPpzjpBbPCBQojKqLJSShZIx9nzd4VVjGI6DK8+LXBFVGc4OsRxaMoP8nxSeGpvPn6PE
 MVnb+pjC1IXSI8vHVqqsRJtkqsZsfHG2/yKmcVVgp7rvkZZhIBBV2LKaUMU8npX/OPoU
 P9sLg2D+E5PCaIJsi/evNgcCfzcddYCSB04ACXhE3fDbSH77wC/V1GdRzzavKMWEYFS8
 i87Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=YrxQ9BsyojA0JDxApgvSt7eVvEM4VEHz3DoLoqO1Z68=;
 b=En8R9nYwFaaZvtEx6j5BC2ypKQbp2Rpk1J82CYDbIozj0IKXmxyJ2zX7q8WzHOh7eP
 KMvn54PfiIZjZV1hhWgyA/f1kasLd4nLaMcYntzBmgdBntednhnmy/WolFdp2tNg9Qoc
 fOj0g1F5S41gI0eCjEofAu4luxqojewEsWb2QvZCCdTghCgUpGb7wXuOjJXiu+qNQpHk
 5R2lyZJ/oY154up+p0R4wYXT8P1W7RKdQcFaqp5jo2A14ARnU8eedUQWMbLfrxXyQcna
 tfSwlwIPxXWOCyFvrfntNiCWii5IALSRXdClWfAoquuSRN1bfxSuvJHenpfp5uPhWDgZ
 a/qw==
X-Gm-Message-State: APjAAAXqIjh/CYC9xfuKj0W71lFMRR9Hpzmn/t6Jk0qmhc/vNqC7K4V5
 /dqeFi8dtp/ri+ZMxksr4A+/bkh8wM8JwucLlCQ=
X-Google-Smtp-Source: APXvYqxURaY9rK+WJi5GvUtE5QcwX8sgjHPu5Iu1iaCSM4bbyjMlZ4qo44enF9nk78dd4t+M6Sf+mNXbVOk7xlmD978=
X-Received: by 2002:a2e:97d3:: with SMTP id m19mr10074523ljj.63.1555938025711; 
 Mon, 22 Apr 2019 06:00:25 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
 <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
 <837ebm8o4e.fsf@HIDDEN>
In-Reply-To: <837ebm8o4e.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 22 Apr 2019 16:00:13 +0300
Message-ID: <CACCVLQUVR3cZYe3BUmnD6bKm22GuXT6fuNpE7tMrsKXwrruoFg@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000050ad6205871e0d8a"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000050ad6205871e0d8a
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

If you were suggesting that we implement reading JSON objects as part
> of Emacs, then yes, this won't need to encode/decode anything.  I'm
> not sure the result will be as fast as read-from-string, since we are
> talking about a different syntax.  Also, I'm not sure how hard would
> that be nor how much maintenance will it require (does the JSON spec
> change frequently?).  But if someone knows the answers, perhaps it's
> an alternative worth considering.
>

JSON spec is stable. FYI json.el parser is 568 loc. Both formats have a
similar complexity with json being a bit simpler(fewer data structures).

Thanks,
Ivan

--00000000000050ad6205871e0d8a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi Eli,</div><div dir=3D"ltr"><br></div><=
div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>If you were suggesting that we implement reading JSON objects as part<br>
of Emacs, then yes, this won&#39;t need to encode/decode anything.=C2=A0 I&=
#39;m<br>
not sure the result will be as fast as read-from-string, since we are<br>
talking about a different syntax.=C2=A0 Also, I&#39;m not sure how hard wou=
ld<br>
that be nor how much maintenance will it require (does the JSON spec<br>
change frequently?).=C2=A0 But if someone knows the answers, perhaps it&#39=
;s<br>
an alternative worth considering.<br></blockquote><div><br></div><div>JSON =
spec is stable. FYI json.el parser is 568 loc. Both formats have a similar =
complexity with json being a bit simpler(fewer data structures).</div><div>=
<br></div><div>Thanks,</div><div>Ivan=C2=A0</div></div></div>

--00000000000050ad6205871e0d8a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 12:59:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 08:59:08 2019
Received: from localhost ([127.0.0.1]:50151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIYXM-0006DV-An
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:59:08 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:50504)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIYXJ-0006D1-Ph
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:59:06 -0400
Received: by mail-wm1-f42.google.com with SMTP id z11so14477423wmi.0
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 05:59:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=j/UvIDqtIdxbIv0ZmIferOsy4//7m/nF8yJ5NnbZgWY=;
 b=VKt3BZUx0isLADxjht/jgODCjoBZh8462kksCNMHPaccvajaME0u8geZxRf3ZoF1t4
 9a7gmvh/0xKFuwY8jOvBSibcJc+f4BN2YejWHj1L7/tLENm/CdDJc19ObuM8S+8VVaLC
 UUWk4+bqt0wNPDRgzOq/r8ektN8DNQ4s8cQLUwkAHAobCuvJwhtDyUFFjy6nh24jxS58
 snY24piEpp8MusbkSDXSg2AVFoVou95V7yuQT11BVBzIjkzjLjo6SfC0bdIwkr367gx9
 OXO6q6RIRwEHUhI6P8fyu3gOU43CK4fQK/rzdfYN+R+fFOVFCq9aS+1oF+g/rYzI6I9w
 QZ2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=j/UvIDqtIdxbIv0ZmIferOsy4//7m/nF8yJ5NnbZgWY=;
 b=Wr8iAsmciQOgMdDU092cOPiFqHW3Px2YARIs1e/tvGEEMwrgh8i6TYBwlrNvWMzhOP
 PRHaN0Eado5NIVMdhsgkg9ToHwc1SPxF2OYCAi1r8OeU9XX4ASUJMshFCClPhysDS9SP
 FVCHEC8ASifletEYc/pCthGkefJGvHwhKBoB/zTRQ1gZcMp9NkfkYPAAM441NXFtkfDS
 gL+UOR+j2LaggzNJWypD1uLtIkQaMc8Hi/n5JA42Lj0LkzVRCQoDtGLsPb8+GzMe/F/6
 RsbhZWiQryZoKtljsbBgRDDP6/2+c8VgpFPuyPlTrDstQ6L4omIlvdwZ2ReOw/CKAijF
 bD4A==
X-Gm-Message-State: APjAAAWDcxxFSud4XF6IQ2wsRahARHatdf9FsW24w67mEg20HhQ1KyVi
 qpfOXpz4o7MfnHHU/Uaa9wHmIs5I
X-Google-Smtp-Source: APXvYqw8DaoAiBA5Vs3GhsQ8zb71THx00z/dAhb4FJl+/aHSLcAlNo1sSUMc1qSf3l0aezQNH5X7gA==
X-Received: by 2002:a1c:486:: with SMTP id 128mr12245862wme.3.1555937939606;
 Mon, 22 Apr 2019 05:58:59 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id o1sm17898663wmh.47.2019.04.22.05.58.57
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 05:58:58 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> <83muki6y6r.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <4b8c6799-e845-768b-749c-f2a883ab89f8@HIDDEN>
Date: Mon, 22 Apr 2019 15:58:57 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83muki6y6r.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 15:07, Eli Zaretskii wrote:
> I don't know why.  In my profiles I enlarged the iteration count to
> 100, and also enlarged the sampling frequency.  Maybe that's the
> reason.

I posted my invocations here, with all arguments. I didn't see yours.

> The percentage taken by decode_coding_utf_8 didn't change as
> result, FWIW.

Maybe it's not the only bottleneck. What about produce_chars? And 
malloc, of course. Here's the top of my profiling report again:

  6.00%   229  emacs    emacs                 [.] decode_coding_utf_8
  5.31%   206  emacs    libc-2.27.so          [.] malloc
  4.57%   177  emacs    emacs                 [.] produce_chars
  4.12%   164  emacs    libc-2.27.so          [.] malloc_consolidate
  4.05%   161  emacs    libc-2.27.so          [.] cfree@GLIBC_2.2.5
  3.38%   135  emacs    libc-2.27.so    [.] __memmove_avx_unaligned_erms
  3.23%   125  emacs    emacs                 [.] store_symval_forwarding
  2.63%   102  emacs    emacs                 [.] do_symval_forwarding
  2.58%   104  emacs    libc-2.27.so          [.] _int_malloc
  2.58%   100  emacs    emacs                 [.] set_buffer_internal_2
  2.41%    93  emacs    emacs                 [.] allocate_vectorlike
  2.08%    81  emacs    emacs                 [.] json_to_lisp
  1.90%    81  emacs    emacs                 [.] detect_coding_utf_8
  1.85%    72  emacs    emacs           [.] swap_in_symval_forwarding
  1.72%    72  emacs    emacs                 [.] detect_coding
  1.38%    31  emacs    emacs                 [.] insert_from_gap
  1.29%    50  emacs    libjansson.so.4.11.0  [.] json_delete
  1.19%    46  emacs    emacs                 [.] hash_lookup
  1.01%    39  emacs    emacs                 [.] decode_coding
  1.01%    39  emacs    libjansson.so.4.11.0  [.] json_array_get




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 12:24:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 08:24:35 2019
Received: from localhost ([127.0.0.1]:50092 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXzv-0005Ou-Go
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:24:35 -0400
Received: from mail-wr1-f54.google.com ([209.85.221.54]:35450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIXzt-0005Og-DW
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:24:33 -0400
Received: by mail-wr1-f54.google.com with SMTP id o12so12302703wrn.2
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 05:24:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=zqbrDlk5oAdh8cp8uwyXhDJX7ma0PoYUF40Vz8bucso=;
 b=uwS8spPP1BfmPdMP1BW/+GG2/rZNxk5IFMP3gYQRadmOhZAGqY5jDMNyd+eXbJIWVv
 zR8UbbYknV/lyX4G0aXFk3eLPEXQUQsf5I7GSCQPI77PJRV5i9yiWs824nhMdTGR68ks
 kebEio7yGeOBymgKl0313qhHw+LH69B4eJHCbzYfljiIyNaVmx1sX3vDHhO5UcEQiAwk
 P/PighynmBGqukZJZKlDLJJOI/YjTk0bOh8+h8YTdD9xXGyHyFKrMb3PW8/xnlbXAv/h
 Gcrl9T83YCdxOu49Z5MfCb17DeIXT17E08DmRgDKxwSfnVv6KH2/kT/xHPgcq3QDKl4k
 FKbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=zqbrDlk5oAdh8cp8uwyXhDJX7ma0PoYUF40Vz8bucso=;
 b=TIdM8/goH/TioWXRW4sQf6O7pBrTmmlDBiVzh3zBHnY2tp9H+4RR6RUnLesdWf+qcl
 4zttUL7oKR463fJ8f7X9PE4X4J1RZx6znRQ3VzqHvUDJCDnczGf+vyIzlWmeRES1DS+c
 pSV4M7KUPtza+k4oZKK4gShjp8y7XS8sBO/4RIVEDBHKBI+a9MTumYGeryBy6k3GMSkc
 PfimGTM5ldZ/1xO6oXtGFGK9wAAahb8cexf+leCYUHwJItt7KoLrorEqtSH0s/5MRtM8
 XWRBFbFHZ6phxfL61SmhmGYDUKVhvuj26UvSTWttZ6iD0PBzukp/3E7/t0WiCo/nxul7
 zQeQ==
X-Gm-Message-State: APjAAAVcRgK7lADo+TTJo7lzL2YmAE1q0cn/s9/xj550JxYbjVn4QQbb
 k4bp5feof8yatoow6Jck/Fjorj9G
X-Google-Smtp-Source: APXvYqy5r4GQko2smLEJL2EYHlqY2/Nd2QZP1sxDPHpKk7Ux+eUANhdZkrvobh+Aqau4nugqHrCe2Q==
X-Received: by 2002:adf:f8d0:: with SMTP id f16mr12984272wrq.198.1555935867513; 
 Mon, 22 Apr 2019 05:24:27 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id z14sm19717684wro.81.2019.04.22.05.24.25
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 05:24:26 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> <83lg026xxb.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@HIDDEN>
Date: Mon, 22 Apr 2019 15:24:24 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83lg026xxb.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 15:12, Eli Zaretskii wrote:

> Try using 'true' as the last argument of make_specified_string.

Thank you. Tried it, tests now pass, and the performance improvement is 
the same. I compared the same benchmark (100 iterations, GC disabled for 
the whole duration), and this patch takes

src/emacs -Q --batch -l ~/examples/elisp/json-test.el
Elapsed time: 51.153870s

down to

$ src/emacs -Q --batch -l ~/examples/elisp/json-test.el
Elapsed time: 26.268435s

Are you still against it? (Just checking).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 12:13:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 08:13:06 2019
Received: from localhost ([127.0.0.1]:50059 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXoo-00057D-Iu
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:13:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35085)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIXol-00056e-Mc
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:13:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39729)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIXof-0007cd-TK; Mon, 22 Apr 2019 08:12:57 -0400
Received: from [176.228.60.248] (port=3198 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIXof-0004DZ-8x; Mon, 22 Apr 2019 08:12:57 -0400
Date: Mon, 22 Apr 2019 15:12:48 +0300
Message-Id: <83lg026xxb.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 14:48:52 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
 <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: p.stephani2@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Eli Zaretskii <eliz@HIDDEN>, Sébastien Chapuis
>  <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 14:48:52 +0300
> 
> If I simply apply the patch from 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31138#5, that breaks tests 
> in test/src/json-tests.el. In particular, json-parse-string/string:
> 
> F json-parse-string/string
>      (ert-test-failed
>       ((should
>         (equal
>          (json-parse-string "[\"abcαβγ\"]")
>          ["abcαβγ"]))
>        :form
>        (equal
>         ["abc\316\261\316\262\316\263"]
>         ["abcαβγ"])
>        :value nil :explanation
>        (array-elt 0
>                   (arrays-of-different-length 9 6 
> "abc\316\261\316\262\316\263" "abcαβγ" first-mismatch-at 3))))

That patch causes us to create unibyte strings, so it's small wonder
you see these failures.

> Would somebody like to propose an alternative patch?

Try using 'true' as the last argument of make_specified_string.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 12:07:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 08:07:28 2019
Received: from localhost ([127.0.0.1]:50052 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXjL-0004yl-Re
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:07:28 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34517)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIXjJ-0004yV-Pg
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:07:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39604)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIXjE-0004GB-0w; Mon, 22 Apr 2019 08:07:20 -0400
Received: from [176.228.60.248] (port=2847 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIXjB-0000xI-Hz; Mon, 22 Apr 2019 08:07:18 -0400
Date: Mon, 22 Apr 2019 15:07:08 +0300
Message-Id: <83muki6y6r.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 14:46:20 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
 <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 14:46:20 +0300
> 
> > FWIW, I have stream_get.part.3 in my profiles that takes almost twice
> > the time as decode_coding_utf_8, and various lex_* and other functions
> > also quite high on the profile, with 1.5% to 3.5%.  So it isn't like
> > libjansson is tenfold faster than our code.
> 
> I don't see that in mine.

I don't know why.  In my profiles I enlarged the iteration count to
100, and also enlarged the sampling frequency.  Maybe that's the
reason.  The percentage taken by decode_coding_utf_8 didn't change as
result, FWIW.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 12:02:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 08:02:13 2019
Received: from localhost ([127.0.0.1]:50040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXeG-0004rN-SS
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:02:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33712)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIXeE-0004r6-L5
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 08:02:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39554)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIXe6-0008Cl-O5; Mon, 22 Apr 2019 08:02:03 -0400
Received: from [176.228.60.248] (port=2523 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIXe4-0007xP-Pu; Mon, 22 Apr 2019 08:02:02 -0400
Date: Mon, 22 Apr 2019 15:01:51 +0300
Message-Id: <83o94y6yfk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <9ced2e6e-aed3-ba15-da93-85ff557deb88@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 14:36:02 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
 <9ced2e6e-aed3-ba15-da93-85ff557deb88@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Dmitry Gutov <dgutov@HIDDEN>
> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> Date: Mon, 22 Apr 2019 14:36:02 +0300
> 
> On 22.04.2019 1:12, Dmitry Gutov wrote:
> > Considering libjansson manages to do both JSON parsing and string 
> > conversion in ~the same time make_specified_string only does string 
> > conversion on the returned strings, it most likely follows that 
> > make_specified_string could be made faster.
> 
> ^ Sorry, I meant code_convert_string here.

That one is called both for encoding the input and for decoding the
strings in the result of parsing.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 11:49:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 07:49:03 2019
Received: from localhost ([127.0.0.1]:50011 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXRX-0004XJ-5Y
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:49:03 -0400
Received: from mail-lj1-f178.google.com ([209.85.208.178]:35016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIXRV-0004Wp-MS
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:49:02 -0400
Received: by mail-lj1-f178.google.com with SMTP id t4so10064064ljc.2
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 04:49:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=e3Zw/NyQfpgypnz5RPsG1Z96TxyaXzUua0T9/cqUjQ8=;
 b=VONgAUsgNkmg28auvz5XzfI+NiJwt81VcRpnqf0b965c1OAR0JgbCa/wOsLdEqjD8c
 2z+GzUdJlNq/7hKX+mybfiQa3yLdihCmpq98j/Y5D+PD7rqksApWi/wzJFjay8zwXeXv
 8ts54NkInq9HLntFbPYiLzUXwZImB/MjNWzH2f72Dhm3do+7Q/hYfbinOJIRLsa4+T5K
 xhz4KNg0E9X6kPGPZaWl7eGae92YA6xMikTgq/WerO0hKzXcklr4+VP7opNULLFmxPXS
 n1idRdKck7UjhJ43AZmxKBAuzu8bdVEB0BgUKkLxGHlrk4Ouf0WDW2ifjMXx3pRjkwEP
 +ngA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=e3Zw/NyQfpgypnz5RPsG1Z96TxyaXzUua0T9/cqUjQ8=;
 b=BWZZzqcNeZjyS9JnROazLGY1Jy7Wl/tVNTIdY70Ww3yKgPsCpoxqYBP7QPGTOzmqaI
 qIr8R0DoukqwoP2uM4lPjJJk7ZSYW9px+EDNV08gbyUSU6HwCMTka+LyV18+VnJgrO0a
 UUI/VvubRtdH7zq2dmWRMoKA19bfakPQZXPxq1pp3wWPc7FzwhkbeUq+Tfga+nNuZfEg
 t2vO6DNaM+lv9hactAm60FHcYNu11MeRjGawLuntbyAOmhbPD6uou1OKgpXRxbDab9rj
 Cp4tQWDswj5GkokyuPu1Q4okgdXY7/T2h40WR61sjgYcEvl33c7An7eMrAjQHhZD0qNC
 8e6g==
X-Gm-Message-State: APjAAAVCC7+M/efoaEaqD43zna1FgEUKRLHG/gdpcpanfVBz4U0SSbxQ
 vEw/yvlJYEcmCl8cHaTmhUOPfiJA
X-Google-Smtp-Source: APXvYqz003n+b3B42/ibcUPKeA2YceMRVj9Bl0ulFgtpqtED1f9Dt8L7qDEXx+k3NKeMpGs8HPCOjw==
X-Received: by 2002:a2e:8794:: with SMTP id n20mr10430941lji.76.1555933735618; 
 Mon, 22 Apr 2019 04:48:55 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id o3sm2951937lfn.41.2019.04.22.04.48.53
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 04:48:55 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Philipp Stephani <p.stephani2@HIDDEN>, yyoncho <yyoncho@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
 <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <10ca4e2f-b116-16bc-c81e-24036752c867@HIDDEN>
Date: Mon, 22 Apr 2019 14:48:52 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>,
 =?UTF-8?Q?S=c3=a9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 21.04.2019 16:33, Philipp Stephani wrote:
> Am So., 21. Apr. 2019 um 15:10 Uhr schrieb yyoncho<yyoncho@HIDDEN>:
>> Hi Philipp,
>>
>> As Eli commented in this thread, the decoding is must have for all external libraries no matter what is their contract.
> I disagree.

If I simply apply the patch from 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31138#5, that breaks tests 
in test/src/json-tests.el. In particular, json-parse-string/string:

F json-parse-string/string
     (ert-test-failed
      ((should
        (equal
         (json-parse-string "[\"abcαβγ\"]")
         ["abcαβγ"]))
       :form
       (equal
        ["abc\316\261\316\262\316\263"]
        ["abcαβγ"])
       :value nil :explanation
       (array-elt 0
                  (arrays-of-different-length 9 6 
"abc\316\261\316\262\316\263" "abcαβγ" first-mismatch-at 3))))

Would somebody like to propose an alternative patch?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 11:46:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 07:46:33 2019
Received: from localhost ([127.0.0.1]:50005 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXP6-0004Te-6a
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:46:33 -0400
Received: from mail-lf1-f49.google.com ([209.85.167.49]:40946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIXP4-0004TS-Mp
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:46:31 -0400
Received: by mail-lf1-f49.google.com with SMTP id a28so8745357lfo.7
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 04:46:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=cHw1jCaZLsm5zVy2qiFiJ5UITp98AtI4s18hf1rkLdM=;
 b=OVHrA3mvbqatXIF4TDgh685K7h2TnsNKXhazKIa6rLbo50xtOeyVT8YWoCOhQ723oN
 BVsgC/MG2TkBAEOhKlJlkkZnpjCpR/OZIEVvfwh5jDUQslPT5cnoHbPv6S0slLlKCp4+
 4DHFd6yPdgxtrcuqcE68Jqbcu/HOTFZl64QX3rp2iJUb1i/lF0UEvJv5waCMO683IiRc
 vCLHfCIOSFN4dXbLgTYp6SmM947sZE2mKTQ2Kcq3748+ZOkopTGBaQJIb/Jn/w4Byy7r
 76B3vY+mpETtlKyQJUrm/Qy5wMq9olf3Knv1qdrP2XtajpenOIelgwD56Y2NJKY948bZ
 /TpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=cHw1jCaZLsm5zVy2qiFiJ5UITp98AtI4s18hf1rkLdM=;
 b=n7O4WozfbwLrHl8f6NyhMX64O393+Grs5IKYvCr/YWAYjOPHaFGc/jiDxQlrSZGcVG
 SrWhcjoB4EZtVZefnYcMoW2/3j8lb1DVHEH8TUafg3QTJAN1ZosYNj0X6NoeL8RjHgyF
 M4vwsv9TmHvoMFGFte+b8Gw4Aco47x6iHpTfnYILjLKP7RtMzeQuDMbE6eSFB8dOkAlJ
 tvsXMiipu2dJJusleUnFLzrFWRs14g8teHCv0pukInkPBwl80OfWeUWYgPfS/PCgLGZu
 X3STr7BYCJg5GBxSE8VZ5E0f2X89Uqv2nzOtZ9KTFcaQZqOtJsgO6Ic449kwiePtQUzi
 tFvA==
X-Gm-Message-State: APjAAAUTz/yoGQzj8EosFEqUjV4cyZfv5wi5u7xxZfArducTvLJL5/jk
 L05VrQtunCTyRsNww9EyAffpGfx3
X-Google-Smtp-Source: APXvYqxe0h91+Ot+3tQxh7GrAbgTrayQlD7iRkZu6aEvkV+zoS+hOPObHjisJWlAX+R8S7EUo80Qrw==
X-Received: by 2002:a19:3f09:: with SMTP id m9mr9923123lfa.36.1555933584358;
 Mon, 22 Apr 2019 04:46:24 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id y7sm2663422ljj.34.2019.04.22.04.46.22
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 04:46:23 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> <83ftqa8qsg.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <cd5ecad5-8465-73cc-0228-e0674774ca67@HIDDEN>
Date: Mon, 22 Apr 2019 14:46:20 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83ftqa8qsg.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 22.04.2019 10:03, Eli Zaretskii wrote:

> Yes.  Wasn't it 100% in your profiles?  I think it was.

Err, it probably is. The above-1% percentages sum up to 54% percent 
total. There's a long tail, though.

>> I still don't understand. I my profiling report, decode_coding_utf_8 is
>> at the top (Emacs function). Followed by malloc and produce_chars. Are
>> you saying they are not involved in decoding strings?
> 
> Part (roughly half) of produce_chars is, malloc mostly isn't.

Okay, maybe some of it isn't part of code_convert_string, but libjansson 
functions themselves are way down below in my profile (though they 
probably also use malloc).

> If the percentage of the decoding was much higher, like 80% or 90%,
> say, then we would have a much better incentive to try to salvage at
> least some of that, than we have now.

As it is, we have an upper bound for optimizations: even with 
lightning-fast JSON library, performance will go up by 2x at most.

And if like you're saying in another email, we first encode the string 
before passing it to libjansson, then decode the strings in the result, 
we might be spending 70-80% of the time just doing encoding and decoding 
of strings in Emacs, if, say, encoding is twice as fast as decoding.

>> We've already had the performance numbers from before.
> 
> The percentage of time taken by decoding wasn't clear to me, so I
> wanted to profile.  Mind you, I intended to do that myself, I didn't
> ask anyone to do it for me, although I'm of course grateful for your
> work on this, as it confirmed my results.

My profiling report was very different. The conclusion was, too.

> If someone has ideas how to speed up decode_coding_utf_8, please speak
> up, and let's try that.  AFAICS, it is already heavily optimized for
> the case of plain ASCII text, which is what we used in our profiling.
> If plain ASCII text is important enough, perhaps we could make this
> even faster, at the price of making non-ASCII cases slightly slower,
> by adding a function that just validates plain ASCII without producing
> a decoded string.

I'm going to have to leave that up to somebody more well-versed with C 
and Unicode.

Speaking of the specific proposal, I did something like the latter with 
json.el in the past (speeding up the ASCII-only case). It was a 
significant win.

> The original bug report found that we do unnecessary stuff like
> allocating temporary buffers and calling various hook functions -- all
> that is now gone, so we definitely have sped this up, probably
> significantly in some non-"emacs -Q" cases.

That is true. Thank you.

> FWIW, I have stream_get.part.3 in my profiles that takes almost twice
> the time as decode_coding_utf_8, and various lex_* and other functions
> also quite high on the profile, with 1.5% to 3.5%.  So it isn't like
> libjansson is tenfold faster than our code.

I don't see that in mine.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 11:36:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 07:36:19 2019
Received: from localhost ([127.0.0.1]:49979 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIXFD-0004El-2h
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:36:19 -0400
Received: from mail-lj1-f175.google.com ([209.85.208.175]:43618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIXFB-0004EU-7a
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 07:36:17 -0400
Received: by mail-lj1-f175.google.com with SMTP id f18so10019000lja.10
 for <31138 <at> debbugs.gnu.org>; Mon, 22 Apr 2019 04:36:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:from:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=Wd7aHP7yuTc2mRWHOVm6GAx/zNyggvnEaQqP0K87W6g=;
 b=QtPVEZ1I7gV3j6zCzsEFLGX99kMy1o+kNUt5hJgZzQ13DSGTsRFvaRuWGWsG9+CbQ7
 WYLYntY8tBLPKvmjaFsU717OqvSfSyfSvNX3ngpd9N5q+I9N0IgAxWbX+VV+0G2KDcJe
 JLtKvuKstXCPOM3JQnHASRL+sBv8V9CJO3AvwSV6ReeWICzfuWPteGOzXeEW1rM9nSkg
 ltM3iIlD+3KQi17Yg87FtTCzaJhXCmEBx4Z9Fp2wHEzAkA+eqe5akRwR6UdgyDLk9zO8
 DMQmL49qTBFSJWqUBsvCPSieIAnWISX0LUXqowI+Dmbl339A5a6TBbOd6j/IfQSw1lpa
 S1Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:from:to:cc:references:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=Wd7aHP7yuTc2mRWHOVm6GAx/zNyggvnEaQqP0K87W6g=;
 b=oZ6T6xI90PQmcTj/lYsd1X93YwUcNn/7lXu6K147+uY5THbt9kmRjzyvvmnXoBQ9NM
 BGVVg1lOHNowNVOYg1OXo5LeBYOkYDOKGXlxsz+FmdS25ugzE5Of5nMgCzrjcBjrEEXT
 pOP1ezTbv1tYiPCSxtgFTiiGc0cXLI1BkJ3tcaIsp4H5bcYJ+WS6nZR4iMfslqXxJvl7
 2fmmULk4v8Y0AAFN4RKi488mUCQ+i9iaSkHUrsVlCNH3hLr9vI4Xc0Exhy3SsO1NcsVF
 joIGaT5+DXg4PtGPnJDqIq5kt9ew1rKt7XO+uH8dUf97lnliwf7bEf7ZWurwXxsZJSE0
 aAKg==
X-Gm-Message-State: APjAAAUFwr8HZaTW/cQ1NdakXTfyxxdX/4I1ZgY9E/bluRnV2wARQj+6
 BGMATspRaq2YYuR/AFAJz52Yqp2w
X-Google-Smtp-Source: APXvYqzGDH3QfFwUHCcMIK+lDof4HnnyXEOo77xyiy1NGsqfynD9qoQB5DYrNMt+WfcK/unJdFjz3w==
X-Received: by 2002:a2e:309:: with SMTP id 9mr10560351ljd.114.1555932965964;
 Mon, 22 Apr 2019 04:36:05 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id i64sm2575841lfe.18.2019.04.22.04.36.03
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 22 Apr 2019 04:36:04 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
From: Dmitry Gutov <dgutov@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
Message-ID: <9ced2e6e-aed3-ba15-da93-85ff557deb88@HIDDEN>
Date: Mon, 22 Apr 2019 14:36:02 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 22.04.2019 1:12, Dmitry Gutov wrote:
> Considering libjansson manages to do both JSON parsing and string 
> conversion in ~the same time make_specified_string only does string 
> conversion on the returned strings, it most likely follows that 
> make_specified_string could be made faster.

^ Sorry, I meant code_convert_string here.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 08:01:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 04:01:59 2019
Received: from localhost ([127.0.0.1]:49651 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hITtm-0002nL-Ua
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 04:01:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hITtl-0002n7-Hr
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 04:01:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36880)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hITtd-0003Dz-GK; Mon, 22 Apr 2019 04:01:50 -0400
Received: from [176.228.60.248] (port=3222 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hITta-00025B-Lj; Mon, 22 Apr 2019 04:01:47 -0400
Date: Mon, 22 Apr 2019 11:01:37 +0300
Message-Id: <837ebm8o4e.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
 (message from yyoncho on Mon, 22 Apr 2019 08:38:58 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
 <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 22 Apr 2019 08:38:58 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  read-from-string doesn't decode.  You need to time
>  decode-coding-string when the string is the entire JSON.
> 
> Can you elaborate? Both json-parse-string and read-from-string do the same from my point of view ->
> convert string to elisp data structure with read-from-string being 3times faster.

Maybe I misunderstood what you were trying to say.

If you were suggesting that we implement reading JSON objects as part
of Emacs, then yes, this won't need to encode/decode anything.  I'm
not sure the result will be as fast as read-from-string, since we are
talking about a different syntax.  Also, I'm not sure how hard would
that be nor how much maintenance will it require (does the JSON spec
change frequently?).  But if someone knows the answers, perhaps it's
an alternative worth considering.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 07:16:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 03:16:24 2019
Received: from localhost ([127.0.0.1]:49639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hITBf-0001ZQ-WD
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:16:24 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45924)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hITBd-0001ZC-CW
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:16:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36509)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hITBX-0005Ry-Qw; Mon, 22 Apr 2019 03:16:15 -0400
Received: from [176.228.60.248] (port=4365 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hITBX-00030H-5B; Mon, 22 Apr 2019 03:16:15 -0400
Date: Mon, 22 Apr 2019 10:16:04 +0300
Message-Id: <83d0le8q8b.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 01:17:09 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN> <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 01:17:09 +0300
> 
> On 21.04.2019 15:15, Eli Zaretskii wrote:
> 
> > Then maybe we should look for a faster JSON parsing library, because
> > libjansson functions appear in the profile as high or higher than our
> > decoding routines.
> 
> Not in my profile.

No?  I have these near the top in mine:

  +   7.73%  emacs.jansson  emacs.jansson      [.] stream_get.part.3
  +   3.61%  emacs.jansson  emacs.jansson      [.] strbuffer_append_bytes
  +   3.47%  emacs.jansson  emacs.jansson      [.] lex_scan
  +   1.75%  emacs.jansson  emacs.jansson      [.] lex_get_save
  +   1.58%  emacs.jansson  emacs.jansson      [.] string_get

AFAICT, they are all from libjansson.  In this particular profile,
decode_coding_utf_8 looks like this:

  +   4.45%  emacs.jansson  emacs.jansson      [.] decode_coding_utf_8

> Again, if make_specified_string takes 50% of the runtime, even if 
> libjansson (or some other JSON lib) worked instantly, we'd only get a 2x 
> improvement at most.

I'm not sure it's 50%, as in my profile I have only this:

  +   1.41%  emacs.jansson  emacs.jansson      [.] make_uninit_multibyte_string

Please don't forget that json-parse-string first _encodes_ the input
string in UTF-8, then passes it to libjansson, then _decodes_ each
string element it receives back.  So we do some non-trivial processing
besides make_specified_string, and removing decoding only saves part
of that.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 07:06:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 03:06:41 2019
Received: from localhost ([127.0.0.1]:49634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIT2H-0001LF-0U
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:06:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIT2E-0001L2-Ox
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:06:39 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36411)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIT29-0007nA-DA; Mon, 22 Apr 2019 03:06:33 -0400
Received: from [176.228.60.248] (port=3773 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIT28-00020T-Ml; Mon, 22 Apr 2019 03:06:33 -0400
Date: Mon, 22 Apr 2019 10:06:23 +0300
Message-Id: <83ef5u8qog.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <80d4ab93-0927-86ff-6c84-2ebd1bfca384@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 01:14:10 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <80d4ab93-0927-86ff-6c84-2ebd1bfca384@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Sébastien Chapuis <sebastien@HIDDEN>,
>  31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 01:14:10 +0300
> 
> On 21.04.2019 13:23, yyoncho wrote:
> > IMO if validation of the data that comes from external libraries is 
> > taking a lot of time then it does not make sense to use external 
> > libraries at all when we are aiming for performance gains.
> 
> If we'll have to call make_specified_string for each parsed JSON string, 

What could/would be an alternative to that?  We must make a Lisp
string out of each string returned by libjansson.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 07:04:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 03:04:19 2019
Received: from localhost ([127.0.0.1]:49630 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hISzz-0001He-Bp
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:04:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43539)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hISzx-0001HS-Ox
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 03:04:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36385)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hISzr-0005ji-Rn; Mon, 22 Apr 2019 03:04:11 -0400
Received: from [176.228.60.248] (port=3628 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hISzp-0002M5-Ue; Mon, 22 Apr 2019 03:04:11 -0400
Date: Mon, 22 Apr 2019 10:03:59 +0300
Message-Id: <83ftqa8qsg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN> (message from
 Dmitry Gutov on Mon, 22 Apr 2019 01:12:49 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Mon, 22 Apr 2019 01:12:49 +0300
> 
> On 21.04.2019 12:31, Eli Zaretskii wrote:
> 
> >> Eli, how did you reach that conclusion?
> > 
> > By adding the percentage of all the functions involved in decoding
> > strings.
> 
> Was the total sum of the profile 100%?

Yes.  Wasn't it 100% in your profiles?  I think it was.

> > I only accounted for time used by Emacs code, i.e. 100% doesn't
> > include the library.
> 
> I still don't understand. I my profiling report, decode_coding_utf_8 is 
> at the top (Emacs function). Followed by malloc and produce_chars. Are 
> you saying they are not involved in decoding strings?

Part (roughly half) of produce_chars is, malloc mostly isn't.

> > In any case, even if decoding takes 50% of the time we spend in Emacs
> > code, it is still not significant enough to justify the un-safety of
> > using a string that we didn't decode, because if that string ever
> > includes raw bytes, Emacs will surely crash.
> 
> What was the point of us doing the exercise, and me wasting time on it, 
> if you're set on not changing anything at all?

If the percentage of the decoding was much higher, like 80% or 90%,
say, then we would have a much better incentive to try to salvage at
least some of that, than we have now.

> We've already had the performance numbers from before.

The percentage of time taken by decoding wasn't clear to me, so I
wanted to profile.  Mind you, I intended to do that myself, I didn't
ask anyone to do it for me, although I'm of course grateful for your
work on this, as it confirmed my results.

> Given the encouragement, I really expected you to choose *some* path 
> toward improvement. Either forgoing conversion (maybe adding an 
> additional test suite, for cases you're worrying about), or doing some 
> kind of faster validation instead of full conversion (where we don't 
> allocate new strings but just check existing ones for validity), or, you 
> know, optimizing everything everywhere.

If someone has ideas how to speed up decode_coding_utf_8, please speak
up, and let's try that.  AFAICS, it is already heavily optimized for
the case of plain ASCII text, which is what we used in our profiling.
If plain ASCII text is important enough, perhaps we could make this
even faster, at the price of making non-ASCII cases slightly slower,
by adding a function that just validates plain ASCII without producing
a decoded string.

The original bug report found that we do unnecessary stuff like
allocating temporary buffers and calling various hook functions -- all
that is now gone, so we definitely have sped this up, probably
significantly in some non-"emacs -Q" cases.

> Considering libjansson manages to do both JSON parsing and string 
> conversion in ~the same time make_specified_string only does string 
> conversion on the returned strings, it most likely follows that 
> make_specified_string could be made faster.

FWIW, I have stream_get.part.3 in my profiles that takes almost twice
the time as decode_coding_utf_8, and various lex_* and other functions
also quite high on the profile, with 1.5% to 3.5%.  So it isn't like
libjansson is tenfold faster than our code.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 05:39:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 01:39:21 2019
Received: from localhost ([127.0.0.1]:49605 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIRfk-0007iN-4m
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2019 01:39:20 -0400
Received: from mail-lj1-f177.google.com ([209.85.208.177]:35662)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIRfg-0007i4-BW
 for 31138 <at> debbugs.gnu.org; Mon, 22 Apr 2019 01:39:16 -0400
Received: by mail-lj1-f177.google.com with SMTP id t4so9349785ljc.2
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 22:39:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=bOTF+mSZZFXOxKpfG4J527SYicd2rty6/hWXvOylq9c=;
 b=uxfvhp/wI95YqLv0l6pdLENklOTww/dzTKzTfHiQOo3qeUN+n5+6LX0Fof+mkgMmHG
 l2GWFOEcCMdIX0SNk159e5NT9CIVtuIrnO+ixpi9Jc/z1g3MtetjV3OSY6XrtetSD0Wn
 KwMqGUjCXDl/pq2h+ShRIZ00dVWI2up46StUuMeJmulkzPkxpY2osMBGo209uRJiCEir
 vz3h7ceaamCClRLK+FipVlaNio3qKkeguupgHAcuHNdkvDG8r/wR2/fx3soeZViGfqAC
 s+n19zkzuyZV3O00MFbIeBb4hl16xaXeUStTuP/973oqmq7EO+iqLGcylcluAru+g4/R
 yOtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=bOTF+mSZZFXOxKpfG4J527SYicd2rty6/hWXvOylq9c=;
 b=dqUF/rbXkIPyPJhxs/1YTfb/2Or0f94lCVO7il8CD5tx5uixla89dgUoLuKr5hdV/O
 Tln8RDJSsVwvIcpCt81oKVHrcIggZhIR8yXkhdC528dDHr9erK6mccgleGdxMQ6A77EL
 oBgh6K05lulyLGEc0AJsaQYqs6Uk6MVE4wATZyVE7KG54tO9ua0zQgFStYd3crx+RzwW
 isiwS5wY0juruCxQRAcj8tDSrZ7AjuNpx2m69SK+VbnYHfSs49syBjgbx6u8DVN1unPY
 K3xy5Hb93Lm4dbY04SwOghTrg28o4HlvseMOFOc7pYiX8HMJj8RXjQoYL09nzjY1QaF1
 et2A==
X-Gm-Message-State: APjAAAVnxRa/IsUU/dUCJ4PpYeD3+JchDMKz3HaGFG+ua7Inri72rbib
 bjg0PypzoUbmfZkThPpUAk0m/iR9kNnp3ESFh94=
X-Google-Smtp-Source: APXvYqzUtGDmEj4MBzDtxWPK4xJhNrpCHKR3vc2UyTEAegJHzUKDZ9rEfENFAyql/swV6jIyvJ6xl1S09oAw3ecqh8c=
X-Received: by 2002:a2e:8108:: with SMTP id d8mr8230624ljg.57.1555911550291;
 Sun, 21 Apr 2019 22:39:10 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
In-Reply-To: <83y34389lg.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 22 Apr 2019 08:38:58 +0300
Message-ID: <CACCVLQUrKLCUCJd=X1LjiBwCqBAgsz0-fbjNcfU3L-yWb-4eLA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000041d2b7058717e3e0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000041d2b7058717e3e0
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

read-from-string doesn't decode.  You need to time
> decode-coding-string when the string is the entire JSON.
>

Can you elaborate? Both json-parse-string and read-from-string do the same
from my point of view -> convert string to elisp data structure with
read-from-string being 3times faster.

Thanks,
Ivan

--00000000000041d2b7058717e3e0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Hi Eli,</div><br><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex">read-from-string =
doesn&#39;t decode.=C2=A0 You need to time<br>decode-coding-string when the=
 string is the entire JSON.<br></blockquote><div><br></div><div>Can you ela=
borate? Both=C2=A0json-parse-string and read-from-string do the same from m=
y point of view -&gt; convert string to elisp data structure with read-from=
-string being 3times faster.</div><div><br></div><div>Thanks,</div><div>Iva=
n</div><div><br></div></div></div></div>

--00000000000041d2b7058717e3e0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 22:17:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 18:17:21 2019
Received: from localhost ([127.0.0.1]:49263 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIKm0-0000hK-Ga
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:17:21 -0400
Received: from mail-lf1-f42.google.com ([209.85.167.42]:35723)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIKly-0000gx-2c
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:17:18 -0400
Received: by mail-lf1-f42.google.com with SMTP id j20so7680790lfh.2
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 15:17:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=E5p9SGhuv4uRJ7U3cmy6HrVuB7RUSUqy8ibG4C3oXug=;
 b=EKjH3m/i5OqkGJf8mzk+IvJCNzuy0ez7127Ov3Tebo+MAlJyK+YDQNbna9y+KDufkk
 t+wS1C+c2yqBuWvvb0rcSn/043togeidM5Fob6QolCgZz3ruYaQ4jwBgjGjzHvX9C8Xj
 6uIigaowVgRZUhdtbem+50VtMXwB0tzqPtrIjIIa4lQaX4+Le4Lc1eEnBWwkLEDbKISh
 9dgM4eeJj3Rl3OgkWkM+Em042YSn86V9RsYX+ugOLNCO3F8m0sCLL2M4wtkUKzV518nC
 Xif4hpFJSLZFth8PmMvaF9M0BvumKeaXJLxa4fKOl3Z9BEujBurSEacja6sZXnWVTnJV
 cHqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=E5p9SGhuv4uRJ7U3cmy6HrVuB7RUSUqy8ibG4C3oXug=;
 b=qDHtn84TLGx1Gkv6RJRSLwzNZqhKPb6fM5GPDJ8KXh5T+YbH3aNgwo3Q0mO5aqWf8p
 AgZEPw94HdYVTr1GUF+3H7IaLOFqXftjbxO6D6fgGsTGXYGKitxdFGn0japHpXLwHze/
 II3XEKw+sZ+UvhOulZ+Vp5YonHFUohNJ8YqJFRbwGZ7Wu252NO6D/CbDdk11ZwQ4pWWj
 /BXNyYBsIWfIP5W2cGNt3M5shRRNJvTRZierJnd2Zl8QhY+l5ZJr+1wgmjLWYK6Icc3o
 8OsgKixDliwE8grnObwKE0coTC5TbjuepIFFzDoQHDlkz0Y0+2U5wWwuMXWlpM/oTQld
 Po3A==
X-Gm-Message-State: APjAAAVtpJVjMDdJ6VjixgMDsiaaYcfQEMFpwy7taW4tIV8liMxYRPzz
 8Qme84UlQ+I5Nz/2y2v+lovcd+5u
X-Google-Smtp-Source: APXvYqxeHHU/XBo/BxzSXmz6YKYAPIpfxxjLnC1xpfUu0cq0M8QqVZt2/cx0nxrlJZfLDzNj6ZwZKw==
X-Received: by 2002:ac2:547a:: with SMTP id e26mr8417219lfn.148.1555885032074; 
 Sun, 21 Apr 2019 15:17:12 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id n9sm2656041lfl.35.2019.04.21.15.17.10
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 21 Apr 2019 15:17:11 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, yyoncho <yyoncho@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <6cc7472a-e9b2-5e30-3c44-1709056c02f5@HIDDEN>
Date: Mon, 22 Apr 2019 01:17:09 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83zhoj8shg.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.9 (/)

On 21.04.2019 15:15, Eli Zaretskii wrote:

> Then maybe we should look for a faster JSON parsing library, because
> libjansson functions appear in the profile as high or higher than our
> decoding routines.

Not in my profile.

Again, if make_specified_string takes 50% of the runtime, even if 
libjansson (or some other JSON lib) worked instantly, we'd only get a 2x 
improvement at most.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 22:14:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 18:14:23 2019
Received: from localhost ([127.0.0.1]:49255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIKj6-0000bp-JO
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:14:20 -0400
Received: from mail-lf1-f41.google.com ([209.85.167.41]:34065)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIKj4-0000bc-OB
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:14:19 -0400
Received: by mail-lf1-f41.google.com with SMTP id h5so7690157lfm.1
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 15:14:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=BxLB0vvUVBHcOrbVfCVrmwdGcsbGksZf758g6PYrVZ0=;
 b=WZ1NXrx+FfMl75gXeGVgQBvrTgjpFmi0dh5mCqMBSoVaSnMwW/M1i0g8o3O+yNApm6
 AzafYmmxUnmscc/WsH6/VVRSm9C1beS7WlvJbnAMTAw2wdjywdKNz597StH4v2WMUYwc
 GpcGu4+FhMGQVaBL2XWRkpmr/SvltqRdMINT9m9esBt4atljfasTSOKiyn9bNsloJcdT
 inZ5V8HQ3WcYbR9w6HAQnfjUy693TODNGTqcR8AjlY7tvMtds3CRo/SqdYkWRpj/GotL
 rEb+noLaEAFounRkZh6yOCI98alrTblgWhCa7BlwC7E20I/oun1wvGyhIwxEb+hmUSbF
 uS6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=BxLB0vvUVBHcOrbVfCVrmwdGcsbGksZf758g6PYrVZ0=;
 b=FOfUWh6hAk1IARX9JsGknepuTairDLYF45YwNpoSNtnz5pQoQAVpUgwOJBAe/KabWr
 1jt7GF3jcdZ7hpWUp4DZSpTWP71/yNDp7lwkP+i896MpADBOFz6zO4IEO95jJ54r2o5N
 S7CMGng6COzmcJ5XYCQhreKRnzGMXUK5/gu4NpceW2hPOZFFTLNf7/wCwcb4UL/Gpev7
 P7AKULT+KD99AF5lXTuPWTbqhcPhk92kQ20wmUdjRgU9IFJ4czT+jKAhRo79wunNhQu4
 WRulfWUB8rPra09e/hNupJ7bY1IzJVMb/sfaxR41gZUmSki2UlqSLs1ESaX4iZtxPm5J
 bvzA==
X-Gm-Message-State: APjAAAU1+JF3u2bLrpEa4Pg/WMIraLcOraIG3AqfYbCZgGzvxztUftRI
 iyIndeHU5LVQMPxEjkLCwmT9sZ33
X-Google-Smtp-Source: APXvYqxotaLnNuFa4H3xh7TgThiaZtkjNh5h6W869j0UVBuvr1fIMs7MfYD5XsMQSK5OivUky4rNjg==
X-Received: by 2002:ac2:52b1:: with SMTP id r17mr691974lfm.39.1555884852800;
 Sun, 21 Apr 2019 15:14:12 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id a24sm2401119ljd.32.2019.04.21.15.14.11
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 21 Apr 2019 15:14:12 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: yyoncho <yyoncho@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <80d4ab93-0927-86ff-6c84-2ebd1bfca384@HIDDEN>
Date: Mon, 22 Apr 2019 01:14:10 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=c3=a9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 21.04.2019 13:23, yyoncho wrote:
> IMO if validation of the data that comes from external libraries is 
> taking a lot of time then it does not make sense to use external 
> libraries at all when we are aiming for performance gains.

If we'll have to call make_specified_string for each parsed JSON string, 
and its speed is unchanged, I doubt that would help much still. Only as 
much as 2x, most likely less.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 22:13:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 18:13:02 2019
Received: from localhost ([127.0.0.1]:49251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIKhq-0000Zh-5u
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:13:02 -0400
Received: from mail-lj1-f178.google.com ([209.85.208.178]:46926)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hIKho-0000ZC-02
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 18:13:00 -0400
Received: by mail-lj1-f178.google.com with SMTP id h21so8793861ljk.13
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 15:12:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=ra8xpBFlLMVq3lHlHCf2D4V2Xmuevx9/7FX04iTTwgA=;
 b=VG3hb75StHfU6ZazMi6ZVg1KINW/omZmk+l3uRwcFtk6+PPRiGtKJNgie/R9qPh/1G
 eqkw/itjRpLxe2m+Yv/vpwgmhhAvwfF5piJ27hUvt7o21ZZ6SlzFHns57ZqzuxrglLIC
 NMSRx199L7cmO3vKNZFbXFVyF7GMDY9V8sHCsIkfual5Gi9xh+Edtyjgh87Go3n9cSj9
 UpR7Vpam3LixkqHdGkW9vNjKnEszepeKp0lnTkb18m72jBrK8kNnzs0axbzPTgzvQVvi
 PWwaibPONQnFvjmPWMp1G7pWfBWg00z0ssfCJfzZ8RUzrLtgdaHMgubfxSJ/JuNGUID4
 iJyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=ra8xpBFlLMVq3lHlHCf2D4V2Xmuevx9/7FX04iTTwgA=;
 b=BObScEHldLy1PHZXWkrHkjzXWOU5jAIqwiS3vHQ7ptufku5SIk6c6ZUJz4UFsKanYt
 3lbeL+P8c6RM5xAokS8Wexp3bM39pw9H4xq9/mj/blWPztxdJYtnV6k7vCbMUP85lWW2
 B+OivKx7Ctz4HDur4kj1HJcrp9xcxpwYhSi81GNzahZx5XPdZjC+VfZijrOuq8nmRRI7
 eBaHwmbWGI4G32XxuV0nDtvktjOAnLS0hdAZW9ZnzGat6533IoOpI1yPgt44Qmu5Uiy3
 WLUsekxyz0m2t7DeB8TWcB8cyLlTwRduy97MYc7eIk60j53dUYZsDqK5KQvJ2cuTe03V
 J1Ig==
X-Gm-Message-State: APjAAAWVnuS8P2ammztjpWFzu7DOwVODm9RaOuGhVB76U1Ggz1jlS2sD
 qUAupQZ4KsUtTtpe53LhYIuFk4yq
X-Google-Smtp-Source: APXvYqxY7AODS2gpyyR67ou3cRiU1BxNgs8yUQ0R+hFuJlin8w14vPnuyFZ387DzC2e5kdr1NEwVUw==
X-Received: by 2002:a2e:81da:: with SMTP id s26mr8337103ljg.86.1555884773615; 
 Sun, 21 Apr 2019 15:12:53 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id n9sm2654757lfl.35.2019.04.21.15.12.51
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 21 Apr 2019 15:12:52 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> <83a7gjaen6.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b72b98a1-ab88-b254-eea6-892a0386c887@HIDDEN>
Date: Mon, 22 Apr 2019 01:12:49 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83a7gjaen6.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.9 (/)

On 21.04.2019 12:31, Eli Zaretskii wrote:

>> Eli, how did you reach that conclusion?
> 
> By adding the percentage of all the functions involved in decoding
> strings.

Was the total sum of the profile 100%?

>> One: looking at the profile, libjansson is somewhere down below, and
>> most of the runtime is taken by Emacs.
> 
> I only accounted for time used by Emacs code, i.e. 100% doesn't
> include the library.

I still don't understand. I my profiling report, decode_coding_utf_8 is 
at the top (Emacs function). Followed by malloc and produce_chars. Are 
you saying they are not involved in decoding strings?

>> Two: while I might be misreading the profile, simply omitting the
>> decoding function call (and using the returned strings as-is) halves the
>> execution time.
> 
> You cannot use the returned string as is, you must make a Lisp string
> out of it.

Yes. There's a patch that makes a Lisp string without string additional 
decoding, and it makes the runtime 2x faster. It's been posted in this 
report. Would you like me to point at it?

> In any case, even if decoding takes 50% of the time we spend in Emacs
> code, it is still not significant enough to justify the un-safety of
> using a string that we didn't decode, because if that string ever
> includes raw bytes, Emacs will surely crash.

What was the point of us doing the exercise, and me wasting time on it, 
if you're set on not changing anything at all?

We've already had the performance numbers from before.

Given the encouragement, I really expected you to choose *some* path 
toward improvement. Either forgoing conversion (maybe adding an 
additional test suite, for cases you're worrying about), or doing some 
kind of faster validation instead of full conversion (where we don't 
allocate new strings but just check existing ones for validity), or, you 
know, optimizing everything everywhere.

Considering libjansson manages to do both JSON parsing and string 
conversion in ~the same time make_specified_string only does string 
conversion on the returned strings, it most likely follows that 
make_specified_string could be made faster.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 20:13:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 16:13:42 2019
Received: from localhost ([127.0.0.1]:49132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIIqL-0005zg-RZ
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 16:13:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIIqI-0005zS-SB
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 16:13:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55985)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIIqD-0003Jj-1D; Sun, 21 Apr 2019 16:13:33 -0400
Received: from [176.228.60.248] (port=3527 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIIqB-0004et-Mn; Sun, 21 Apr 2019 16:13:32 -0400
Date: Sun, 21 Apr 2019 23:13:19 +0300
Message-Id: <83pnpf86cg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho@HIDDEN
In-reply-to: <83y34389lg.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 21
 Apr 2019 22:03:07 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 <83y34389lg.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 21 Apr 2019 22:03:07 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: sebastien@HIDDEN, dgutov@HIDDEN, 31138 <at> debbugs.gnu.org
> 
> > But even if we had to convert it, we can do it
> > once(e. g. apply decode string on the input string) instead of doing that for each string in the JSON and
> > eventually yield performance improvement?
> 
> We can do that, yes.

Actually, I think I was confused regarding your question: the input
string in the use cases we were discussing was already decoded.  We
encode it before passing it to the jansson library.

So I don't see how we could avoid decoding each string we receive from
the library.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 19:03:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 15:03:49 2019
Received: from localhost ([127.0.0.1]:49076 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIHki-0004Id-Vq
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 15:03:49 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33945)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIHkf-0004IM-BB
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 15:03:45 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54366)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIHkZ-0000dt-FP; Sun, 21 Apr 2019 15:03:39 -0400
Received: from [176.228.60.248] (port=3115 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIHkW-0002ie-Ie; Sun, 21 Apr 2019 15:03:39 -0400
Date: Sun, 21 Apr 2019 22:03:07 +0300
Message-Id: <83y34389lg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
 (message from yyoncho on Sun, 21 Apr 2019 16:28:02 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
 <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 21 Apr 2019 16:28:02 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  The issue here is not that the library is some code not written by the
>  Emacs project, because we do the same with text generated by Emacs
>  Lisp programs.  Bugs can happen in both external libraries and in code
>  written by Emacs programmers.
> 
> I am a bit confused, (maybe I am talking nonsense) but if the input is already an emacs lisp string doesn't that
> mean that we should not decode it since it is already validated?

If the text is multibyte text, yes.  But Lisp programs can also
generate unibyte text.

> But even if we had to convert it, we can do it
> once(e. g. apply decode string on the input string) instead of doing that for each string in the JSON and
> eventually yield performance improvement?

We can do that, yes.  I don't know what kind of speedup this will get
us, we should measure that.

> For a reference, I have compared the performance of read-from-string
> with the json equivalent and it is ~3 times faster(if memory serves
> me right).

read-from-string doesn't decode.  You need to time
decode-coding-string when the string is the entire JSON.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 13:33:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 09:33:54 2019
Received: from localhost ([127.0.0.1]:47950 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hICbS-00026T-Ec
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:33:54 -0400
Received: from mail-oi1-f170.google.com ([209.85.167.170]:46965)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1hICbP-00026G-N7
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:33:52 -0400
Received: by mail-oi1-f170.google.com with SMTP id x188so6836592oia.13
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 06:33:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=CjzFvFLBTaPI1PuwYzTxhLLzCgYPiHyNe3qvveI+C8o=;
 b=p1aNyXiO+mNX+A4sbrVqNUqgDLrdqj+E6Wi28/LyjEuzIsxYzApu/L1tPTuiCELUHS
 SwA8VdBaKKV1Pb2KlAtMeOVqWm49oCY/m2e3N9DMSORHgOApo9e8kFRK/7pjKSeFaQpy
 3X3vjBs9cSxxKuKESy7EvCpGefDEkBIaOpppitI+ctIBq0Z3F4VUuJRMer1Ll5qdHG05
 UHtqOI9FR3lFRPSVjPJ3Nm1lSFhhUa47w0rg5ZM4KB1fcoOqLXgLY0MUsxBiXfkEsCLg
 fqKLZ+j6xM5A0po4W/iWIKAXrXVjoOTF+cGirW+eoTOwjnaQy9oNwL0QPOZ75OubT3k+
 xzbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=CjzFvFLBTaPI1PuwYzTxhLLzCgYPiHyNe3qvveI+C8o=;
 b=qVpSzXJWSjluq4+ix/I4/zbE+KyPn/59D7WfcAk6yCjxyZO585hcZORPjgZcyEHCL3
 ljaavnqSuk+VklTHT2smUnfek7y0Bw2v5e23SH45rDlfYjv/p86sKq3EFhri5b/uYYUA
 ui8Pe0oqD6UwgXok3LUfPrMyRjnEeMUzjHczgTZAiWdHZErLU9RQHqX9NgZqTo5NKsP/
 7V0UckfqqyvclBFi24jVUtGPPmynNt1dY/x75l6z3Kmx9idy3pjCDRxDHgMapbALjdrb
 cnIgAZAD7AHQGN+TneLrbcFFRNUcOKrpdJDxKXrhIpKniVGCjuIvFadKKjbhsy/7AxQA
 LcoA==
X-Gm-Message-State: APjAAAUjo6YQjlBiBaUtpfmPs+JviqVsBJPFj2UlzqnpRy//cdag1nBO
 laB+9MBI18ERo1xjmdMCP2BZwYsmtUjem1E6YeY=
X-Google-Smtp-Source: APXvYqzVaoe5IjFgIBRP3YetJ66p3/WsJJvpSqCgjumRk3LLk8yB8sVvFEbRq2tVcWaZdo/SII2ZwqQA92cgabtwlH8=
X-Received: by 2002:aca:310a:: with SMTP id x10mr7685435oix.161.1555853625581; 
 Sun, 21 Apr 2019 06:33:45 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
 <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
In-Reply-To: <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Sun, 21 Apr 2019 15:33:33 +0200
Message-ID: <CAArVCkSta_r3a2NRyJYQ39cmtW7fWoBDO-XQT+xnNDs2akHXMA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Am So., 21. Apr. 2019 um 15:10 Uhr schrieb yyoncho <yyoncho@HIDDEN>:
>
> Hi Philipp,
>
> As Eli commented in this thread, the decoding is must have for all external libraries no matter what is their contract.

I disagree.

>
> Thanks,
> Ivan
>
> On Sun, Apr 21, 2019 at 3:59 PM Philipp Stephani <p.stephani2@HIDDEN> wrote:
>>
>> Am So., 21. Apr. 2019 um 12:24 Uhr schrieb yyoncho <yyoncho@HIDDEN>:
>> >
>> > Hi Eli,
>> >
>> >>
>> >> In any case, even if decoding takes 50% of the time we spend in Emacs
>> >> code, it is still not significant enough to justify the un-safety of
>> >> using a string that we didn't decode, because if that string ever
>> >> includes raw bytes, Emacs will surely crash.
>> >
>> >
>> > IMO if validation of the data that comes from external libraries is taking a lot of time then it does not make sense to use external libraries at all when we are aiming for performance gains.
>>
>>
>> There's no need to validate Jansson's output because it already
>> validates that the input is valid UTF-8, and never generates invalid
>> strings.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 13:28:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 09:28:21 2019
Received: from localhost ([127.0.0.1]:47941 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hICW5-0001xG-CS
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:28:21 -0400
Received: from mail-lj1-f175.google.com ([209.85.208.175]:42639)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hICW4-0001x4-0v
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:28:20 -0400
Received: by mail-lj1-f175.google.com with SMTP id v22so8240976lje.9
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 06:28:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=gFqSL9EUPSqz+2LS0G3FZU5dicKZHjeA/t/eDkmFjN4=;
 b=TSBOns+GTCg9yx//h5iAClHPHVjFaOz/jCPjUNSg7c6T0vmbsNHxEFuhobamGCXZWc
 gf/ubGEEKdLWIxin+uRTXTk4/2wIF0FiyYDKDqMa31308s0ZSNCYyeiJ/fiTzlw6mTha
 PYv5PgR92/p3RmqplKxp1QgKOSguifegwly4SdFomPzdv/RFbRR1mnyaF/8e6+MSfJYc
 udp0bcvNBx1DfF9z4d756eePjzLbjrCiYR9voV6yO/6df6o42A56AMgXzFx0DI1n1lyz
 YWPRWLujObY49jGwqLXFZ54tqBcXQYTck53T8ag9mXva8nZzCBe2C2jKUs19hKua+0VX
 hNPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=gFqSL9EUPSqz+2LS0G3FZU5dicKZHjeA/t/eDkmFjN4=;
 b=g6i5k7qM6PuIWYP9Wpb8qarzoEQdwW4SLinPUgEwXFLhoGu/2G1JKJllrh4Z2WRgBI
 OqW30whrngnToQmy/mcFjBYZm99xiuyZ/2fTcqbvdT/R0JL3ntwsQZXuaK+ABwatXp2v
 AHX5wZ5aygVk5pLBdiFW9IMpDKFp3T2E+BEl43lwMIgA9TB0Kpbrv7HKeZmEYfgyYP00
 J9YOD54BYOgcTsTPrwaMt39ErJYKJh5OIl0wElew2UHe7qrbC+zLewJG6saP+QHxSH4i
 lvIBpiB75zZv1X+4FWKG1C9VNbGh1HuSum/GIG45mbmzgkGYfGtNOVp68EJV+tPAchGZ
 /x/g==
X-Gm-Message-State: APjAAAXFgO+dJnKo2iMe4Idj9kKWa3KmwOipe+N3WepVjPyum6Huz32Q
 rUaNKghU2A6WFQBOP4T2PthAJI5CRLzWqSYWuBA=
X-Google-Smtp-Source: APXvYqyh10Quo1yPY9GErQLyxSRbcFtpUg8JZMexMWiVavIPq3DsxzueWTwGXF/zVaTrVNGSFBGJRudl9Yf7fPHHi1g=
X-Received: by 2002:a2e:5bdb:: with SMTP id m88mr7622291lje.9.1555853294070;
 Sun, 21 Apr 2019 06:28:14 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 <83zhoj8shg.fsf@HIDDEN>
In-Reply-To: <83zhoj8shg.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 21 Apr 2019 16:28:02 +0300
Message-ID: <CACCVLQUB7Lro13SHOY75B-J4PK0EmitQmedqBp78x+k2jVz=7g@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ea728805870a523c"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ea728805870a523c
Content-Type: text/plain; charset="UTF-8"

Hi Eli,


> Or maybe this is the limit of what can be done in
> Emacs, since there is, and always will be, overhead due to converting
> C values to Lisp objects.
>

Not necessary, there are libraries (at least in java/rust) which provide a
possibility to pass a generator which can be used to create your data
structures on the fly to avoid intermittent structures. This is something
that should be considered when looking for C json library.


> I don't think I understand how this could help to speed up code,
> please explain.
>
> The issue here is not that the library is some code not written by the
> Emacs project, because we do the same with text generated by Emacs
> Lisp programs.  Bugs can happen in both external libraries and in code
> written by Emacs programmers.
>

I am a bit confused, (maybe I am talking nonsense) but if the input is
already an emacs lisp string doesn't that mean that we should not decode it
since it is already validated? But even if we had to convert it, we can do
it once(e. g. apply decode string on the input string) instead of doing
that for each string in the JSON and eventually yield performance
improvement? For a reference, I have compared the performance of
read-from-string with the json equivalent and it is ~3 times faster(if
memory serves me right).

Thanks,
Ivan

--000000000000ea728805870a523c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi Eli,</div><div class=3D"gmail_quote"><=
div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Or maybe =
this is the limit of what can be done in<br>
Emacs, since there is, and always will be, overhead due to converting<br>
C values to Lisp objects.<br></blockquote><div><br></div><div>Not necessary=
, there are libraries (at least in java/rust) which provide a possibility t=
o pass a generator which can be used to create your data structures on the =
fly to avoid intermittent structures. This is something that should be cons=
idered when looking for C json library.</div><div>=C2=A0</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">I don&#39;t think I understand how thi=
s could help to speed up code,<br>
please explain.<br>
<br>
The issue here is not that the library is some code not written by the<br>
Emacs project, because we do the same with text generated by Emacs<br>
Lisp programs.=C2=A0 Bugs can happen in both external libraries and in code=
<br>
written by Emacs programmers.<br></blockquote><div><br></div><div>I am a bi=
t confused, (maybe I am talking nonsense) but if the input is already an em=
acs lisp string doesn&#39;t that mean that we should not decode it since it=
 is already validated? But even if we had to convert it, we can do it once(=
e. g. apply decode string on the input string) instead of doing that for ea=
ch string in the JSON and eventually yield performance improvement? For a r=
eference, I have compared the performance of read-from-string with the json=
 equivalent and it is ~3 times faster(if memory serves me right).</div><div=
>=C2=A0</div><div>Thanks,</div><div>Ivan=C2=A0</div></div></div>

--000000000000ea728805870a523c--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 13:10:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 09:10:09 2019
Received: from localhost ([127.0.0.1]:47930 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hICET-0001XI-EW
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:10:09 -0400
Received: from mail-lj1-f175.google.com ([209.85.208.175]:36554)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hICER-0001Wp-N1
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 09:10:08 -0400
Received: by mail-lj1-f175.google.com with SMTP id r24so8250183ljg.3
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 06:10:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=9hvys5h2SAddaWv7mKtiscHJKu5+qS9N4rYfxzudPy8=;
 b=e9f89JhfqGBp2eBE/8ybnqOS28KgcXPtlhkv8RrhsMXOAhFEhT6sUl7sKuFPJtPfkJ
 34k76fWj3bSSwF/YX0H95JvOJKxJM4aL8qyDkWkgN3FI1G8HMlVmzuSH/AQwwDsX5Owp
 SdG5G+4dNKM8Jk/OHU4BNPC40Sb9HcKuj8/gVzcrIOGKWeKGDz1/Bmlm61JsyHIaqX/B
 RVF7ObWMjYNBKv2dlUEU1QaNF/sXHN1waLJJkVJ7/44I3kpkc1Eh28Q49nBc8cZyxwrA
 /Uv+iUVlPWKUF8iCiB1KGRkdnzZ0r3RiS30Z4xHWLJ2457Mu1hoJ0cttstqKTuq+fqQO
 sFBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=9hvys5h2SAddaWv7mKtiscHJKu5+qS9N4rYfxzudPy8=;
 b=MxDBa8+z5ulzTAV+Vunzzambl0DOc92f7p3JGxXQiuu9G9Zfl6ZQGZMx6KvtT4GTnt
 qNWWfc3pgSINn14PwQzEOVZJs/F8OptYiyF72QrWviWUI9+5M8jPzUfEZkkFeXtlypHM
 wcBt+Bh2Tx6hYTeqtKar+OVbhfJLv2BqkCU14XL/uLgQu8m416VjMsWOxVV30fLquFvI
 fyLJHd6VNpnOv87YpeuqMRVHDzAPlUTb/JIZdZzAYX3NxyJhydl2Tngt9gkvcWYwQd5s
 5pAHdze8PxaLq80LWFKMvD9oAMK4vLgAI0O4bnOp+XFYPIxBLUA0Tx/O37xIeOwybgz7
 mTVg==
X-Gm-Message-State: APjAAAVi9vqs4/2KHRnuEHSaC8N9z4CbVpC1H/J5eU7jLk6u5uU7i/Iv
 xuWMVq+WnwtD1gKnp6q/OnJhjRfKr8UFDM/F968=
X-Google-Smtp-Source: APXvYqzrkv/9jT9+KtweVUT3Cq13BY67UlAnpBGQcPB7a0cgEhS0XJH54GAVToR6amv8OtG/KhKh9abSLHE+Schpy78=
X-Received: by 2002:a2e:8888:: with SMTP id k8mr8122356lji.43.1555852201680;
 Sun, 21 Apr 2019 06:10:01 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
In-Reply-To: <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 21 Apr 2019 16:09:49 +0300
Message-ID: <CACCVLQXjkqNh8r_9umhWWFg-ODwt6QDgvhY0gYxsVELk_HYE1A@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Philipp Stephani <p.stephani2@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000cde44805870a11f2"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000cde44805870a11f2
Content-Type: text/plain; charset="UTF-8"

Hi Philipp,

As Eli commented in this thread, the decoding is must have for all external
libraries no matter what is their contract.

Thanks,
Ivan

On Sun, Apr 21, 2019 at 3:59 PM Philipp Stephani <p.stephani2@HIDDEN>
wrote:

> Am So., 21. Apr. 2019 um 12:24 Uhr schrieb yyoncho <yyoncho@HIDDEN>:
> >
> > Hi Eli,
> >
> >>
> >> In any case, even if decoding takes 50% of the time we spend in Emacs
> >> code, it is still not significant enough to justify the un-safety of
> >> using a string that we didn't decode, because if that string ever
> >> includes raw bytes, Emacs will surely crash.
> >
> >
> > IMO if validation of the data that comes from external libraries is
> taking a lot of time then it does not make sense to use external libraries
> at all when we are aiming for performance gains.
>
>
> There's no need to validate Jansson's output because it already
> validates that the input is valid UTF-8, and never generates invalid
> strings.
>

--000000000000cde44805870a11f2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi=C2=A0Philipp,<div><br></div><div>As Eli commented in th=
is thread, the decoding is must have for all external libraries no matter w=
hat is their contract.</div><div><br></div><div>Thanks,</div><div>Ivan</div=
></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"=
>On Sun, Apr 21, 2019 at 3:59 PM Philipp Stephani &lt;<a href=3D"mailto:p.s=
tephani2@HIDDEN">p.stephani2@HIDDEN</a>&gt; wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">Am So., 21. Apr. 2019 um 12:24 Uhr=
 schrieb yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN" target=3D"_blank"=
>yyoncho@HIDDEN</a>&gt;:<br>
&gt;<br>
&gt; Hi Eli,<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; In any case, even if decoding takes 50% of the time we spend in Em=
acs<br>
&gt;&gt; code, it is still not significant enough to justify the un-safety =
of<br>
&gt;&gt; using a string that we didn&#39;t decode, because if that string e=
ver<br>
&gt;&gt; includes raw bytes, Emacs will surely crash.<br>
&gt;<br>
&gt;<br>
&gt; IMO if validation of the data that comes from external libraries is ta=
king a lot of time then it does not make sense to use external libraries at=
 all when we are aiming for performance gains.<br>
<br>
<br>
There&#39;s no need to validate Jansson&#39;s output because it already<br>
validates that the input is valid UTF-8, and never generates invalid<br>
strings.<br>
</blockquote></div>

--000000000000cde44805870a11f2--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 12:59:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 08:59:56 2019
Received: from localhost ([127.0.0.1]:47925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIC4a-0001H3-E7
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 08:59:56 -0400
Received: from mail-oi1-f174.google.com ([209.85.167.174]:44062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1hIC4X-0001Gp-PY
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 08:59:55 -0400
Received: by mail-oi1-f174.google.com with SMTP id i21so6810542oib.11
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 05:59:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=cMYrrFPklhzCZjdwU8OX61tp8FKqTCqF8/Hfdkh1iZI=;
 b=BtPTPM0uyFJ/88lnYBKXhF4ZGCtH8Vo2wVO8fC8KiZ6kSspbFinghNlavYMm4FGC7S
 G3eACB1EeWRrMteRdMCAF1di/4dCFWNVqLDsm6KoerOku2+YOiOcUdlmY+/oj3pRAqnw
 a/FZdQ53xyxeKzb7/J/WXXto8JeYcnnNcZHTc6032Zmo840QxDA0u0akEgfcdsZTJQs9
 UEMi09LGd08KtGT7qm6hJv+MmrmJcLADC6PdsU2Vgq8ZZYn6WMwnbdmcY9LnV1dpqIYr
 VoBzhucIzJqCwZzQlirrBNP4nRBx5Pz8KsYDOkEqqqaLEa4S/a0TaQlYA/DET4yT74jO
 FyJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=cMYrrFPklhzCZjdwU8OX61tp8FKqTCqF8/Hfdkh1iZI=;
 b=YtCKbRguul3Erue3OJmxwwNx5+CwXaeh3gG7etzq70EFmywczBJI6qDaByAASuSFJ6
 a6xU9VDjJHpCEtT9vAKKPu/i1I9z+TZqkW65qDnUh5gPml2/K9/gcbW5PMR8zrBPBY8A
 xsUrYwqXn5+DnYbx45PFkLymoqNycRqdLrxTqEZLaNsmuv1aprIeaL8ACKoG2/U+GRNQ
 Cxwenk5QscC3s0rs6eVfU3BR8jEjuDtC/tyKWQ/bGfemBiDFelemYbfecCVDdVXiVEfA
 s704mgFiNRiNNt1Mz552DeX9PnfNB95pyBAdGgcrD5tInDXlK3pgUM1nWCIs9n6yKp1X
 n5DQ==
X-Gm-Message-State: APjAAAXVX44r7KWLunGQbW9Rn9m1/5omxxmcDJdJGPB7v5fb74ZoH/Mn
 jxwitVnfLmXOuV1oGvE9rS+q4FJTp8PFy8v9QGQ=
X-Google-Smtp-Source: APXvYqxbJf5ZbO41XtX9DOw5z0FpBEsxyz5R/mT77ZDyCjXKLSl5GBI515KC1o0TQ4oWdBVmsrut7HY8OZevX4f9w9o=
X-Received: by 2002:aca:d90a:: with SMTP id q10mr7784138oig.65.1555851587571; 
 Sun, 21 Apr 2019 05:59:47 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
In-Reply-To: <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Sun, 21 Apr 2019 14:59:36 +0200
Message-ID: <CAArVCkSmS4=6TSdQAWihP9gUh04edt676jjORx=uWLZY9SspFw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: yyoncho <yyoncho@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: Eli Zaretskii <eliz@HIDDEN>,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>, 31138 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Am So., 21. Apr. 2019 um 12:24 Uhr schrieb yyoncho <yyoncho@HIDDEN>:
>
> Hi Eli,
>
>>
>> In any case, even if decoding takes 50% of the time we spend in Emacs
>> code, it is still not significant enough to justify the un-safety of
>> using a string that we didn't decode, because if that string ever
>> includes raw bytes, Emacs will surely crash.
>
>
> IMO if validation of the data that comes from external libraries is taking a lot of time then it does not make sense to use external libraries at all when we are aiming for performance gains.


There's no need to validate Jansson's output because it already
validates that the input is valid UTF-8, and never generates invalid
strings.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 12:15:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 08:15:30 2019
Received: from localhost ([127.0.0.1]:47908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIBNZ-0000Cf-KJ
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 08:15:29 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33075)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIBNW-0000CR-1q
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 08:15:27 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48550)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIBNP-0000LV-Vz; Sun, 21 Apr 2019 08:15:20 -0400
Received: from [176.228.60.248] (port=1933 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIBNP-0001sy-2f; Sun, 21 Apr 2019 08:15:19 -0400
Date: Sun, 21 Apr 2019 15:15:07 +0300
Message-Id: <83zhoj8shg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
 (message from yyoncho on Sun, 21 Apr 2019 14:38:04 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
 <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 21 Apr 2019 14:38:04 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  I don't see how this follows, when this discussion clearly established
>  that native JSON parsing is much faster than parsing in Lisp.
> 
> We also established that current native performance is not fast enough to handle real-world scenarios. 

Then maybe we should look for a faster JSON parsing library, because
libjansson functions appear in the profile as high or higher than our
decoding routines.  Or maybe this is the limit of what can be done in
Emacs, since there is, and always will be, overhead due to converting
C values to Lisp objects.

>  I also don't see where did "a lot of time" come from, I think it's an
>  exaggeration, given the processing speed shown by benchmarks in this
>  discussion.
> 
> I said that *if* this is the case. You said that if 50% is spent in decoding it is not enough to justify the risk of
> crashing emacs. What I am saying is that IMO if 50% of the time is spent in decoding data that comes from
> Jansson it will be enough to justify not using Jansson at all and writing the whole Json parsing in Emacs
> Source tree.

I don't think I understand how this could help to speed up code,
please explain.

The issue here is not that the library is some code not written by the
Emacs project, because we do the same with text generated by Emacs
Lisp programs.  Bugs can happen in both external libraries and in code
written by Emacs programmers.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 11:38:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 07:38:25 2019
Received: from localhost ([127.0.0.1]:47891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIAng-0007kP-Vj
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 07:38:25 -0400
Received: from mail-lf1-f53.google.com ([209.85.167.53]:45376)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hIAne-0007kC-NA
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 07:38:23 -0400
Received: by mail-lf1-f53.google.com with SMTP id t11so7068507lfl.12
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 04:38:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=ghFIa9OYP4LMUuE/3gwTuFVoTD8g6/CFtAeS5vp5fFA=;
 b=AwJba8IGkcau4qFJ1SYm1c4CzWbkO1+iY9SgRDHihKwcYo/5DvtMaxOrJpYaiyuZj6
 YknkJZHmhECb3SY6CRG99gXsBgyhftkVzYR/kQCIKqqXY3DcqXj41t/COaOgWnOGzHlB
 xYm5OivkIB3/bMYXOWSGB0fWrnmwTV8q4l4PHvEGOkCAjtFR6rw4UQVcSqnIc8hVVc43
 FZRbMQFXxbahmpNot5Zb3CrZKrrP4iq/txIw1quc74dfv2pcR8G88sO46mEoiTL8KWIi
 MlZWvesCFtbGDCNN7oPg5XNC5k8+36z4F0wJkwHD+95nzCvDzDhXSrGnkU37K46jPC6p
 UbhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=ghFIa9OYP4LMUuE/3gwTuFVoTD8g6/CFtAeS5vp5fFA=;
 b=mrpKNCzD2J425OgMoToTA97Dfdz+zLPNP+6s01HekLP/XshN7PTgwuc3I+hGVrfMb6
 LDzlhs3/bN1l5+77ijKybk+FAAgd1FkCnqgKNdQHjcJrGBgKk0Nh/WVRB4K4TgD8ttri
 WbLi8Qanp1yb7qYyVgkpNiV//jXWOJFh5dTHg2nidOUL56AXyTeMorKVESmVbBxgPuol
 HKmjktLlyWo5+/P/0z3OBf3xt0Z4U9lOVzPnssA+qH6gp1ZrkwKZstc2Gu53by/7LDUE
 7bYgFc160xk+4wcNC+GrdfsP7qGfmPtSywYvKblnVJX2nSr3IovsqXhHPLIaBNbeGt1c
 +cFg==
X-Gm-Message-State: APjAAAU+7wfydfePCEbC8B7WNYRwNVbWuDjk58k1rR7bjMz7rpJs2iQ7
 HljvwcAtJogyZWSq1Hxw6wgZexYbBNe2e16xXLQ=
X-Google-Smtp-Source: APXvYqxXf/cGIolhvc4hcjYLW08y6sNbA2l7R/74P7NibW7QeHw5fm8ooUD/ApbloBZz1CLvJpZJWr6zvkqX1z0zR2E=
X-Received: by 2002:ac2:5a11:: with SMTP id q17mr7449113lfn.145.1555846696646; 
 Sun, 21 Apr 2019 04:38:16 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 <837ebnabkf.fsf@HIDDEN>
In-Reply-To: <837ebnabkf.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 21 Apr 2019 14:38:04 +0300
Message-ID: <CACCVLQWUtY52C1L6MMm0WS4qdJG-ovi6CC71DiL_HAMLbNcC6Q@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000adbc96058708c9f4"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000adbc96058708c9f4
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

I don't see how this follows, when this discussion clearly established
> that native JSON parsing is much faster than parsing in Lisp.
>

We also established that current native performance is not fast enough to
handle real-world scenarios.


> I also don't see where did "a lot of time" come from, I think it's an
> exaggeration, given the processing speed shown by benchmarks in this
> discussion.
>

I said that *if* this is the case. You said that if 50% is spent in
decoding it is not enough to justify the risk of crashing emacs. What I am
saying is that IMO if 50% of the time is spent in decoding data that comes
from Jansson it will be enough to justify not using Jansson at all and
writing the whole Json parsing in Emacs Source tree.

Thanks,
Ivan

--000000000000adbc96058708c9f4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli,</div><div><br></div><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">I don&#39;t see how thi=
s follows, when this discussion clearly established<br>
that native JSON parsing is much faster than parsing in Lisp.<br></blockquo=
te><div><br></div><div>We also established that current native performance =
is not fast enough to handle real-world scenarios.=C2=A0</div><div>=C2=A0</=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex">
I also don&#39;t see where did &quot;a lot of time&quot; come from, I think=
 it&#39;s an<br>
exaggeration, given the processing speed shown by benchmarks in this<br>
discussion.<br></blockquote><div><br></div><div>I said that *if* this is th=
e case. You said that if 50% is spent in decoding it is not enough to justi=
fy the risk of crashing emacs. What I am saying is that IMO if 50% of the t=
ime is spent in decoding data that comes from Jansson it will be enough to =
justify not using Jansson at all and writing the whole Json parsing in Emac=
s Source tree.</div><div><br></div><div>Thanks,</div><div>Ivan=C2=A0</div><=
/div></div>

--000000000000adbc96058708c9f4--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 10:38:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 06:38:00 2019
Received: from localhost ([127.0.0.1]:47821 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hI9rD-0004BZ-SU
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 06:38:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47325)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hI9r9-0004BE-EA
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 06:37:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47836)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hI9r3-000592-J2; Sun, 21 Apr 2019 06:37:49 -0400
Received: from [176.228.60.248] (port=3655 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hI9r2-0002Zi-M4; Sun, 21 Apr 2019 06:37:49 -0400
Date: Sun, 21 Apr 2019 13:37:36 +0300
Message-Id: <837ebnabkf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
 (message from yyoncho on Sun, 21 Apr 2019 13:23:28 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
 <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org, sebastien@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 21 Apr 2019 13:23:28 +0300
> Cc: Dmitry Gutov <dgutov@HIDDEN>, Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> IMO if validation of the data that comes from external libraries is taking a lot of time then it does not make
> sense to use external libraries at all when we are aiming for performance gains.

I don't see how this follows, when this discussion clearly established
that native JSON parsing is much faster than parsing in Lisp.

I also don't see where did "a lot of time" come from, I think it's an
exaggeration, given the processing speed shown by benchmarks in this
discussion.

There's still some peculiar slowdown in your configuration, which
AFAIR couldn't be reproduced from "emacs -Q"; I still hope you will be
able to find what causes that.

As for the more general point: we always decode strings, even in UTF-8
locales, so I don't see how this case is different.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 10:23:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 06:23:48 2019
Received: from localhost ([127.0.0.1]:47795 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hI9dU-0003lo-H0
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 06:23:48 -0400
Received: from mail-lf1-f41.google.com ([209.85.167.41]:43906)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1hI9dS-0003lb-MU
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 06:23:47 -0400
Received: by mail-lf1-f41.google.com with SMTP id i68so7018053lfi.10
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 03:23:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=PpF0toTGzTTRjxeBkQu8hUSwLb661nlhjk1ViXnTX9c=;
 b=CFX1jjLkEULjGBb7Md5KMNS2+qh9hQT7OkmiAjnDapPP/BtM5qQdTuFjastNAChNKV
 K0wn+aLxFelA7EEJJLjWvJwetlr6MvFgMdBzR+MtiMNa5g0F563t4Uqvp3DRw7QCZ5e5
 AnMbi4dOhW8frK9lXYrDL4JsXqnZpSc4P0qyuM0drRa3AwqQ2PdOv12xFsNXuJhONUrA
 3uchPYk5pqEjwYBNh6hovv7Pi9dti5eOzR4iUI7n1bzK2EdG16bCWcMJkzV/9Othze9K
 6n3dOq2dNgtKm3ZpTmA4og6Hdb4Eg7Xb8fvO/YGDDZdAiR7S/xpeAOZmqfE8R0YDgWPV
 yt1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=PpF0toTGzTTRjxeBkQu8hUSwLb661nlhjk1ViXnTX9c=;
 b=KSEpZI0ClnVpqzOgNZibOx9JC1Qxi1Vl9a6LTFfbKZHhHBHI6Yz49wl+cK+c72ROCB
 5hG/DFgK0PYOZLoYns38DgSV8deexcIL3jnLf/oPDsGtWXOecekL8RTwycxyjuRZHaH8
 ORG7NAs9hJtGkj9Jv0jm2Q2l8jiTbfGT8+imQk0IKCiFIxZFgMh86dlRQLo0yhM8TOey
 qjUWqhnh2PZkyKaHqXMrh5B0Y/wg5D1mUsO+SHlkRpEFd1VskbkGa6TLvdVjyVuwkpsG
 4C/TdWR6ebjttTMn1JmDeNO2cZhif4JCtMWnDtF5OKUyE6LokqxV35yETHIAnyNl9N78
 yh2w==
X-Gm-Message-State: APjAAAXAVKaeEXSOC5bUal6W30n7yH2C5S7uxjNF92F9XB64n/0IYg+d
 w1VSjB7fI7XoqF/u/LzoE7OcHkj637TFEXg6FDQ=
X-Google-Smtp-Source: APXvYqwNE0p4MNRVWZCeccGzEiY6Ow4FJBUhjAdshTNIMMBpJWoiAkq5616goD2VhGcfoL/cZ5YQTc94bgGXKTbsgMc=
X-Received: by 2002:a19:f013:: with SMTP id p19mr7104894lfc.49.1555842220680; 
 Sun, 21 Apr 2019 03:23:40 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
 <83a7gjaen6.fsf@HIDDEN>
In-Reply-To: <83a7gjaen6.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 21 Apr 2019 13:23:28 +0300
Message-ID: <CACCVLQX9tO31foTUhBSRv4Y8705ne6DTBG57dAPpoc+P9c-naw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000e3e9d2058707be1b"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org,
 =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000e3e9d2058707be1b
Content-Type: text/plain; charset="UTF-8"

Hi Eli,


> In any case, even if decoding takes 50% of the time we spend in Emacs
> code, it is still not significant enough to justify the un-safety of
> using a string that we didn't decode, because if that string ever
> includes raw bytes, Emacs will surely crash.
>

IMO if validation of the data that comes from external libraries is taking
a lot of time then it does not make sense to use external libraries at all
when we are aiming for performance gains.

Thanks,
Ivan

--000000000000e3e9d2058707be1b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli,</div><div><br></div><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
In any case, even if decoding takes 50% of the time we spend in Emacs<br>
code, it is still not significant enough to justify the un-safety of<br>
using a string that we didn&#39;t decode, because if that string ever<br>
includes raw bytes, Emacs will surely crash.<br></blockquote><div><br></div=
><div>IMO if validation of the data that comes from external libraries is t=
aking a lot of time then it does not make sense to use external libraries a=
t all when we are aiming for performance gains.</div><div><br></div><div>Th=
anks,</div><div>Ivan=C2=A0</div><div><br></div></div></div>

--000000000000e3e9d2058707be1b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 09:31:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 05:31:31 2019
Received: from localhost ([127.0.0.1]:47696 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hI8os-0000MQ-Ls
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 05:31:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37859)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hI8oq-0000MA-JK
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 05:31:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47394)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hI8oj-0004Zc-Qz; Sun, 21 Apr 2019 05:31:22 -0400
Received: from [176.228.60.248] (port=3383 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hI8oj-0006na-6b; Sun, 21 Apr 2019 05:31:21 -0400
Date: Sun, 21 Apr 2019 12:31:09 +0300
Message-Id: <83a7gjaen6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN> (message from
 Dmitry Gutov on Sun, 21 Apr 2019 12:15:59 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
 <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Sun, 21 Apr 2019 12:15:59 +0300
> 
> On 21.04.2019 11:58, Eli Zaretskii wrote:
> > I profiled the code, and my results are very similar to yours.  My
> > interpretation of the results is that decoding strings that we receive
> > from the jansson library takes less than 10% of the CPU time.  So I
> > think we don't need to worry about this aspect when considering
> > parsing of JSON objects.
> 
> Eli, how did you reach that conclusion?

By adding the percentage of all the functions involved in decoding
strings.

> One: looking at the profile, libjansson is somewhere down below, and 
> most of the runtime is taken by Emacs.

I only accounted for time used by Emacs code, i.e. 100% doesn't
include the library.

> Two: while I might be misreading the profile, simply omitting the 
> decoding function call (and using the returned strings as-is) halves the 
> execution time.

You cannot use the returned string as is, you must make a Lisp string
out of it.

In any case, even if decoding takes 50% of the time we spend in Emacs
code, it is still not significant enough to justify the un-safety of
using a string that we didn't decode, because if that string ever
includes raw bytes, Emacs will surely crash.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 09:16:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 05:16:12 2019
Received: from localhost ([127.0.0.1]:47666 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hI8a4-0008O8-L1
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 05:16:12 -0400
Received: from mail-lj1-f177.google.com ([209.85.208.177]:38895)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hI8a2-0008Nt-3x
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 05:16:10 -0400
Received: by mail-lj1-f177.google.com with SMTP id p14so7977819ljg.5
 for <31138 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 02:16:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=S5EnIIpDsioLvxG/fuHOiVZhMnrLJSoDhVCA7RUfJGo=;
 b=VkNDzumChAbKbhzW6S3vIJ3g6BSvvX7VcAQoJu1/CULz6bivQvm99jRARe06f5akD5
 xprtb7nMU50HUEsOu+P3/ZVz6x3YyYmyC6ddRtwdrVNMPAs6MidXp/OUpwtxlz5OqSz3
 KM34Y6tg8DEQ4RSXHkMorCzadQGmwQde1L08QBwP3BjarpH3vfApLuF4V8B6EES6aUJ7
 xKJAXEJuYw7BLXjSJpq2bcZICa1gbbSaGkzbUeDs31qYaqezp99Pwib4RNYPsoonfsft
 50hefrOjKYTJmPviYTQ2wLhhV7JdYvhN8BPMMNtmahoCAKrQkKdEjwCfvQtbe1hR6ie9
 0ktA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=S5EnIIpDsioLvxG/fuHOiVZhMnrLJSoDhVCA7RUfJGo=;
 b=nZ1M6wM0fwpoYF1WKrMKjobHAkLjuIzLPpWHztC1/IGbia0n171eif0U6PcJbLPtLS
 R/2uSjm23yAMh0Y5C16vwmKhr9wdTWS9jmJNqfmIvf/zTPgeLOXKfhKSXty5MbHObynQ
 mQIKu6CK3ITBlgIuFim1XmcE+GbPLn8or635ROrGsQBHnXX0HOiLTA34scOS1QFkz28A
 z/BFoPp8HZi8W3UO0/vo8dP4nKq+ovpAWTDG1nDktkTMxnRhvf94sT0D9iHwLNN1VgCP
 MKe08d2ERHK6QQpS3bCyCYnraE5aCLzfwGMpjhGq7/d1OH+cjlgeFj1rAcMHX1u07okP
 Es5g==
X-Gm-Message-State: APjAAAWGyzF18kvX11oAreCXpbDhPgygq4y0teT2JIba67sJsO22B8ws
 /2yR6kuGHKCg83HzaPHJejjB1utQ
X-Google-Smtp-Source: APXvYqyW2V0FGF/ET5dBYeP19B8vB2E34pBuSilJrd7s4QJ/kTXmtJpjlKuI9KXo8LgI94Y7skOojw==
X-Received: by 2002:a2e:9c0a:: with SMTP id s10mr7037537lji.162.1555838163851; 
 Sun, 21 Apr 2019 02:16:03 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id l13sm2393993lfc.61.2019.04.21.02.16.01
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 21 Apr 2019 02:16:02 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, sebastien@HIDDEN, yyoncho@HIDDEN
References: <87sh806xwa.fsf@HIDDEN> <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
 <83y349gasn.fsf@HIDDEN> <83d0lfag4x.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5cf45a21-65c3-67ee-f123-be83a6ee7c99@HIDDEN>
Date: Sun, 21 Apr 2019 12:15:59 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83d0lfag4x.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

On 21.04.2019 11:58, Eli Zaretskii wrote:
> I profiled the code, and my results are very similar to yours.  My
> interpretation of the results is that decoding strings that we receive
> from the jansson library takes less than 10% of the CPU time.  So I
> think we don't need to worry about this aspect when considering
> parsing of JSON objects.

Eli, how did you reach that conclusion?

One: looking at the profile, libjansson is somewhere down below, and 
most of the runtime is taken by Emacs.

Two: while I might be misreading the profile, simply omitting the 
decoding function call (and using the returned strings as-is) halves the 
execution time.

How could that be compatible with your interpretation?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 08:59:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 21 04:59:16 2019
Received: from localhost ([127.0.0.1]:47638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hI8Jg-0007y7-FA
	for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 04:59:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33686)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hI8Jf-0007xv-5X
 for 31138 <at> debbugs.gnu.org; Sun, 21 Apr 2019 04:59:15 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47170)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hI8JY-0007Ic-UD; Sun, 21 Apr 2019 04:59:08 -0400
Received: from [176.228.60.248] (port=1403 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hI8JX-0002yF-91; Sun, 21 Apr 2019 04:59:07 -0400
Date: Sun, 21 Apr 2019 11:58:54 +0300
Message-Id: <83d0lfag4x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: dgutov@HIDDEN, sebastien@HIDDEN, yyoncho@HIDDEN
In-reply-to: <83y349gasn.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 16
 Apr 2019 19:44:08 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
 <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN>
 <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN>
 <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
 <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> <83y349gasn.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 16 Apr 2019 19:44:08 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> 
> > Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> > From: Dmitry Gutov <dgutov@HIDDEN>
> > Date: Tue, 16 Apr 2019 19:23:11 +0300
> > 
> > If you think it would help, I can anonymize it and send the result
> 
> No need for now.
> 
> Thanks, I will look into the results some more soon.

I profiled the code, and my results are very similar to yours.  My
interpretation of the results is that decoding strings that we receive
from the jansson library takes less than 10% of the CPU time.  So I
think we don't need to worry about this aspect when considering
parsing of JSON objects.

I think we can close this bug now.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 16:44:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 12:44:22 2019
Received: from localhost ([127.0.0.1]:37929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGRC2-0005AP-7n
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:44:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hGRC0-0005AA-Cq
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:44:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52106)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hGRBt-00005K-Tf; Tue, 16 Apr 2019 12:44:14 -0400
Received: from [176.228.60.248] (port=4701 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hGRBs-0001Ep-Vz; Tue, 16 Apr 2019 12:44:13 -0400
Date: Tue, 16 Apr 2019 19:44:08 +0300
Message-Id: <83y349gasn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN> (message from
 Dmitry Gutov on Tue, 16 Apr 2019 19:23:11 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN> <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 16 Apr 2019 19:23:11 +0300
> 
> If you think it would help, I can anonymize it and send the result

No need for now.

Thanks, I will look into the results some more soon.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 16:23:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 12:23:23 2019
Received: from localhost ([127.0.0.1]:37918 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGQri-0004Yf-M4
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:23:23 -0400
Received: from mail-wm1-f49.google.com ([209.85.128.49]:51526)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hGQrg-0004YC-Cw
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:23:21 -0400
Received: by mail-wm1-f49.google.com with SMTP id 4so26179333wmf.1
 for <31138 <at> debbugs.gnu.org>; Tue, 16 Apr 2019 09:23:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=UzozUK5j+zvQnijVlXlMyJ58oEgJo9Smb14/4P1RbBY=;
 b=N3JL7RalQZ4h+AR3YiyxahCrcPLuaOwsuW566/XaPquobFNTC9pIoWa7XLDKswp5Ns
 CtteiolsYSzwx+lipFirAiH+A6+4Ty9zqHcIFY+ThI+pPKxDGQucwYwqCaoHGQ9oT+fZ
 +cQt625tkPNolp+eFor8zBCUZ2a7oCn7b93qePqD+4HMlxGcehtMBM4qw/SMT66MzZaE
 LncPxuB++b/QqM6t7PnVR/gLjxCZHZ8c67Iu4XfiVDcKTLpaqNrB0qkO2ykYI+rbEQQS
 8hGivlFa7Du9620Xv98Z2of0SSu9WYBbZEschBK6wRIWCS7MFmQG7hHWLlMAvTO8vJ3E
 nx4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=UzozUK5j+zvQnijVlXlMyJ58oEgJo9Smb14/4P1RbBY=;
 b=R63dKowXpO8SU8QYuy1apfn4FXcZx0qbYzLrbrhdZal9QeAIHp1/bjQ+GCINXT+sBI
 XGW10c8edrUHRsFKF+ruuUmGfZ3oLZBq9raw6e4tRovVJIEH4s2GUYv8CiIvFAuXhHYa
 FvbtfCHN16rMCfoFXifMvvlMHhDqdIRWCiN0+tRzw54WIHkoIvZGifRVqQdoxImh05Kl
 UNRYCm/+7P67mAE1aNmHfSn50usLHwhjWn2D4WuyOopvPQlWX2nXDBxSmimK4O774vfZ
 gN0Qv7iAM5vxuz12lQeEaLj0tioA8QoaXW15V63bhnNxyMXGEfWAepryuR/jSU7tz9Hb
 KEYg==
X-Gm-Message-State: APjAAAWoTZj7KwmFtyl2CvOJw7ODwlcFH3hfdrs1IuDT6v/ETMIoBQYt
 +Po+iJkBJ4BuNk2eZsKGbyS1s1S1
X-Google-Smtp-Source: APXvYqzC4Fz0bNEgLgoPXRsZPCzDAAXzB2kRXgUijtZMe0XLiy/xXNynH6Kvg9h255EQQt8xfuiIDQ==
X-Received: by 2002:a05:600c:2199:: with SMTP id
 e25mr26868612wme.36.1555431794406; 
 Tue, 16 Apr 2019 09:23:14 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id z18sm79612136wrr.90.2019.04.16.09.23.11
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 16 Apr 2019 09:23:12 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
 <831s22gcci.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <f6951b39-6458-1bf6-7b4d-b1adf8aada25@HIDDEN>
Date: Tue, 16 Apr 2019 19:23:11 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <831s22gcci.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 16.04.2019 19:10,
 Eli Zaretskii wrote: >> Cc: sebastien@HIDDEN, 
 yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org >> From: Dmitry Gutov >> Date: Tue,
 16 Apr 2019 18:30:08 +0300 >> >> The script and repo [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: gnu.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (dgutov[at]yandex.ru)
 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.128.49 listed in list.dnswl.org]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 1.0 FREEMAIL_REPLY         From and body contain different freemails
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 16.04.2019 19:10, Eli Zaretskii wrote:
>> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Date: Tue, 16 Apr 2019 18:30:08 +0300
>>
>> The script and report are attached.
> 
> Thanks, can you also show the sample-response.json file?

It's an output from a code assistance tool listing all classes in our 
internal application, including libraries. I probably shouldn't 
distribute it.

But it's basically a long list of entries like:

[["Gem::Licenses",null,"suggestions",[["req","license"]],"/home/dgutov/.rbenv/versions/2.6.1/lib/ruby/2.6.0/rubygems/util/licenses.rb",429],["Gem::Licenses",null,"match?",[["req","license"]],"/home/dgutov/.rbenv/versions/2.6.1/lib/ruby/2.6.0/rubygems/util/licenses.rb",425],["URI::Generic",null,"use_proxy?",[["req","hostname"],["req","addr"],["req","port"],["req","no_proxy"]],"/home/dgutov/.rbenv/versions/2.6.1/lib/ruby/2.6.0/uri/generic.rb",1545],["URI::Generic",null,"default_port",[],"/home/dgutov/.rbenv/versions/2.6.1/lib/ruby/2.6.0/uri/generic.rb",33],["URI::Generic",null,"component",[],"/home/dgutov/.rbenv/versions/2.6.1/lib/ruby/2.6.0/uri/generic.rb",58], 
...

If you think it would help, I can anonymize it and send the result, but 
large.json posted by Ivan here previously shows the same performance 
characteristics, I think.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 16:10:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 12:10:53 2019
Received: from localhost ([127.0.0.1]:37904 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGQfc-0004BD-Ir
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:10:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35749)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hGQfa-0004Ay-Ox
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 12:10:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:51460)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hGQfU-0006tn-Mv; Tue, 16 Apr 2019 12:10:44 -0400
Received: from [176.228.60.248] (port=2441 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hGQfT-0005mM-Kg; Tue, 16 Apr 2019 12:10:44 -0400
Date: Tue, 16 Apr 2019 19:10:37 +0300
Message-Id: <831s22gcci.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN> (message from
 Dmitry Gutov on Tue, 16 Apr 2019 18:30:08 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN> <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 16 Apr 2019 18:30:08 +0300
> 
> The script and report are attached.

Thanks, can you also show the sample-response.json file?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 15:30:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 11:30:22 2019
Received: from localhost ([127.0.0.1]:37730 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGQ2P-00032l-3A
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 11:30:22 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:55631)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hGQ2M-00032V-Fn
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 11:30:19 -0400
Received: by mail-wm1-f41.google.com with SMTP id o25so25932504wmf.5
 for <31138 <at> debbugs.gnu.org>; Tue, 16 Apr 2019 08:30:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=B1u09lyg3E+mg2VCjB5d1Hz5D9Q1T062OJNaNZyQlV4=;
 b=vJI7ZdkadCjzW/qLeLf6wnB5VMWW2xLAXVldBt7udtJ3loJfOwGAmUP/VtiZtoZLMR
 LHbb8ZPUcuRWVjUS6X/V8dw9ybx7LFrgIE9q3Jmq+3t5EQmYVwrh6wAFnPPRZh71OoSA
 2R7Tyv5tjdPIzlw2xajor7Id0wrIvSMENzY+0vjKzMnJdOR/DDouPl+1l0R+8/Jiz7Kg
 yG8n3K8gAdbJQ5ZiWje7GtlwxCeczKczEoKNlTke7FSghEAi7g/SeCxaUeNkmN6DbsWc
 Ygysx06bqmz0nKxGS4Ge0afWVzOPlPgGdUpll+g6ICVyPbIgx5cmHUckALNnUj/ctEkX
 fiEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language;
 bh=B1u09lyg3E+mg2VCjB5d1Hz5D9Q1T062OJNaNZyQlV4=;
 b=lvSjLPon9oSJG1K/KzcOouVp6XYNWazYiy69JfKPIkPN9mANitnkXnvx7Z5sjx0BHQ
 gONn9OBxPp8g7sm7e0u8jR1O7RUMeF4vcSHxtAUSPIcikTLMw/31FhImx89+ByU6/Uvq
 LECtuP9B4y6j2nrqXEA96pErl/V+4HMi6LI4ZQ7tt6KSoUkcF9YgNMxe9lURHTvgNord
 f5LzGtYxOk4IO2xdE/LmrHOfp2nFq+JDs4FuyAdvyC6Shmfuw2cVD88aZb25PGAL96eg
 f1VBjhosKxiBpflVNblHAlkiuJOLB4aOhG8MZqWU9LFlYGoZjUMI3+JaksRPosw+5wus
 NryQ==
X-Gm-Message-State: APjAAAXSdu38ARxEX1QKsOwK4YrPR+SA1gLaU0ihIANBdvP20tC1T/OS
 63hnYNBQjjcOL8DxvfQNO7JBAy/5
X-Google-Smtp-Source: APXvYqy8gRc2ngzkq+41V1E60vzIaTFG30CCapNih6HwmtPqVHXqJKKpTP+AYGACEIXCEsMRU2LOhQ==
X-Received: by 2002:a7b:c155:: with SMTP id z21mr27393887wmi.1.1555428612395; 
 Tue, 16 Apr 2019 08:30:12 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id
 r30sm175685573wrr.46.2019.04.16.08.30.08
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 16 Apr 2019 08:30:10 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
 <83d0lmgez2.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <7d503be9-4d85-3d0b-6829-631ad376ba3d@HIDDEN>
Date: Tue, 16 Apr 2019 18:30:08 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83d0lmgez2.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------A26DB7466EAC58753D78BC8A"
Content-Language: en-US
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

This is a multi-part message in MIME format.
--------------A26DB7466EAC58753D78BC8A
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 16.04.2019 18:13, Eli Zaretskii wrote:

> Thanks.  I think we need to run this with a larger JSON, or maybe run
> it several times in a loop.

There's a loop in benchmark already (10 times).

> Because there were too few samples in
> this run, so we might see a biased picture due to overhead of stuff
> that is done only once.

I've increased it to 100 (the process now takes 38 seconds here).

perf also has a sampling frequency parameter (still 99 Hz used).

> Also, please set gc-cons-threshold and gc-cons-percentage to very
> large values, to prevent GC from biasing the profile even more.

gc-cons-percentage says it's ignored when gc-cons-threshold is high 
enough. I've increased the latter.

>> If you have certain recording or output format preferences, please let
>> me know.
> 
> The ASCII format is fine.

It can add extra columns or some such.

> Was this an optimized build of Emacs or an unoptimized one?

What compiler should emacs be built with?               gcc -g3 -O2

The script and report are attached.

--------------A26DB7466EAC58753D78BC8A
Content-Type: text/plain; charset=UTF-8;
 name="perf-report.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="perf-report.txt"

IyBUbyBkaXNwbGF5IHRoZSBwZXJmLmRhdGEgaGVhZGVyIGluZm8sIHBsZWFzZSB1c2UgLS1o
ZWFkZXIvLS1oZWFkZXItb25seSBvcHRpb25zLgojCiMKIyBUb3RhbCBMb3N0IFNhbXBsZXM6
IDAKIwojIFNhbXBsZXM6IDNLIG9mIGV2ZW50ICdjeWNsZXM6cHBwJwojIEV2ZW50IGNvdW50
IChhcHByb3guKTogMTIwOTEwNjUwNzM1CiMKIyBPdmVyaGVhZCAgICAgICBTYW1wbGVzICBD
b21tYW5kICBTaGFyZWQgT2JqZWN0ICAgICAgICAgU3ltYm9sICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIAojIC4uLi4uLi4uICAuLi4uLi4uLi4uLi4gIC4uLi4u
Li4gIC4uLi4uLi4uLi4uLi4uLi4uLi4uICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u
Li4uLi4uLi4uLi4uLi4uLi4uCiMKICAgICA2LjAwJSAgICAgICAgICAgMjI5ICBlbWFjcyAg
ICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGRlY29kZV9jb2RpbmdfdXRmXzgKICAgICA1
LjMxJSAgICAgICAgICAgMjA2ICBlbWFjcyAgICBsaWJjLTIuMjcuc28gICAgICAgICAgWy5d
IG1hbGxvYwogICAgIDQuNTclICAgICAgICAgICAxNzcgIGVtYWNzICAgIGVtYWNzICAgICAg
ICAgICAgICAgICBbLl0gcHJvZHVjZV9jaGFycwogICAgIDQuMTIlICAgICAgICAgICAxNjQg
IGVtYWNzICAgIGxpYmMtMi4yNy5zbyAgICAgICAgICBbLl0gbWFsbG9jX2NvbnNvbGlkYXRl
CiAgICAgNC4wNSUgICAgICAgICAgIDE2MSAgZW1hY3MgICAgbGliYy0yLjI3LnNvICAgICAg
ICAgIFsuXSBjZnJlZUBHTElCQ18yLjIuNQogICAgIDMuMzglICAgICAgICAgICAxMzUgIGVt
YWNzICAgIGxpYmMtMi4yNy5zbyAgICAgICAgICBbLl0gX19tZW1tb3ZlX2F2eF91bmFsaWdu
ZWRfZXJtcwogICAgIDMuMjMlICAgICAgICAgICAxMjUgIGVtYWNzICAgIGVtYWNzICAgICAg
ICAgICAgICAgICBbLl0gc3RvcmVfc3ltdmFsX2ZvcndhcmRpbmcKICAgICAyLjYzJSAgICAg
ICAgICAgMTAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGRvX3N5bXZh
bF9mb3J3YXJkaW5nCiAgICAgMi41OCUgICAgICAgICAgIDEwNCAgZW1hY3MgICAgbGliYy0y
LjI3LnNvICAgICAgICAgIFsuXSBfaW50X21hbGxvYwogICAgIDIuNTglICAgICAgICAgICAx
MDAgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gc2V0X2J1ZmZlcl9pbnRl
cm5hbF8yCiAgICAgMi40MSUgICAgICAgICAgICA5MyAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBhbGxvY2F0ZV92ZWN0b3JsaWtlCiAgICAgMi4wOCUgICAgICAgICAg
ICA4MSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBqc29uX3RvX2xpc3AK
ICAgICAxLjkwJSAgICAgICAgICAgIDgxICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAg
ICAgWy5dIGRldGVjdF9jb2RpbmdfdXRmXzgKICAgICAxLjg1JSAgICAgICAgICAgIDcyICBl
bWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIHN3YXBfaW5fc3ltdmFsX2Zvcndh
cmRpbmcKICAgICAxLjcyJSAgICAgICAgICAgIDcyICBlbWFjcyAgICBlbWFjcyAgICAgICAg
ICAgICAgICAgWy5dIGRldGVjdF9jb2RpbmcKICAgICAxLjM4JSAgICAgICAgICAgIDMxICBl
bWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGluc2VydF9mcm9tX2dhcAogICAg
IDEuMjklICAgICAgICAgICAgNTAgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0ganNvbl9kZWxldGUKICAgICAxLjE5JSAgICAgICAgICAgIDQ2ICBlbWFjcyAgICBlbWFj
cyAgICAgICAgICAgICAgICAgWy5dIGhhc2hfbG9va3VwCiAgICAgMS4wMSUgICAgICAgICAg
ICAzOSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBkZWNvZGVfY29kaW5n
CiAgICAgMS4wMSUgICAgICAgICAgICAzOSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjEx
LjAgIFsuXSBqc29uX2FycmF5X2dldAogICAgIDAuOTglICAgICAgICAgICAgNDUgIGVtYWNz
ICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gc3dlZXBfc3RyaW5ncwogICAgIDAuOTUl
ICAgICAgICAgICAgMzcgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gbWVt
X2luc2VydAogICAgIDAuOTUlICAgICAgICAgICAgMzcgIGVtYWNzICAgIGVtYWNzICAgICAg
ICAgICAgICAgICBbLl0gZGVsX3JhbmdlXzIKICAgICAwLjg1JSAgICAgICAgICAgIDMzICBl
bWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGFzc3Ffbm9fcXVpdAogICAgIDAu
NzclICAgICAgICAgICAgMzEgIGVtYWNzICAgIGxpYmMtMi4yNy5zbyAgICAgICAgICBbLl0g
X19tZW1jaHJfYXZ4MgogICAgIDAuNzElICAgICAgICAgICAgMjkgIGVtYWNzICAgIGVtYWNz
ICAgICAgICAgICAgICAgICBbLl0gYm95ZXJfbW9vcmUKICAgICAwLjY3JSAgICAgICAgICAg
IDI2ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIHZhbGlkYXRlX2ludGVy
dmFsX3JhbmdlCiAgICAgMC42MSUgICAgICAgICAgICAyNSAgZW1hY3MgICAgbGliamFuc3Nv
bi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQxZTQKICAgICAwLjU4JSAgICAgICAg
ICAgIDIzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAw
MDAwNDFkYwogICAgIDAuNTclICAgICAgICAgICAgMjMgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGE0CiAgICAgMC41NyUgICAgICAgICAg
ICAyMyAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAw
MDdmMzMKICAgICAwLjU3JSAgICAgICAgICAgIDIzICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwM2M2MQogICAgIDAuNTclICAgICAgICAgICAg
MjMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0
ODQ3CiAgICAgMC41NiUgICAgICAgICAgICAyMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSBhbGxvY2F0ZV9zdHJpbmdfZGF0YQogICAgIDAuNTMlICAgICAgICAgICAg
MjEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3
ZjU4CiAgICAgMC41MyUgICAgICAgICAgICAyMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40
LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDNjMWYKICAgICAwLjUyJSAgICAgICAgICAgIDIx
ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA3
NAogICAgIDAuNTIlICAgICAgICAgICAgMjAgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAg
ICAgICBbLl0gY29kZV9jb252ZXJ0X3N0cmluZwogICAgIDAuNTIlICAgICAgICAgICAgMjAg
IGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gbWFrZV91bmluaXRfbXVsdGli
eXRlX3N0cmluZwogICAgIDAuNTElICAgICAgICAgICAgMjEgIGVtYWNzICAgIGxpYmphbnNz
b24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MWYwCiAgICAgMC41MSUgICAgICAg
ICAgICAyMCAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBkZWNvZGVfY29k
aW5nX29iamVjdAogICAgIDAuNTAlICAgICAgICAgICAgMjAgIGVtYWNzICAgIGxpYmphbnNz
b24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MWM1CiAgICAgMC41MCUgICAgICAg
ICAgICAyMCAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAw
MDAwMDdmNTMKICAgICAwLjUwJSAgICAgICAgICAgIDIwICBlbWFjcyAgICBlbWFjcyAgICAg
ICAgICAgICAgICAgWy5dIGpzb25fbWFsbG9jCiAgICAgMC41MCUgICAgICAgICAgICAyMCAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ4M2IK
ICAgICAwLjQ5JSAgICAgICAgICAgIDE5ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAg
ICAgWy5dIGRlbF9yYW5nZV8xCiAgICAgMC40NyUgICAgICAgICAgICAxOSAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwOGEKICAgICAwLjQ3
JSAgICAgICAgICAgIDE5ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwN2YxZgogICAgIDAuNDYlICAgICAgICAgICAgMTggIGVtYWNzICAgIGVt
YWNzICAgICAgICAgICAgICAgICBbLl0gc2V0dXBfY29kaW5nX3N5c3RlbQogICAgIDAuNDYl
ICAgICAgICAgICAgMTggIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0ganNv
bl9zdHJpbmdfdmFsdWUKICAgICAwLjQ0JSAgICAgICAgICAgIDE4ICBlbWFjcyAgICBsaWJq
YW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwN2U3ZAogICAgIDAuNDQlICAg
ICAgICAgICAgMTcgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gYWRqdXN0
X3N1c3BlbmRfYXV0b19oc2Nyb2xsCiAgICAgMC40NCUgICAgICAgICAgICAxNyAgZW1hY3Mg
ICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBpbnZhbGlkYXRlX2J1ZmZlcl9jYWNoZXMK
ICAgICAwLjQyJSAgICAgICAgICAgIDE3ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwNDFlYwogICAgIDAuNDIlICAgICAgICAgICAgMTcgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gbWVtY3B5QHBsdAogICAgIDAuNDIl
ICAgICAgICAgICAgMTYgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBba10gY2xl
YXJfcGFnZV9lcm1zCiAgICAgMC40MSUgICAgICAgICAgICAxNyAgZW1hY3MgICAgbGliamFu
c3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDdmMTcKICAgICAwLjQxJSAgICAg
ICAgICAgIDE2ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIEZzeW1ib2xf
dmFsdWUKICAgICAwLjQxJSAgICAgICAgICAgIDE2ICBlbWFjcyAgICBlbWFjcyAgICAgICAg
ICAgICAgICAgWy5dIHByZXBhcmVfdG9fbW9kaWZ5X2J1ZmZlcl8xCiAgICAgMC40MCUgICAg
ICAgICAgICAxNiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAw
MDAwMDAwMDQ0ZTcKICAgICAwLjM5JSAgICAgICAgICAgIDE2ICBlbWFjcyAgICBsaWJqYW5z
c29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA5NgogICAgIDAuMzklICAgICAg
ICAgICAgMTUgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZmluZF9zeW1i
b2xfdmFsdWUKICAgICAwLjM4JSAgICAgICAgICAgIDE4ICBlbWFjcyAgICBlbWFjcyAgICAg
ICAgICAgICAgICAgWy5dIHN3ZWVwX3ZlY3RvcnMKICAgICAwLjM3JSAgICAgICAgICAgIDE1
ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBi
MQogICAgIDAuMzclICAgICAgICAgICAgMTUgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4x
MS4wICBbLl0ganNvbl9hcnJheV9hcHBlbmRfbmV3CiAgICAgMC4zNyUgICAgICAgICAgICAx
NSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQw
OTEKICAgICAwLjM3JSAgICAgICAgICAgIDE1ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQu
MTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA3YwogICAgIDAuMzYlICAgICAgICAgICAgMTQg
IGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZTg5
CiAgICAgMC4zNSUgICAgICAgICAgICAxNCAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjEx
LjAgIFsuXSAweDAwMDAwMDAwMDAwMDQxZjcKICAgICAwLjM1JSAgICAgICAgICAgIDE0ICBl
bWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBjYQog
ICAgIDAuMzUlICAgICAgICAgICAgMTQgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4w
ICBbLl0gMHgwMDAwMDAwMDAwMDA0MGM1CiAgICAgMC4zNCUgICAgICAgICAgICAxNCAgZW1h
Y3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ0YjgKICAg
ICAwLjM0JSAgICAgICAgICAgIDEzICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAg
Wy5dIG1ha2VfYnVmZmVyX3N0cmluZ19ib3RoCiAgICAgMC4zMiUgICAgICAgICAgICAxMyAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwOWUK
ICAgICAwLjMyJSAgICAgICAgICAgIDEzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwNDdmZQogICAgIDAuMzIlICAgICAgICAgICAgMTMgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGUwCiAg
ICAgMC4zMSUgICAgICAgICAgICAxMiAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAg
IFtrXSBnZXRfcGFnZV9mcm9tX2ZyZWVsaXN0CiAgICAgMC4zMSUgICAgICAgICAgICAxMiAg
ZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBzZXRfaW50ZXJuYWwKICAgICAw
LjMwJSAgICAgICAgICAgIDEyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwN2Y0MAogICAgIDAuMjklICAgICAgICAgICAgMTIgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZTc0CiAgICAgMC4y
OSUgICAgICAgICAgICAxMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDdmMDcKICAgICAwLjI5JSAgICAgICAgICAgIDExICBlbWFjcyAgICBb
a2VybmVsLmthbGxzeW1zXSAgICAgW2tdIHN5bmNfcmVncwogICAgIDAuMjYlICAgICAgICAg
ICAgMTAgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBba10gc3dhcGdzX3Jlc3Rv
cmVfcmVnc19hbmRfcmV0dXJuX3RvX3VzZXJtb2RlCiAgICAgMC4yNiUgICAgICAgICAgICAx
MCAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSBqc29uX3N0cmluZ19sZW5n
dGgKICAgICAwLjI1JSAgICAgICAgICAgIDEwICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1z
XSAgICAgW2tdIGNvcHlfdXNlcl9lbmhhbmNlZF9mYXN0X3N0cmluZwogICAgIDAuMjMlICAg
ICAgICAgICAgIDkgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gRm5leHRf
cHJvcGVydHlfY2hhbmdlCiAgICAgMC4yMyUgICAgICAgICAgICAgOSAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBtYWtlX3ZlY3RvcgogICAgIDAuMjIlICAgICAgICAg
ICAgIDkgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA0MGRiCiAgICAgMC4yMiUgICAgICAgICAgICAgOSAgZW1hY3MgICAgbGliamFuc3Nvbi5z
by40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwZDYKICAgICAwLjIyJSAgICAgICAgICAg
ICA5ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAw
NDRjZgogICAgIDAuMjElICAgICAgICAgICAgMTAgIGVtYWNzICAgIGVtYWNzICAgICAgICAg
ICAgICAgICBbLl0gbWVtX2RlbGV0ZS5wYXJ0LjI4CiAgICAgMC4yMSUgICAgICAgICAgICAg
OCAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBjb2Rpbmdfc2V0X2Rlc3Rp
bmF0aW9uCiAgICAgMC4yMSUgICAgICAgICAgICAgOCAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBGZXJhc2VfYnVmZmVyCiAgICAgMC4yMCUgICAgICAgICAgICAgOCAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSBqc29uX2FycmF5X3NpemUKICAg
ICAwLjIwJSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAg
W2tdIF9fYXRpbWVfbmVlZHNfdXBkYXRlCiAgICAgMC4yMCUgICAgICAgICAgICAgOCAgZW1h
Y3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDgyOTAKICAg
ICAwLjIwJSAgICAgICAgICAgICA4ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAg
Wy5dIDB4MDAwMDAwMDAwMDAwNDBiYQogICAgIDAuMTklICAgICAgICAgICAgIDEgIGdtYWlu
ICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBba10gYWNjdF9jb2xsZWN0CiAgICAgMC4xOCUg
ICAgICAgICAgICAgNyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBtYWtl
X3NwZWNpZmllZF9zdHJpbmcKICAgICAwLjE4JSAgICAgICAgICAgICA3ICBlbWFjcyAgICBl
bWFjcyAgICAgICAgICAgICAgICAgWy5dIHVuYmluZF90bwogICAgIDAuMTglICAgICAgICAg
ICAgIDcgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gcmVjb3JkX2J1ZmZl
cl9tYXJrZXJzCiAgICAgMC4xOCUgICAgICAgICAgICAgNyAgZW1hY3MgICAgZW1hY3MgICAg
ICAgICAgICAgICAgIFsuXSBqc29uX21ha2Vfc3RyaW5nCiAgICAgMC4xOCUgICAgICAgICAg
ICAgNyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBqc29uX2ZyZWUKICAg
ICAwLjE4JSAgICAgICAgICAgICA3ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAg
Wy5dIHJlY29yZF9pbnNlcnQKICAgICAwLjE3JSAgICAgICAgICAgICA3ICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBiYwogICAgIDAuMTcl
ICAgICAgICAgICAgIDcgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA4MjlhCiAgICAgMC4xNiUgICAgICAgICAgICAgOCAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBtZW1fZmluZC5wYXJ0LjIwCiAgICAgMC4xNiUgICAg
ICAgICAgICAgNiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSByZWNlbnRl
cl9vdmVybGF5X2xpc3RzCiAgICAgMC4xNSUgICAgICAgICAgICAgNiAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBkb19vbmVfdW5iaW5kLmNvbnN0cHJvcC4yNAogICAg
IDAuMTUlICAgICAgICAgICAgIDYgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0ganNvbl9pbnRlZ2VyX3ZhbHVlCiAgICAgMC4xNSUgICAgICAgICAgICAgNiAgZW1hY3Mg
ICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBGYXNzcQogICAgIDAuMTUlICAgICAgICAg
ICAgIDYgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gdXBkYXRlX2NvbXBv
c2l0aW9ucwogICAgIDAuMTUlICAgICAgICAgICAgIDYgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGUzCiAgICAgMC4xNSUgICAgICAgICAg
ICAgNiAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfcmF3X3NwaW5fbG9j
awogICAgIDAuMTUlICAgICAgICAgICAgIDYgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4x
MS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGQxCiAgICAgMC4xNSUgICAgICAgICAgICAgNiAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwZTUK
ICAgICAwLjEzJSAgICAgICAgICAgICA1ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAg
ICAgWy5dIGZldGNoX2J1ZmZlcl9tYXJrZXJzCiAgICAgMC4xMyUgICAgICAgICAgICAgNSAg
ZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBGY29ucwogICAgIDAuMTMlICAg
ICAgICAgICAgIDUgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gRndpZGVu
CiAgICAgMC4xMyUgICAgICAgICAgICAgNSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAg
ICAgIFsuXSBGbWFrZV9sb2NhbF92YXJpYWJsZQogICAgIDAuMTMlICAgICAgICAgICAgIDUg
IGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBba10gZXJyb3JfZW50cnkKICAgICAw
LjEzJSAgICAgICAgICAgICA1ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5d
IG9mZnNldF9pbnRlcnZhbHMKICAgICAwLjEzJSAgICAgICAgICAgICA1ICBlbWFjcyAgICBl
bWFjcyAgICAgICAgICAgICAgICAgWy5dIGFkanVzdF9vdmVybGF5c19mb3JfZGVsZXRlCiAg
ICAgMC4xMyUgICAgICAgICAgICAgNSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAg
IFsuXSAweDAwMDAwMDAwMDAwMDdmNGUKICAgICAwLjEzJSAgICAgICAgICAgICA1ICBlbWFj
cyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA5OAogICAg
IDAuMTIlICAgICAgICAgICAgIDUgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0gMHgwMDAwMDAwMDAwMDA0MGNmCiAgICAgMC4xMiUgICAgICAgICAgICAgNSAgZW1hY3Mg
ICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDNjMWUKICAgICAw
LjEyJSAgICAgICAgICAgICA1ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwNDgwNgogICAgIDAuMTAlICAgICAgICAgICAgIDQgIGVtYWNzICAg
IGVtYWNzICAgICAgICAgICAgICAgICBbLl0gYnVmX2NoYXJwb3NfdG9fYnl0ZXBvcwogICAg
IDAuMTAlICAgICAgICAgICAgIDQgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBb
a10gbmF0aXZlX2lycV9yZXR1cm5faXJldAogICAgIDAuMTAlICAgICAgICAgICAgIDQgIGVt
YWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZnJlZUBwbHQKICAgICAwLjEwJSAg
ICAgICAgICAgICA0ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGdldF90
cmFuc2xhdGlvbl90YWJsZQogICAgIDAuMTAlICAgICAgICAgICAgIDQgIGVtYWNzICAgIFtr
ZXJuZWwua2FsbHN5bXNdICAgICBba10gX19wYWdldmVjX2xydV9hZGRfZm4KICAgICAwLjEw
JSAgICAgICAgICAgICA0ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwNDBlNwogICAgIDAuMTAlICAgICAgICAgICAgIDQgIGVtYWNzICAgIGxp
YmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZTdhCiAgICAgMC4xMCUg
ICAgICAgICAgICAgNCAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAw
MDAwMDAwMDAwMDU2YTUKICAgICAwLjEwJSAgICAgICAgICAgICA0ICBlbWFjcyAgICBsaWJq
YW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNGIzMAogICAgIDAuMTAlICAg
ICAgICAgICAgIDQgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAw
MDAwMDAwMDA0MmMzCiAgICAgMC4xMCUgICAgICAgICAgICAgNCAgZW1hY3MgICAgbGliamFu
c3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDdlODUKICAgICAwLjEwJSAgICAg
ICAgICAgICA0ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAw
MDAwMDAwN2U3NwogICAgIDAuMTAlICAgICAgICAgICAgIDQgIGVtYWNzICAgIGxpYmphbnNz
b24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGMwCiAgICAgMC4wOCUgICAgICAg
ICAgICAgMyAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfX2FsbG9jX3Bh
Z2VzX25vZGVtYXNrCiAgICAgMC4wOCUgICAgICAgICAgICAgMyAgZ21haW4gICAgW2tlcm5l
bC5rYWxsc3ltc10gICAgIFtrXSByZWxlYXNlX3BhZ2VzCiAgICAgMC4wOCUgICAgICAgICAg
ICAgMyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBqc29uX2FycmF5X3Np
emVAcGx0CiAgICAgMC4wOCUgICAgICAgICAgICAgMyAgZW1hY3MgICAgW2tlcm5lbC5rYWxs
c3ltc10gICAgIFtrXSBoYW5kbGVfbW1fZmF1bHQKICAgICAwLjA4JSAgICAgICAgICAgICAz
ICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGFsbG9jX3BhZ2VzX3ZtYQog
ICAgIDAuMDglICAgICAgICAgICAgIDMgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAg
ICBbLl0gdXBkYXRlX2J1ZmZlcl9wcm9wZXJ0aWVzCiAgICAgMC4wOCUgICAgICAgICAgICAg
MyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBDSEVDS19TVFJJTkdfT1Jf
QlVGRkVSCiAgICAgMC4wOCUgICAgICAgICAgICAgMyAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBGdGV4dF9wcm9wZXJ0aWVzX2F0CiAgICAgMC4wOCUgICAgICAgICAg
ICAgMyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBjb2RlX2NvbnZlcnNp
b25fc2F2ZQogICAgIDAuMDglICAgICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0ODU0CiAgICAgMC4wOCUgICAgICAgICAg
ICAgMyAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAw
MDQwZGYKICAgICAwLjA4JSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwM2M2OQogICAgIDAuMDglICAgICAgICAgICAg
IDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0
MGUyCiAgICAgMC4wOCUgICAgICAgICAgICAgMyAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40
LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ0NDAKICAgICAwLjA4JSAgICAgICAgICAgICAz
ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwN2Y0
OQogICAgIDAuMDglICAgICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4x
MS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZjMwCiAgICAgMC4wOCUgICAgICAgICAgICAgMyAg
ZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBkZWxfcmFuZ2UKICAgICAwLjA3
JSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwN2U3ZQogICAgIDAuMDclICAgICAgICAgICAgIDMgIGVtYWNzICAgIGVt
YWNzICAgICAgICAgICAgICAgICBbLl0gbWFsbG9jQHBsdAogICAgIDAuMDclICAgICAgICAg
ICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA0NDY5CiAgICAgMC4wNyUgICAgICAgICAgICAgMyAgZW1hY3MgICAgbGliamFuc3Nvbi5z
by40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDRhZGUKICAgICAwLjA3JSAgICAgICAgICAg
ICAzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAw
NDNlYgogICAgIDAuMDclICAgICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28u
NC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGU5CiAgICAgMC4wNyUgICAgICAgICAgICAg
MyAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDRl
MWMKICAgICAwLjA3JSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQu
MTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwODI5MwogICAgIDAuMDUlICAgICAgICAgICAgIDIg
IGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZ3Jvd19zcGVjcGRsCiAgICAg
MC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsu
XSBpbnZhbGlkYXRlX2N1cnJlbnRfY29sdW1uCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAg
ZW1hY3MgICAgbGliYy0yLjI3LnNvICAgICAgICAgIFsuXSBzeXNtYWxsb2MKICAgICAwLjA1
JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIEZj
dXJyZW50X2J1ZmZlcgogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAgIGVtYWNz
ICAgICAgICAgICAgICAgICBbLl0ganNvbl9zdHJpbmdfbGVuZ3RoQHBsdAogICAgIDAuMDUl
ICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA0MzY2CiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBzaWduYWxfYWZ0ZXJfY2hhbmdlCiAgICAgMC4wNSUg
ICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAw
MDAwMDAwMDAwMDRhYzAKICAgICAwLjA1JSAgICAgICAgICAgICAzICBlbWFjcyAgICBlbWFj
cyAgICAgICAgICAgICAgICAgWy5dIHN3ZWVwX2NvbnNlcwogICAgIDAuMDUlICAgICAgICAg
ICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA3ZTRlCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBldmFwb3JhdGVfb3ZlcmxheXMKICAgICAwLjA1JSAgICAgICAgICAg
ICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAw
NDQ2ZQogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28u
NC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MDc2CiAgICAgMC4wNSUgICAgICAgICAgICAg
MiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBwcmVwYXJlX3RvX21vZGlm
eV9idWZmZXIKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAg
ICAgICAgICAgICAgWy5dIGxpc3BfYWxpZ25fbWFsbG9jCiAgICAgMC4wNSUgICAgICAgICAg
ICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBhbGxvY2F0ZV92ZWN0
b3IKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAg
ICAgICAgWy5dIHNldF9idWZmZXJfaW50ZXJuYWxfMQogICAgIDAuMDUlICAgICAgICAgICAg
IDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA4
NTAyCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliYy0yLjI3LnNvICAg
ICAgICAgIFsuXSBfX0dJX19fX19zdHJ0b2xsX2xfaW50ZXJuYWwKICAgICAwLjA1JSAgICAg
ICAgICAgICAyICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGxydV9jYWNo
ZV9hZGRfYWN0aXZlX29yX3VuZXZpY3RhYmxlCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDdmMWQK
ICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwM2MxMAogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVt
YWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gc2V0dXBfb25fZnJlZV9saXN0CiAg
ICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAg
IFsuXSAweDAwMDAwMDAwMDAwMDQ0NDMKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFj
cyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDJkMwogICAg
IDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0gMHgwMDAwMDAwMDAwMDA0MDg0CiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3Mg
ICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQzZTAKICAgICAw
LjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwNDMwZAogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0Mzk5CiAgICAgMC4w
NSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDdmNDQKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDJmMgogICAgIDAuMDUl
ICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA0MmNlCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGli
amFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDdlNzAKICAgICAwLjA1JSAg
ICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAw
MDAwMDAwMDAwNDg0NQogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmph
bnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MzliCiAgICAgMC4wNSUgICAg
ICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAw
MDAwMDAwMDQyZTkKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5z
c29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA3ZgogICAgIDAuMDUlICAgICAg
ICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAw
MDAwMDA0Mjg0CiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nv
bi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQyNjAKICAgICAwLjA1JSAgICAgICAg
ICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAw
MDAwN2Y3OQogICAgIDAuMDUlICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDAzYzY4CiAgICAgMC4wNSUgICAgICAgICAg
ICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAw
MDRhYmQKICAgICAwLjA1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNGUwZQogICAgIDAuMDUlICAgICAgICAgICAg
IDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0
MWMwCiAgICAgMC4wNSUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSB2ZWN0b3JsaWtlX25ieXRlcwogICAgIDAuMDMlICAgICAgICAgICAgIDEg
IGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0Mjcw
CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10g
ICAgIFtrXSBtZW1fY2dyb3VwX3BhZ2VfbHJ1dmVjCiAgICAgMC4wMyUgICAgICAgICAgICAg
MSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDRl
MjkKICAgICAwLjAzJSAgICAgICAgICAgICAxICBnbWFpbiAgICBba2VybmVsLmthbGxzeW1z
XSAgICAgW2tdIHVubWFwX3BhZ2VfcmFuZ2UKICAgICAwLjAzJSAgICAgICAgICAgICAxICBl
bWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIG1lbV9jZ3JvdXBfdHJ5X2NoYXJn
ZQogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAg
ICAgICBbLl0gYWRqdXN0X21hcmtlcnNfZm9yX2luc2VydAogICAgIDAuMDMlICAgICAgICAg
ICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA0YjM1CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5z
by40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDg0ZjAKICAgICAwLjAzJSAgICAgICAgICAg
ICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAw
N2U5MgogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAg
ICAgICAgICBbLl0ganNvbl9zdHJpbmdfdmFsdWVAcGx0CiAgICAgMC4wMyUgICAgICAgICAg
ICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfY29uZF9yZXNjaGVk
CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10g
ICAgIFtrXSBwYWdlX2V2aWN0YWJsZQogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNz
ICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0ODRiCiAgICAg
MC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsu
XSBic2V0X3JlZGlzcGxheQogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxp
YmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0YWM0CiAgICAgMC4wMyUg
ICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAw
MDAwMDAwMDAwMDQyOGIKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2Vy
bmVsLmthbGxzeW1zXSAgICAgW2tdIHBhZ2VfbWFwcGluZwogICAgIDAuMDMlICAgICAgICAg
ICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA0ODYyCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5z
by40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQxYzEKICAgICAwLjAzJSAgICAgICAgICAg
ICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGZpbmRfdm1hCiAgICAg
MC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsu
XSAweDAwMDAwMDAwMDAwMDgyOTgKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAg
ICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwN2U3OQogICAgIDAu
MDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0g
MHgwMDAwMDAwMDAwMDA0YjRlCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
W2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfX2RvX3BhZ2VfZmF1bHQKICAgICAwLjAzJSAg
ICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGNhcF9j
YXBhYmxlCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxs
c3ltc10gICAgIFtrXSB3cV93b3JrZXJfd2FraW5nX3VwCiAgICAgMC4wMyUgICAgICAgICAg
ICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSB0aW1la2VlcGluZ191
cGRhdGUKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIG1lbWNockBwbHQKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwODUxNgogICAg
IDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBb
a10gbWVtX2Nncm91cF9jb21taXRfY2hhcmdlCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQyMDAK
ICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAg
ICAgW2tdIGlkbGVfY3B1CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBtYXliZV9xdWl0CiAgICAgMC4wMyUgICAgICAgICAg
ICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBhcGljX3RpbWVyX2lu
dGVycnVwdAogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MDhkCiAgICAgMC4wMyUgICAgICAgICAg
ICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBnZXRfbWVtX2Nncm91
cF9mcm9tX21tCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nv
bi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQyZjAKICAgICAwLjAzJSAgICAgICAg
ICAgICAxICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIEZidWZmZXJfbGl2
ZV9wCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSByZWNvcmRfZGVsZXRlCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1h
Y3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ4NDAKICAg
ICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAg
W2tdIGFyY2hfZ2V0X3VubWFwcGVkX2FyZWFfdG9wZG93bgogICAgIDAuMDMlICAgICAgICAg
ICAgIDEgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBba10gdXBfcmVhZAogICAg
IDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0gMHgwMDAwMDAwMDAwMDA1NmIwCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3Mg
ICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQzMjMKICAgICAw
LjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwN2YwNAogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0M2IyCiAgICAgMC4w
MyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDQ1MmQKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDFjOQogICAgIDAuMDMl
ICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gcmVj
b3JkX3Vud2luZF9wcm90ZWN0CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
W2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfX2FjY3VtdWxhdGVfcGVsdF9zZWdtZW50cwog
ICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAg
ICBba10gcG9saWN5X25vZGUKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBb
a2VybmVsLmthbGxzeW1zXSAgICAgW2tdIHRyeV9jaGFyZ2UKICAgICAwLjAzJSAgICAgICAg
ICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIF9faGFuZGxlX21t
X2ZhdWx0CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5z
by40LjExLjAgIFsuXSBqc29uX251bGwKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGdldF90YXNrX3BvbGljeS5wYXJ0LjMw
CiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAg
ICAgIFsuXSBjb2Rpbmdfc2V0X3NvdXJjZQogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MjkwCiAg
ICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAg
IFsuXSAweDAwMDAwMDAwMDAwMDQxZjUKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGdlbmVyaWNfZmlsZV9yZWFkX2l0ZXIK
ICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwNDI3YgogICAgIDAuMDMlICAgICAgICAgICAgIDEgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGFjCiAg
ICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAg
IFsuXSAweDAwMDAwMDAwMDAwMDQ1YWUKICAgICAwLjAzJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDJkYwogICAg
IDAuMDMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0gMHgwMDAwMDAwMDAwMDA0MDkzCiAgICAgMC4wMyUgICAgICAgICAgICAgMSAgZW1hY3Mg
ICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSB3YmNfZGV0YWNoX2lub2RlCiAgICAgMC4w
MyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDg0ZjYKICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwM2MyMgogICAgIDAuMDIl
ICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA0NGEzCiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tl
cm5lbC5rYWxsc3ltc10gICAgIFtrXSBzeXNjYWxsX3JldHVybl92aWFfc3lzcmV0CiAgICAg
MC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtr
XSBjb21tb25fZmlsZV9wZXJtCiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
ZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBhZGp1c3Rfb3ZlcmxheXNfZm9yX2luc2VydAog
ICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAg
ICBba10gcmV3ZWlnaHRfZW50aXR5CiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3Mg
ICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBfX2VudHJ5X3RyYW1wb2xpbmVfc3RhcnQK
ICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwNGFiNAogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0M2UzCiAg
ICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2t2bV0gICAgICAgICAgICAgICAg
IFtrXSBwdmNsb2NrX2d0b2Rfbm90aWZ5CiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1h
Y3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBqc29uX2ludGVnZXJfdmFsdWVAcGx0
CiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjEx
LjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwNzcKICAgICAwLjAyJSAgICAgICAgICAgICAxICBl
bWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGFjY291bnRfdXNlcl90aW1lCiAg
ICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAg
IFsuXSAweDAwMDAwMDAwMDAwMDRiZWMKICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNGUzMQogICAg
IDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBb
Ll0gcmVfbWF0Y2hfMl9pbnRlcm5hbAogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNz
ICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0NWIzCiAgICAg
MC4wMiUgICAgICAgICAgICAgMSAgZ21haW4gICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtr
XSBmcmVlX3BhZ2VzX2FuZF9zd2FwX2NhY2hlCiAgICAgMC4wMiUgICAgICAgICAgICAgMSAg
ZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwNzIK
ICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEu
MCAgWy5dIDB4MDAwMDAwMDAwMDAwNDNlZAogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVt
YWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZXhlY19ieXRlX2NvZGUKICAgICAw
LjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwNDI2OAogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZTRiCiAgICAgMC4w
MiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDQ4MmMKICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDU5MwogICAgIDAuMDIl
ICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA0MGI1CiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGli
amFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDRiNzUKICAgICAwLjAyJSAg
ICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAw
MDAwMDAwMDAwNDI3NwogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmph
bnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA4OWU1CiAgICAgMC4wMiUgICAg
ICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAw
MDAwMDAwMDQ0ZTQKICAgICAwLjAyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5z
c29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDMxNAogICAgIDAuMDIlICAgICAg
ICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAw
MDAwMDA3ZTgyCiAgICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nv
bi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDg1MTIKICAgICAwLjAyJSAgICAgICAg
ICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAw
MDAwNDA3MAogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0ganNvbl9hcnJheQogICAgIDAuMDIlICAgICAgICAgICAgIDEgIGVt
YWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MzNlCiAg
ICAgMC4wMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAg
IFsuXSBsaXNwX2FsaWduX2ZyZWUKICAgICAwLjAwJSAgICAgICAgICAgICAxICBwZXJmICAg
ICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGVuZF9yZXBlYXRfbm1pCiAgICAgMC4wMCUg
ICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3ltc10gICAgIFtrXSBlbmRf
cmVwZWF0X25taQogICAgIDAuMDAlICAgICAgICAgICAgIDEgIGVtYWNzICAgIFtrZXJuZWwu
a2FsbHN5bXNdICAgICBba10gbm1pX2NwdV9iYWNrdHJhY2UKICAgICAwLjAwJSAgICAgICAg
ICAgICA2ICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIG5hdGl2ZV93cml0
ZV9tc3IKICAgICAwLjAwJSAgICAgICAgICAgICAyICBwZXJmICAgICBba2VybmVsLmthbGxz
eW1zXSAgICAgW2tdIG5hdGl2ZV93cml0ZV9tc3IKICAgICAwLjAwJSAgICAgICAgICAgICAx
ICBwZXJmICAgICBbdW5rbm93bl0gICAgICAgICAgICAgWy5dIDAwMDAwMDAwMDAwMDAwMDAK
CgojCiMgKENhbm5vdCBsb2FkIHRpcHMudHh0IGZpbGUsIHBsZWFzZSBpbnN0YWxsIHBlcmYh
KQojCg==
--------------A26DB7466EAC58753D78BC8A
Content-Type: text/x-emacs-lisp;
 name="json-test.el"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="json-test.el"

(defun test ()
  (with-temp-buffer
    (insert-file-contents "~/examples/sample-response.json")
    (goto-char (point-min))
    (json-parse-buffer)))

(let ((gc-cons-threshold most-positive-fixnum))
  (benchmark 100 '(test)))


--------------A26DB7466EAC58753D78BC8A--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 15:14:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 11:14:08 2019
Received: from localhost ([127.0.0.1]:37711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGPmi-0002b7-FE
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 11:14:08 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hGPmg-0002ag-7s
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 11:14:06 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50530)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hGPmZ-0003qW-Pa; Tue, 16 Apr 2019 11:14:00 -0400
Received: from [176.228.60.248] (port=2923 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hGPmZ-0005kn-71; Tue, 16 Apr 2019 11:13:59 -0400
Date: Tue, 16 Apr 2019 18:13:53 +0300
Message-Id: <83d0lmgez2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN> (message from
 Dmitry Gutov on Tue, 16 Apr 2019 16:50:58 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN> <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 16 Apr 2019 16:50:58 +0300
> 
> All right, my test script and results are attached. Here's how I run it:
> 
> sudo perf record -F 99 src/emacs -Q --batch -l ~/examples/elisp/json-test.el
> sudo perf report -n --stdio > perf-report.txt

Thanks.  I think we need to run this with a larger JSON, or maybe run
it several times in a loop.  Because there were too few samples in
this run, so we might see a biased picture due to overhead of stuff
that is done only once.

Also, please set gc-cons-threshold and gc-cons-percentage to very
large values, to prevent GC from biasing the profile even more.

> If you have certain recording or output format preferences, please let 
> me know.

The ASCII format is fine.

Was this an optimized build of Emacs or an unoptimized one?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 13:51:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 16 09:51:12 2019
Received: from localhost ([127.0.0.1]:36841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGOUR-0006eZ-A8
	for submit <at> debbugs.gnu.org; Tue, 16 Apr 2019 09:51:11 -0400
Received: from mail-wr1-f41.google.com ([209.85.221.41]:33561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hGOUN-0006eG-P7
 for 31138 <at> debbugs.gnu.org; Tue, 16 Apr 2019 09:51:08 -0400
Received: by mail-wr1-f41.google.com with SMTP id q1so27229935wrp.0
 for <31138 <at> debbugs.gnu.org>; Tue, 16 Apr 2019 06:51:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=t2plY+5oSc+Bn+r8ojZUaD66BuzN4nnc6pgIcliJOiY=;
 b=L6QDkLR97sz/tkJKWDr68SA9B1WwCVO4A2JJOfHY1CNBlgLcpxgKC3zF2SMf2HqYvU
 WvS98YijVcF5rBi2rd8gUp3Akfou8Y2iligoPq+NzQV7NRJxoDE6Z5pJrmwvJG5vp66i
 ZWXUlSj31yeohiCfKwhTdnVroK6cWKJ64b9SfvAYVXOFd8wG0SoUr1LDW//rgvO9xND5
 dlz505UiIaf12yvl3dX+JYeKE/EA76DRrGap+rULTyF6ujFJ40Nam62bGlrKT0RQrImG
 29zd0e5vrc7ZFJjfTlHEacU/LkbSioXarPVSDzWD7DR9MnR2GQNXMxIa0sLpVuatVozy
 NRYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language;
 bh=t2plY+5oSc+Bn+r8ojZUaD66BuzN4nnc6pgIcliJOiY=;
 b=gleZh2GUsAftiRk97qzJI9kD+Gl0DKHTveNXMLm8qGvBnx9qnQ6kCagi1POfH92kz0
 ye9TLUV73wae10RcrJ/HRdmAM/hj5le6Z5FPFpOGkFw8pJ+LFCehqWsTaTOwBTFj6u2K
 bskygTUYB1LYHvvbvRr+hv+DteLHwo9T+kSddqsiHF3sxNMRgsYek1eH1gpkk2zeXAZ3
 MFmrQM3iw06cIuR9evgLcEhA74cDjLOoLoFkOSNrRqP8UBr7MIXN1G1wGXqqwpP2O5xC
 YauN8+whoUPNf/bjdH/mWKRC2uUKJ7Vfl5chs1EOC7fHvJA/MT5R896SiXj9Epmneabk
 yQYw==
X-Gm-Message-State: APjAAAW4DStAqhDlZ0YO66hQRz7CEQQByQtvFZmbI/5fmGXz76rFyO/m
 IoGZFiBWYlpbc2SWrvX4t9PGDt0A
X-Google-Smtp-Source: APXvYqzVWwDNrYCGhdHtHSEWEZewRwqcoc8VNwjeubhGZOzWE6AuCan5SBiz+G2p7ybwlfR++57B4g==
X-Received: by 2002:adf:ea45:: with SMTP id j5mr43417664wrn.89.1555422661630; 
 Tue, 16 Apr 2019 06:51:01 -0700 (PDT)
Received: from [192.168.0.195] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id
 v192sm23943494wme.24.2019.04.16.06.50.59
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 16 Apr 2019 06:51:00 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
 <83r2a2hdxn.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <21f68973-a684-2a65-82eb-c8f3df90127f@HIDDEN>
Date: Tue, 16 Apr 2019 16:50:58 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83r2a2hdxn.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------0E4D17920164B8A5DEC0D6A5"
Content-Language: en-US
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

This is a multi-part message in MIME format.
--------------0E4D17920164B8A5DEC0D6A5
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 16.04.2019 5:38, Eli Zaretskii wrote:

>> So what should we profile? The internals of code_convert_string?
> 
> The entire run of parsing a large JSON.  code_convert_string will be
> part of the profile.

All right, my test script and results are attached. Here's how I run it:

sudo perf record -F 99 src/emacs -Q --batch -l ~/examples/elisp/json-test.el
sudo perf report -n --stdio > perf-report.txt

If you have certain recording or output format preferences, please let 
me know.

--------------0E4D17920164B8A5DEC0D6A5
Content-Type: text/x-emacs-lisp;
 name="json-test.el"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="json-test.el"

(defun test ()
  (with-temp-buffer
    (insert-file-contents "~/examples/sample-response.json")
    (goto-char (point-min))
    (json-parse-buffer)))

(benchmark 10 '(test))


--------------0E4D17920164B8A5DEC0D6A5
Content-Type: text/plain; charset=UTF-8;
 name="perf-report.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="perf-report.txt"

IyBUbyBkaXNwbGF5IHRoZSBwZXJmLmRhdGEgaGVhZGVyIGluZm8sIHBsZWFzZSB1c2UgLS1o
ZWFkZXIvLS1oZWFkZXItb25seSBvcHRpb25zLgojCiMKIyBUb3RhbCBMb3N0IFNhbXBsZXM6
IDAKIwojIFNhbXBsZXM6IDQ0MyAgb2YgZXZlbnQgJ2N5Y2xlczpwcHAnCiMgRXZlbnQgY291
bnQgKGFwcHJveC4pOiAxMzM4Nzg2NDY5MAojCiMgT3ZlcmhlYWQgICAgICAgU2FtcGxlcyAg
Q29tbWFuZCAgU2hhcmVkIE9iamVjdCAgICAgICAgIFN5bWJvbCAgICAgICAgICAgICAgICAg
ICAgICAgICAgCiMgLi4uLi4uLi4gIC4uLi4uLi4uLi4uLiAgLi4uLi4uLiAgLi4uLi4uLi4u
Li4uLi4uLi4uLi4gIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uCiMKICAgICA2
LjIwJSAgICAgICAgICAgIDI3ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5d
IGRlY29kZV9jb2RpbmdfdXRmXzgKICAgICA0LjY3JSAgICAgICAgICAgIDIxICBlbWFjcyAg
ICBsaWJjLTIuMjcuc28gICAgICAgICAgWy5dIG1hbGxvY19jb25zb2xpZGF0ZQogICAgIDQu
MzElICAgICAgICAgICAgMTkgIGVtYWNzICAgIGxpYmMtMi4yNy5zbyAgICAgICAgICBbLl0g
X19tZW1tb3ZlX2F2eF91bmFsaWduZWRfZXJtcwogICAgIDMuOTMlICAgICAgICAgICAgMTcg
IGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gcHJvZHVjZV9jaGFycwogICAg
IDMuMzAlICAgICAgICAgICAgMTUgIGVtYWNzICAgIGxpYmMtMi4yNy5zbyAgICAgICAgICBb
Ll0gbWFsbG9jCiAgICAgMy4yNSUgICAgICAgICAgICAxNSAgZW1hY3MgICAgbGliYy0yLjI3
LnNvICAgICAgICAgIFsuXSBfaW50X21hbGxvYwogICAgIDIuOTUlICAgICAgICAgICAgMTMg
IGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gc3RvcmVfc3ltdmFsX2Zvcndh
cmRpbmcKICAgICAyLjc4JSAgICAgICAgICAgIDEyICBlbWFjcyAgICBsaWJjLTIuMjcuc28g
ICAgICAgICAgWy5dIGNmcmVlQEdMSUJDXzIuMi41CiAgICAgMi43NSUgICAgICAgICAgICAx
MiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBqc29uX3RvX2xpc3AKICAg
ICAyLjcwJSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAg
W2tdIHN5bmNfcmVncwogICAgIDIuMzclICAgICAgICAgICAgMTIgIGVtYWNzICAgIGVtYWNz
ICAgICAgICAgICAgICAgICBbLl0gbWFya19vYmplY3QKICAgICAyLjA4JSAgICAgICAgICAg
ICA5ICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIHNldF9idWZmZXJfaW50
ZXJuYWxfMgogICAgIDIuMDclICAgICAgICAgICAgIDkgIGVtYWNzICAgIGVtYWNzICAgICAg
ICAgICAgICAgICBbLl0gbWFrZV91bmluaXRfbXVsdGlieXRlX3N0cmluZwogICAgIDIuMDYl
ICAgICAgICAgICAgIDkgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gc3dh
cF9pbl9zeW12YWxfZm9yd2FyZGluZwogICAgIDIuMDYlICAgICAgICAgICAgIDkgIGVtYWNz
ICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZG9fc3ltdmFsX2ZvcndhcmRpbmcKICAg
ICAxLjkxJSAgICAgICAgICAgIDEwICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAg
Wy5dIHN3ZWVwX3N0cmluZ3MKICAgICAxLjU1JSAgICAgICAgICAgICA4ICBlbWFjcyAgICBl
bWFjcyAgICAgICAgICAgICAgICAgWy5dIGRldGVjdF9jb2RpbmcKICAgICAxLjQ0JSAgICAg
ICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGVycm9yX2Vu
dHJ5CiAgICAgMS4zNiUgICAgICAgICAgICAgNyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSBkZXRlY3RfY29kaW5nX3V0Zl84CiAgICAgMS4zNiUgICAgICAgICAgICAg
NiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBoYXNoX2xvb2t1cAogICAg
IDEuMzQlICAgICAgICAgICAgIDcgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBb
Ll0gYm95ZXJfbW9vcmUKICAgICAxLjE2JSAgICAgICAgICAgICA1ICBlbWFjcyAgICBsaWJq
YW5zc29uLnNvLjQuMTEuMCAgWy5dIGpzb25fZGVsZXRlCiAgICAgMS4xNCUgICAgICAgICAg
ICAgNSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBhbGxvY2F0ZV92ZWN0
b3JsaWtlCiAgICAgMS4xMyUgICAgICAgICAgICAgNSAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBhZGp1c3Rfc3VzcGVuZF9hdXRvX2hzY3JvbGwKICAgICAxLjA4JSAg
ICAgICAgICAgICA1ICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAw
MDAwMDAwMDAwN2Y0MAogICAgIDAuOTQlICAgICAgICAgICAgIDQgIGVtYWNzICAgIGVtYWNz
ICAgICAgICAgICAgICAgICBbLl0gaW5zZXJ0X2Zyb21fZ2FwCiAgICAgMC45MSUgICAgICAg
ICAgICAgNCAgZW1hY3MgICAgbGliYy0yLjI3LnNvICAgICAgICAgIFsuXSBfX21lbWNocl9h
dngyCiAgICAgMC44OSUgICAgICAgICAgICAgNCAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSBhbGxvY2F0ZV92ZWN0b3IKICAgICAwLjg4JSAgICAgICAgICAgICA0ICBl
bWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDFmMAog
ICAgIDAuODQlICAgICAgICAgICAgIDQgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4w
ICBbLl0gMHgwMDAwMDAwMDAwMDA0NGNmCiAgICAgMC43MSUgICAgICAgICAgICAgMyAgZW1h
Y3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDdmMWYKICAg
ICAwLjcwJSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAg
Wy5dIGpzb25fYXJyYXlfZ2V0CiAgICAgMC43MCUgICAgICAgICAgICAgMyAgZW1hY3MgICAg
ZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBtYWtlX2J1ZmZlcl9zdHJpbmdfYm90aAogICAg
IDAuNjklICAgICAgICAgICAgIDMgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBb
Ll0gRmN1cnJlbnRfYnVmZmVyCiAgICAgMC42OSUgICAgICAgICAgICAgMyAgZW1hY3MgICAg
ZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBtZW1faW5zZXJ0CiAgICAgMC42OSUgICAgICAg
ICAgICAgMyAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSBqc29uX3N0cmlu
Z192YWx1ZQogICAgIDAuNjglICAgICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MWVjCiAgICAgMC42NyUgICAgICAgICAg
ICAgMyAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBGbmV4dF9wcm9wZXJ0
eV9jaGFuZ2UKICAgICAwLjY3JSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJqYW5zc29u
LnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDFkYwogICAgIDAuNjYlICAgICAgICAg
ICAgIDMgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZGVjb2RlX2NvZGlu
ZwogICAgIDAuNjYlICAgICAgICAgICAgIDMgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAg
ICAgICBbLl0ganNvbl9tYWxsb2MKICAgICAwLjY1JSAgICAgICAgICAgICAzICBlbWFjcyAg
ICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDFmNwogICAgIDAu
NjMlICAgICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0g
MHgwMDAwMDAwMDAwMDA0MWU0CiAgICAgMC42MyUgICAgICAgICAgICAgMyAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwOTYKICAgICAwLjYy
JSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGtt
ZW1fY2FjaGVfYWxsb2MKICAgICAwLjYyJSAgICAgICAgICAgICAzICBlbWFjcyAgICBsaWJq
YW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwN2U4OQogICAgIDAuNjElICAg
ICAgICAgICAgIDMgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAw
MDAwMDAwMDA0MGUwCiAgICAgMC40NyUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1hY3Mg
ICAgICAgICAgICAgICAgIFsuXSBpbnZhbGlkYXRlX2J1ZmZlcl9jYWNoZXMKICAgICAwLjQ3
JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGFs
bG9jYXRlX3N0cmluZ19kYXRhCiAgICAgMC40NiUgICAgICAgICAgICAgMiAgZW1hY3MgICAg
ZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBkZWxfcmFuZ2VfMgogICAgIDAuNDYlICAgICAg
ICAgICAgIDIgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gYXNzcV9ub19x
dWl0CiAgICAgMC40NiUgICAgICAgICAgICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSBjb2RlX2NvbnZlcnRfc3RyaW5nCiAgICAgMC40NiUgICAgICAgICAgICAg
MiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBtYWtlX3NwZWNpZmllZF9z
dHJpbmcKICAgICAwLjQ2JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBhNAogICAgIDAuNDYlICAgICAgICAgICAg
IDIgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gRm1ha2VfbG9jYWxfdmFy
aWFibGUKICAgICAwLjQ2JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAg
ICAgICAgICAgWy5dIEZ3aWRlbgogICAgIDAuNDUlICAgICAgICAgICAgIDIgIGVtYWNzICAg
IGVtYWNzICAgICAgICAgICAgICAgICBbLl0gZGVjb2RlX2NvZGluZ19vYmplY3QKICAgICAw
LjQ1JSAgICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwM2MxZgogICAgIDAuNDQlICAgICAgICAgICAgIDIgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MGM1CiAgICAgMC40
MyUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAw
eDAwMDAwMDAwMDAwMDQwYmMKICAgICAwLjQzJSAgICAgICAgICAgICAyICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDA3NAogICAgIDAuNDIl
ICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgw
MDAwMDAwMDAwMDA3ZjUzCiAgICAgMC40MiUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGli
amFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQwY2EKICAgICAwLjQxJSAg
ICAgICAgICAgICAyICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAw
MDAwMDAwMDAwNDA4YQogICAgIDAuNDElICAgICAgICAgICAgIDIgIGVtYWNzICAgIGVtYWNz
ICAgICAgICAgICAgICAgICBbLl0gbWFsbG9jQHBsdAogICAgIDAuNDElICAgICAgICAgICAg
IDIgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0
MDllCiAgICAgMC40MCUgICAgICAgICAgICAgMiAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40
LjExLjAgIFsuXSBqc29uX2FycmF5X2FwcGVuZF9uZXcKICAgICAwLjQwJSAgICAgICAgICAg
ICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIHBkdW1wZXJfbWFya2Vk
X3BfaW1wbAogICAgIDAuMzklICAgICAgICAgICAgIDIgIGVtYWNzICAgIGxpYmphbnNzb24u
c28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA4MjkzCiAgICAgMC4zNyUgICAgICAgICAg
ICAgMiAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBzd2VlcF9jb25zZXMK
ICAgICAwLjM3JSAgICAgICAgICAgICAyICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAg
ICAgWy5dIHN3ZWVwX3ZlY3RvcnMKICAgICAwLjIzJSAgICAgICAgICAgICAxICBlbWFjcyAg
ICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDNjOQogICAgIDAu
MjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0g
ZnJlZUBwbHQKICAgICAwLjIzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBlbWFjcyAgICAg
ICAgICAgICAgICAgWy5dIGpzb25fYXJyYXlfc2l6ZUBwbHQKICAgICAwLjIzJSAgICAgICAg
ICAgICAxICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIEZhc3NxCiAgICAg
MC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsu
XSBGY29ucwogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAg
ICAgICAgICAgICBbLl0gbWFrZV92ZWN0b3IKICAgICAwLjIzJSAgICAgICAgICAgICAxICBl
bWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGRvX29uZV91bmJpbmQuY29uc3Rw
cm9wLjI0CiAgICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBoYXNoZm5fZXEKICAgICAwLjIzJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIGpzb25fYXJyYXlfZ2V0QHBsdAogICAg
IDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBb
Ll0gMHgwMDAwMDAwMDAwMDA0MGRmCiAgICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3Mg
ICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBjb2RlX2NvbnZlcnNpb25fc2F2ZQogICAg
IDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIFtrZXJuZWwua2FsbHN5bXNdICAgICBb
a10gcmN1X25taV9lbnRlcgogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxp
YmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA3ZTgyCiAgICAgMC4yMyUg
ICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBzZXRf
YnVmZmVyX2ludGVybmFsXzEKICAgICAwLjIzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBs
aWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIGpzb25faW50ZWdlcl92YWx1ZQogICAgIDAuMjMl
ICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0ganNv
bl9mcmVlCiAgICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBzZXR1cF9jb2Rpbmdfc3lzdGVtCiAgICAgMC4yMyUgICAgICAgICAg
ICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAw
MDdlN2QKICAgICAwLjIzJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNv
LjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwODI5MAogICAgIDAuMjMlICAgICAgICAgICAg
IDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAgICBbLl0gcmVjb3JkX2luc2VydAog
ICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAgICAgICAgICAgICAg
ICBbLl0gc2V0X2ludGVybmFsCiAgICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQyZTQKICAgICAwLjIz
JSAgICAgICAgICAgICAxICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIG1l
bV9jZ3JvdXBfdHJ5X2NoYXJnZQogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MWQwCiAgICAgMC4y
MyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSB2
YWxpZGF0ZV9pbnRlcnZhbF9yYW5nZQogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNz
ICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0NGU3CiAgICAg
MC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsu
XSBqc29uX21ha2Vfc3RyaW5nCiAgICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ4M2IKICAgICAwLjIz
JSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwNDI2MAogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxp
YmMtMi4yNy5zbyAgICAgICAgICBbLl0gX19HSV9fX19fc3RydG9sbF9sX2ludGVybmFsCiAg
ICAgMC4yMyUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAg
IFsuXSBkZWxfcmFuZ2VfMQogICAgIDAuMjMlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxp
YmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MzE0CiAgICAgMC4yMiUg
ICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBjb2Rp
bmdfc2V0X2Rlc3RpbmF0aW9uCiAgICAgMC4yMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDRiODAKICAgICAwLjIy
JSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwN2YzMwogICAgIDAuMjIlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxp
YmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MDdjCiAgICAgMC4yMiUg
ICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAw
MDAwMDAwMDAwMDQwZDEKICAgICAwLjIyJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJq
YW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBlNwogICAgIDAuMjIlICAg
ICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAw
MDAwMDAwMDA0MDkxCiAgICAgMC4yMiUgICAgICAgICAgICAgMSAgZW1hY3MgICAgbGliamFu
c3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ4NDcKICAgICAwLjIxJSAgICAg
ICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAw
MDAwMDAwNDBjMAogICAgIDAuMjElICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNz
b24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0ZTBlCiAgICAgMC4yMSUgICAgICAg
ICAgICAgMSAgZW1hY3MgICAgbGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAw
MDAwMDdlNzQKICAgICAwLjIxJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29u
LnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwN2Y0ZQogICAgIDAuMjElICAgICAgICAg
ICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAw
MDA0MjZhCiAgICAgMC4yMSUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAg
ICAgICAgICAgIFsuXSBiYWxhbmNlX2ludGVydmFscwogICAgIDAuMjElICAgICAgICAgICAg
IDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0
MjkwCiAgICAgMC4yMSUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAg
ICAgICAgIFsuXSB1bmJpbmRfdG8KICAgICAwLjIxJSAgICAgICAgICAgICAxICBlbWFjcyAg
ICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4MDAwMDAwMDAwMDAwNDBkYgogICAgIDAu
MjAlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0g
MHgwMDAwMDAwMDAwMDA0MGIxCiAgICAgMC4yMCUgICAgICAgICAgICAgMSAgZW1hY3MgICAg
bGliamFuc3Nvbi5zby40LjExLjAgIFsuXSAweDAwMDAwMDAwMDAwMDQ4NTQKICAgICAwLjIw
JSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5dIDB4
MDAwMDAwMDAwMDAwNDQ2ZQogICAgIDAuMjAlICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVt
YWNzICAgICAgICAgICAgICAgICBbLl0gcGR1bXBlcl9zZXRfbWFya2VkX2ltcGwKICAgICAw
LjIwJSAgICAgICAgICAgICAxICBlbWFjcyAgICBsaWJqYW5zc29uLnNvLjQuMTEuMCAgWy5d
IDB4MDAwMDAwMDAwMDAwNDUyZAogICAgIDAuMjAlICAgICAgICAgICAgIDEgIGVtYWNzICAg
IGxpYmphbnNzb24uc28uNC4xMS4wICBbLl0gMHgwMDAwMDAwMDAwMDA0MjcxCiAgICAgMC4y
MCUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1hY3MgICAgICAgICAgICAgICAgIFsuXSBt
ZW1fZmluZC5wYXJ0LjIwCiAgICAgMC4xOSUgICAgICAgICAgICAgMSAgZW1hY3MgICAgZW1h
Y3MgICAgICAgICAgICAgICAgIFsuXSBtZW1fZGVsZXRlLnBhcnQuMjgKICAgICAwLjE4JSAg
ICAgICAgICAgICAxICBlbWFjcyAgICBlbWFjcyAgICAgICAgICAgICAgICAgWy5dIG1hcmtf
dmVjdG9ybGlrZQogICAgIDAuMTglICAgICAgICAgICAgIDEgIGVtYWNzICAgIGVtYWNzICAg
ICAgICAgICAgICAgICBbLl0gdmVjdG9ybGlrZV9uYnl0ZXMKICAgICAwLjAwJSAgICAgICAg
ICAgICAxICBwZXJmICAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIGVuZF9yZXBlYXRf
bm1pCiAgICAgMC4wMCUgICAgICAgICAgICAgMSAgZW1hY3MgICAgW2tlcm5lbC5rYWxsc3lt
c10gICAgIFtrXSBuYXRpdmVfc2NoZWRfY2xvY2sKICAgICAwLjAwJSAgICAgICAgICAgICAz
ICBwZXJmICAgICBba2VybmVsLmthbGxzeW1zXSAgICAgW2tdIG5hdGl2ZV93cml0ZV9tc3IK
ICAgICAwLjAwJSAgICAgICAgICAgICAyICBlbWFjcyAgICBba2VybmVsLmthbGxzeW1zXSAg
ICAgW2tdIG5hdGl2ZV93cml0ZV9tc3IKICAgICAwLjAwJSAgICAgICAgICAgICAxICBlbWFj
cyAgICBbdW5rbm93bl0gICAgICAgICAgICAgWy5dIDAwMDAwMDAwMDAwMDAwMDAKCgojCiMg
KENhbm5vdCBsb2FkIHRpcHMudHh0IGZpbGUsIHBsZWFzZSBpbnN0YWxsIHBlcmYhKQojCg==
--------------0E4D17920164B8A5DEC0D6A5--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 02:38:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 22:38:58 2019
Received: from localhost ([127.0.0.1]:36062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGDzu-0004N7-5m
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2019 22:38:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37186)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hGDzr-0004Mu-W5
 for 31138 <at> debbugs.gnu.org; Mon, 15 Apr 2019 22:38:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40507)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hGDzm-0006TF-Du; Mon, 15 Apr 2019 22:38:50 -0400
Received: from [176.228.60.248] (port=4233 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hGDzl-0007Y5-Uv; Mon, 15 Apr 2019 22:38:50 -0400
Date: Tue, 16 Apr 2019 05:38:44 +0300
Message-Id: <83r2a2hdxn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN> (message from
 Dmitry Gutov on Tue, 16 Apr 2019 04:36:43 +0300)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN> <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, yyoncho@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Tue, 16 Apr 2019 04:36:43 +0300
> 
> On 26.03.2019 18:14, Eli Zaretskii wrote:
> > I think we should only consider this after we profile JSON parsing and
> > see which parts take the most processing time.
> 
> What is our next step here?
> 
> I have tried out the comparison (with and without code_convert_string) 
> on my own JSON data, and the results are similar: 6MB JSON is parsed in 
> ~0.48s by default, and in ~0.21s with that call removed.
> 
> The JSON parsing is not the biggest bottleneck in my particular case, 
> but it would be nice to speed it up anyway.
> 
> So what should we profile? The internals of code_convert_string?

The entire run of parsing a large JSON.  code_convert_string will be
part of the profile.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 16 Apr 2019 01:36:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 21:36:56 2019
Received: from localhost ([127.0.0.1]:36003 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGD1r-0002ui-WE
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2019 21:36:56 -0400
Received: from mail-lj1-f182.google.com ([209.85.208.182]:40143)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1hGD1q-0002uV-1P
 for 31138 <at> debbugs.gnu.org; Mon, 15 Apr 2019 21:36:54 -0400
Received: by mail-lj1-f182.google.com with SMTP id q66so2406984ljq.7
 for <31138 <at> debbugs.gnu.org>; Mon, 15 Apr 2019 18:36:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=l4M73o7tg9uwg5JgLOftIDYj4SWtPAYdBKtKplOKUbg=;
 b=AIXKPa/+HOkMAbSg8oGn0bxNMkRpcx7yNNaZokUWoELVP1u7v/HcIIjvaYPg2GQ6lc
 3WhSLQcAAH0LW9SAX779FQiHwZMpSdi+16YOC27BV82j6Js1kyYPiqEjsGSmKOLLNmK6
 u6c6DEO6R/UW9tPE+kO8n+elS99jj+BNC4ovtf7XcXBqqFFI1wY8f2Fc7ghqKw5BgHkq
 LedgblUjgD2hTIcvtFVLRHFc9DKD0MJnXvdWL/WrMJlbTMkNw12pDBlHve0ZwPrhDJkj
 E5xnN8M6pdn53hnrQeVpXQVzPrR3Ehip5KBQ3sn5FsbGXr+e2pDo1MVMqXjqTCtf4D2r
 vXng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=l4M73o7tg9uwg5JgLOftIDYj4SWtPAYdBKtKplOKUbg=;
 b=rQgikdGkskvca0DjFhR5hzOKNKSYuMJTKxpL4C5ggJ18toDfuQbU0hic7wnzfQ/Y5R
 l6zmnS6FTlcqeseh5a23XELVKtdjYFyAVLiJEJ1RODlJELIBcY+bIYFZAEUAjQs8VjEi
 V+QmwWJ3ltYo8L6kjEKYA3LMv9YA8uy4DlRKYjUDAFe3sfiXAM4otNIgwztguBAHI0Bm
 tXIfxfdFIEBIa/U0nHFxo+mguaD/REbvijsNLRklidqwWAucOkPjnUDUNm8uxcHzEQRn
 EPEjvKv65tB/d0DNToDzQUUISeTuIkS4OHF+Q//gZ5b6xkNWbBr5BqwiCZxEZtK7IfBA
 +CxQ==
X-Gm-Message-State: APjAAAVn6Lf+06s0sa3KVZydr3Ko+o7CFgHtTLnPYTIZGVdBC7xenlGs
 lHzVXMghtxwJtEAb6mndx1xnAvHc
X-Google-Smtp-Source: APXvYqyx363C5kkKxLhcd/j6u/IrL8mIWG8mNkHaz7+6y9fmo9MJl82y+I90mJ94qneEfUvK76S66g==
X-Received: by 2002:a2e:86c7:: with SMTP id n7mr18602702ljj.44.1555378607681; 
 Mon, 15 Apr 2019 18:36:47 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id c7sm10905427lja.90.2019.04.15.18.36.45
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 15 Apr 2019 18:36:46 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>, yyoncho <yyoncho@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <181b93a3-3861-0481-1b95-8344410d1049@HIDDEN>
Date: Tue, 16 Apr 2019 04:36:43 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <83zhphliil.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Eli,

On 26.03.2019 18:14, Eli Zaretskii wrote:
> I think we should only consider this after we profile JSON parsing and
> see which parts take the most processing time.

What is our next step here?

I have tried out the comparison (with and without code_convert_string) 
on my own JSON data, and the results are similar: 6MB JSON is parsed in 
~0.48s by default, and in ~0.21s with that call removed.

The JSON parsing is not the biggest bottleneck in my particular case, 
but it would be nice to speed it up anyway.

So what should we profile? The internals of code_convert_string?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 30 Mar 2019 09:07:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 30 05:07:48 2019
Received: from localhost ([127.0.0.1]:36233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hA9xs-0001If-6l
	for submit <at> debbugs.gnu.org; Sat, 30 Mar 2019 05:07:48 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51687)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hA9xq-0001IS-C8
 for 31138 <at> debbugs.gnu.org; Sat, 30 Mar 2019 05:07:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36446)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hA9xk-00030n-Me; Sat, 30 Mar 2019 05:07:40 -0400
Received: from [176.228.60.248] (port=2263 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hA9xi-0000Wg-BC; Sat, 30 Mar 2019 05:07:40 -0400
Date: Sat, 30 Mar 2019 12:07:40 +0300
Message-Id: <83wokgivc3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 20:20:57 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 20:20:57 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> The patch seems to be addressing the hooks related issue. 

OK, I've now pushed the change, with a different way of avoiding the
calls to the hooks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 18:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 26 14:15:40 2019
Received: from localhost ([127.0.0.1]:60533 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8qbs-0001xx-76
	for submit <at> debbugs.gnu.org; Tue, 26 Mar 2019 14:15:40 -0400
Received: from mail-qk1-f171.google.com ([209.85.222.171]:34378)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8qbq-0001xk-KG
 for 31138 <at> debbugs.gnu.org; Tue, 26 Mar 2019 14:15:39 -0400
Received: by mail-qk1-f171.google.com with SMTP id n68so8258776qka.1
 for <31138 <at> debbugs.gnu.org>; Tue, 26 Mar 2019 11:15:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=i6+jfEz/hLKflmPFtrzXpl5bI6DovDqL+yWztulUKMI=;
 b=QX50tcAE4xuQqSoFg2QrTnSluCa8uBBTvuthWjD32lgx2B2ZEx2w685K0TKdEfM9Cl
 uWtXlAip19VBTF0JkBvcEzbHag9IolCWcG3j4b8eUzw3/qLJthehj2LOgpxnUF7rjB5T
 MwuZ5C8zRCfbOpNfuYdvoE6daMIXV+D88FI6le9vT5dMQhQZeqTRRbjFuSoiehteObMS
 RjRGos4mR0b7OW+l98OwXOAPL5AuEnDzpjxaJzND2TNVWe7q2pYGToNKEteJPX+FUAR4
 lMgyyGR3tqljHXnKwxjtkeOuCPWRlxyomBq5+37oMpYTiSo5vL0tkmFTUMI+eG8W6itJ
 9OkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=i6+jfEz/hLKflmPFtrzXpl5bI6DovDqL+yWztulUKMI=;
 b=YMA3lOa9lMPjRpMD1izF2kjAgo2QP6M2CL+ggR7dNUVuI9oyyvvehx/CiFM9jHXERs
 IYHpZvCteCukPW7M9oZu7DiGB6jKN/7wZWyUTwxEJin//O6BXOxRoL7h0vk42I2rZTt8
 wrRrC6m3PlSY5s8gV2r/sa5lENS43PDdS5YYSswtM9heXNOHWqFv/37F00S+cnnQ3fj9
 gPGvpzTgVZWM5dogd2NAIc/1mAGB0rWzrhvPMUoP/eFnO+hHMXfPHFADtIyTotjjv1Zs
 4Z2jATrZIfZ8E+f8Gt6VIIxfUiNYYGzkXStHGF0nDDxJ57nxwL6TS21LvVA8hHfuZSQH
 bf4Q==
X-Gm-Message-State: APjAAAXK0G0K2ns7Js231/pTeXVNJczFLXy99rNuROvcYGE1mdcExdsB
 zQ7yMSLwMG3DaoeFzgxlUD7Vc/X234J6fm1ISkI=
X-Google-Smtp-Source: APXvYqzjjuTkLRYcIv9yUMlQhC1kb6YIERWN3o3OofzVFRO/KY3ZcgO2oMUl1gcImoAOCewPyTsdW6Prp5hVY3GtFUs=
X-Received: by 2002:a37:5246:: with SMTP id g67mr24342812qkb.118.1553624133033; 
 Tue, 26 Mar 2019 11:15:33 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
 <CACCVLQU5v0naHhGZq3ULjZ3diB6e52-05LZStj9m3Axp0YrHxA@HIDDEN>
 <83o95xld3n.fsf@HIDDEN>
In-Reply-To: <83o95xld3n.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 26 Mar 2019 20:15:21 +0200
Message-ID: <CACCVLQWf4zdw+3FtiwQUd5LkNN6mOQKRwKn=FcmienbZeG_vpA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000009063de0585034ed0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000009063de0585034ed0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Here it is
https://gist.githubusercontent.com/yyoncho/dec968b69185305ed02741e18b27a82d=
/raw/334b0a51bc52cc3c98edb8ff4bccb5fc4531842b/large.json

Thanks,
Ivan

On Tue, Mar 26, 2019 at 8:11 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Tue, 26 Mar 2019 19:45:38 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > I think I get similar results.
> >
> > * ~5mb/s for ~500b message
> > * ~15mb/s for ~850kb message
> >
> > So it is like ~500ms for 10mb.
>
> But that only makes sense if close to 100% of JSON is strings.  Is
> that really so?  Can I see an example of such a JSON?
>

--0000000000009063de0585034ed0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Here it is=C2=A0<a href=3D"https://gist.g=
ithubusercontent.com/yyoncho/dec968b69185305ed02741e18b27a82d/raw/334b0a51b=
c52cc3c98edb8ff4bccb5fc4531842b/large.json">https://gist.githubusercontent.=
com/yyoncho/dec968b69185305ed02741e18b27a82d/raw/334b0a51bc52cc3c98edb8ff4b=
ccb5fc4531842b/large.json</a></div><div dir=3D"ltr"><br></div><div>Thanks,<=
br></div><div>Ivan</div></div><br><div class=3D"gmail_quote"><div dir=3D"lt=
r" class=3D"gmail_attr">On Tue, Mar 26, 2019 at 8:11 PM Eli Zaretskii &lt;<=
a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=
=3D"mailto:yyoncho@HIDDEN" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<b=
r>
&gt; Date: Tue, 26 Mar 2019 19:45:38 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; I think I get similar results.<br>
&gt; <br>
&gt; * ~5mb/s for ~500b message<br>
&gt; * ~15mb/s for ~850kb message<br>
&gt; <br>
&gt; So it is like ~500ms for 10mb.<br>
<br>
But that only makes sense if close to 100% of JSON is strings.=C2=A0 Is<br>
that really so?=C2=A0 Can I see an example of such a JSON?<br>
</blockquote></div>

--0000000000009063de0585034ed0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 18:11:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 26 14:11:58 2019
Received: from localhost ([127.0.0.1]:60524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8qYI-0001rf-AM
	for submit <at> debbugs.gnu.org; Tue, 26 Mar 2019 14:11:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8qYG-0001rT-Oo
 for 31138 <at> debbugs.gnu.org; Tue, 26 Mar 2019 14:11:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59355)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8qYB-00056V-89; Tue, 26 Mar 2019 14:11:51 -0400
Received: from [176.228.60.248] (port=2727 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8qY9-00038t-VR; Tue, 26 Mar 2019 14:11:50 -0400
Date: Tue, 26 Mar 2019 20:11:56 +0200
Message-Id: <83o95xld3n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQU5v0naHhGZq3ULjZ3diB6e52-05LZStj9m3Axp0YrHxA@HIDDEN>
 (message from yyoncho on Tue, 26 Mar 2019 19:45:38 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
 <CACCVLQU5v0naHhGZq3ULjZ3diB6e52-05LZStj9m3Axp0YrHxA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Tue, 26 Mar 2019 19:45:38 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> I think I get similar results.
> 
> * ~5mb/s for ~500b message
> * ~15mb/s for ~850kb message
> 
> So it is like ~500ms for 10mb.

But that only makes sense if close to 100% of JSON is strings.  Is
that really so?  Can I see an example of such a JSON?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 17:45:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 26 13:45:58 2019
Received: from localhost ([127.0.0.1]:60520 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8q98-0001Fv-1K
	for submit <at> debbugs.gnu.org; Tue, 26 Mar 2019 13:45:58 -0400
Received: from mail-qt1-f179.google.com ([209.85.160.179]:37231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8q96-0001Fj-AB
 for 31138 <at> debbugs.gnu.org; Tue, 26 Mar 2019 13:45:56 -0400
Received: by mail-qt1-f179.google.com with SMTP id z16so15645078qtn.4
 for <31138 <at> debbugs.gnu.org>; Tue, 26 Mar 2019 10:45:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=K+0H0KdhwximK++onvydOOoigxgc7rZpGFMc1/+GG8M=;
 b=AsOJUjiJA5RslfA76/5XPenbCFa2+usHRvMwPp+8r9E38ndYClBRNEJkdB+ftZ2BKS
 eobA4ik9tgc8dlky71zm2kNamOEZXZrqc5HrA64NN77NLFt+ixFs3kkHBoZLQT30OXtL
 j/zr4V8hJlz8zm2Gou2goiSAOC43nw7DE4B6wDuib+ydFO/Nl9Q/RDgUowlLUFUtTNa/
 /uuYhinImIxv7yyjRjafU9GOSA61fz0AFNrfs+VYoCLYUNRziYWDlJ7Vt0yqRpsfz60Z
 cUIZ+Kj4No2YZHAxNzJw+yFh4HuoB6g0ezSn/PYlzw4sqSY7sZcVke500kDQ33CJ+COK
 Gj7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=K+0H0KdhwximK++onvydOOoigxgc7rZpGFMc1/+GG8M=;
 b=kWaa8IDZ+fGD3PSU5LjeCrDccDsu72nS1F7TdOury5P8iDD2Ksk5vx7G67Y11k62di
 FSlwK+oNNBsX9r85vTKEHkeU+0eBL/7yqh4berEiW/OvJWeCK/imeaXqOWrMn+kanbMZ
 C4jbDGQyEoiMUbHYhvddQC2udQ4EgCHDn6KxCnTTFZZGNaLAUq1H/UsDDenlcOWwRvXL
 qInKMgvywwv5/2TH41O3vm9ws1kZ96RwOkfAiQ6260xK+UyIZNsQ7lNejYjcisoMRmeq
 gCr84RXkSrHAGZzMUGIc9eULcE+UhpTli/UpR6uoj1q0rlB0byjRaPllCaORx/O511Eh
 rI9Q==
X-Gm-Message-State: APjAAAUqi6pjra6360AJFIjNXI6RKcQ4GNGfIovqRb3FW4Pg4xtnL6/1
 K10O343qSnrm9hbC/AS29BP1g439nggaW9AnbsU=
X-Google-Smtp-Source: APXvYqyXbU5KU+wgChPaOHSy0GepZkptdKeLj2EmUU3WwN/foOZTXe49KjVoysxyq/avxGD7ctXa7GHi88g13I/NzJU=
X-Received: by 2002:a0c:89f3:: with SMTP id 48mr27363650qvs.215.1553622350633; 
 Tue, 26 Mar 2019 10:45:50 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 <83zhphliil.fsf@HIDDEN>
In-Reply-To: <83zhphliil.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Tue, 26 Mar 2019 19:45:38 +0200
Message-ID: <CACCVLQU5v0naHhGZq3ULjZ3diB6e52-05LZStj9m3Axp0YrHxA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000531d37058502e47b"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000531d37058502e47b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

I think I get similar results.

* ~5mb/s for ~500b message
* ~15mb/s for ~850kb message

So it is like ~500ms for 10mb.

Thanks,
Ivan


On Tue, Mar 26, 2019 at 6:14 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Mon, 25 Mar 2019 23:34:38 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > 3. Even in the best case scenario native parsing is not fast enough. In
> lsp-mode, you might receive 3.5mb
> > json as a server-side response while you are typing. E. g. I might type
> "abc" and get 10.5 mb json.
>
> What kind of throughput do you get with native JSON parsing when you
> submit a 10MB JSON to it?  My testing indicates that decoding strings
> by UTF-8 runs at about 50 msec per MByte for short strings, and about
> 4 times faster for very large strings.  How does this compare with the
> overall time for processing a 10MB JSON?
>
> > Alternatively, we (lsp-mode team) will be able to solve all these in a
> dynamic module if emacs module
> > mechanism is extended to allow creating emacs lisp structures
> efficiently.
>
> I think we should only consider this after we profile JSON parsing and
> see which parts take the most processing time.
>

--000000000000531d37058502e47b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Eli,<div><br></div><div>I think I get similar results.<=
/div><div><br></div><div>* ~5mb/s for ~500b message</div><div>* ~15mb/s for=
 ~850kb message<br></div><div><br></div><div>So it is like ~500ms for 10mb.=
</div><div><br></div><div>Thanks,<br></div><div>Ivan</div><div><br></div></=
div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On=
 Tue, Mar 26, 2019 at 6:14 PM Eli Zaretskii &lt;<a href=3D"mailto:eliz@gnu.=
org" target=3D"_blank">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mailto=
:yyoncho@HIDDEN" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Mon, 25 Mar 2019 23:34:38 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; 3. Even in the best case scenario native parsing is not fast enough. I=
n lsp-mode, you might receive 3.5mb<br>
&gt; json as a server-side response while you are typing. E. g. I might typ=
e &quot;abc&quot; and get 10.5 mb json.<br>
<br>
What kind of throughput do you get with native JSON parsing when you<br>
submit a 10MB JSON to it?=C2=A0 My testing indicates that decoding strings<=
br>
by UTF-8 runs at about 50 msec per MByte for short strings, and about<br>
4 times faster for very large strings.=C2=A0 How does this compare with the=
<br>
overall time for processing a 10MB JSON?<br>
<br>
&gt; Alternatively, we (lsp-mode team) will be able to solve all these in a=
 dynamic module if emacs module<br>
&gt; mechanism is extended to allow creating emacs lisp structures efficien=
tly. <br>
<br>
I think we should only consider this after we profile JSON parsing and<br>
see which parts take the most processing time.<br>
</blockquote></div>

--000000000000531d37058502e47b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 16:14:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 26 12:14:59 2019
Received: from localhost ([127.0.0.1]:60452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8oj5-0007YU-Jl
	for submit <at> debbugs.gnu.org; Tue, 26 Mar 2019 12:14:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8oj3-0007YH-NO
 for 31138 <at> debbugs.gnu.org; Tue, 26 Mar 2019 12:14:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57633)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8oiy-0003tv-FZ; Tue, 26 Mar 2019 12:14:52 -0400
Received: from [176.228.60.248] (port=3224 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8oix-0002g2-0F; Tue, 26 Mar 2019 12:14:51 -0400
Date: Tue, 26 Mar 2019 18:14:58 +0200
Message-Id: <83zhphliil.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 23:34:38 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 23:34:38 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> 3. Even in the best case scenario native parsing is not fast enough. In lsp-mode, you might receive 3.5mb
> json as a server-side response while you are typing. E. g. I might type "abc" and get 10.5 mb json.

What kind of throughput do you get with native JSON parsing when you
submit a 10MB JSON to it?  My testing indicates that decoding strings
by UTF-8 runs at about 50 msec per MByte for short strings, and about
4 times faster for very large strings.  How does this compare with the
overall time for processing a 10MB JSON?

> Alternatively, we (lsp-mode team) will be able to solve all these in a dynamic module if emacs module
> mechanism is extended to allow creating emacs lisp structures efficiently. 

I think we should only consider this after we profile JSON parsing and
see which parts take the most processing time.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 03:51:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 23:51:15 2019
Received: from localhost ([127.0.0.1]:58897 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8d7K-0005VM-Qr
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 23:51:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51827)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8d7J-0005VA-B0
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 23:51:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47365)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8d7E-0000U4-0a; Mon, 25 Mar 2019 23:51:08 -0400
Received: from [176.228.60.248] (port=1335 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8d7C-0004uw-TH; Mon, 25 Mar 2019 23:51:07 -0400
Date: Tue, 26 Mar 2019 05:51:11 +0200
Message-Id: <83a7himgy8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 23:34:38 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 23:34:38 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  You mean, in your setup it's twice slower than in "emacs -Q"?
>  
> Yes.

Then my suggestion to bisect your setup still stands.  Alternatively,
if you can find a recipe where this happens and post it, I will look
into it.

>  And you are saying that the changes I made have no effect on the
>  performance?  Then what about the 100-fold slowdown you were talking
>  about, allegedly caused by the hooks?
> 
> The slowdown caused by the hooks was caused by the C-g and the issue does not exist and it is fixed by
> your patch. Otherwise, it is ~0.6 vs ~1.2secs. 

For 10 benchmark runs?

And even if it's twice slower than "emacs -Q", it should be still
almost twice faster than the Lisp implementation, at least that's what
I see on 2 different machines with 2 different OSes.

>  > I believe that it is caused by code_convert_string .
> 
>  This needs some more specific explanation, because code_convert_string
>  is called in both your setup and in "emacs -Q".  So it isn't
>  code_convert_string itself, it's something else, perhaps triggered by
>  code_convert_string, like those hooks I disabled.
> 
> Yes, I think that it is related to switching to different buffers.

Then json-parse-buffer doesn't have this problem in your setup?

> 1. Now we know where to look for if we want to optimize further emacs -q parsing performance.

I'm not sure we know that.  We didn't analyze the profile below the
Lisp primitives level.  If we want to see what takes significant parts
of the time in the benchmark runs, we need to use perf and look at the
C level below the primitives

> 2. Now we know what the difference between emacs -q performance and my setup is caused by something in
> that function.

No, I don't think we know that.  You say above that it's caused by
switching buffers, which is not in code_convert_string.

> IMO the fix should go in

OK, will do.

> I summarized what are lsp-mode problems. 

What are they?  Can you summarize them again, please, or point me to
where you did so?

>  I feel that I no longer understand what problem we are trying to
>  solve, and that no matter what improvements I propose, the discussion
>  always ends up insisting that code_convert_string is the culprit.
> 
> ...and it actually *was* the culprit, right?

No, the culprit was the hooks we called as a side effect of that function.

> Furthermore, it the performance test that I mentioned proves it is
> *still* the culprit...

I'm sorry, but I don't see that proof.  Can you explain how you arrive
at that conclusion?

> Here it is the summary of the issues that I see in native json parsing from lsp-mode (beware that I will list
> issues that are not relevant to that bug bug#31138).
> 
> 1. Hooks might be triggered when performing json parsing(fixed by you). I hoped that this will fix 2) but
> apparently these are two separate issues. 

Agreed.  So the issue with hooks no longer exists (once the patch I
sent is committed).

> 2. There is a difference in performance between emacs -q and non-"emacs -q" . I would expect json parsing
> to be side effect free. (My guess is that it is related to switching buffers because with-temp-buffer has some
> positive effect).

I don't think I understand this.  What side effects are you talking
about?  Switching buffers is not part of json-parse-string.

> 3. Even in the best case scenario native parsing is not fast enough. In lsp-mode, you might receive 3.5mb
> json as a server-side response while you are typing. E. g. I might type "abc" and get 10.5 mb json. I compared
> the performance of nodejs parsing and it is ~10 times faster than emacs -q. 

10 times faster doesn't mean Emacs isn't "fast enough".  The current
native parsing is faster than what we had before in Lisp, so this is
progress.

And if we want to see how to optimize JSON parsing in Emacs even more,
we need to profile the code with a large enough JSON, and see what
takes the time.

> 4. JSON parsing can be performed only on the UI thread. 

You can do that in a separate thread in a module.

> Alternatively, we (lsp-mode team) will be able to solve all these in a dynamic module if emacs module
> mechanism is extended to allow creating emacs lisp structures efficiently. 

What is lacking in the modules mechanism?

> PS: I really enjoy the ironical passive-aggressive style of communication which I guess is common for
> emacs-devel but I will still be trying to be constructive. I just want you to know that I won't bother answering
> and focus only on the stuff that will help to solve the issue...

I actually think that discussions on emacs-devel, with a few
exceptions, are generally to the point and quite productive.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 23:04:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 19:04:27 2019
Received: from localhost ([127.0.0.1]:58794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8Ydm-0004yB-N6
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 19:04:27 -0400
Received: from mail-lj1-f182.google.com ([209.85.208.182]:33161)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1h8Ydk-0004xv-FW
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 19:04:25 -0400
Received: by mail-lj1-f182.google.com with SMTP id f23so9417228ljc.0
 for <31138 <at> debbugs.gnu.org>; Mon, 25 Mar 2019 16:04:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=lx4y/FTUcLF8F4OElZ2TX9NqWQepYkeCXbkOZjy118Q=;
 b=kVkMCzsTaEIH1KuXMpkRsmsKagOZNHkWvpKBy7AWpJPh0jvU5nid+BSXANGyx6ZU1A
 BhvJ/YaebvY8jhY8rUxVtEL+g6ZZHXNzzvHHRc4DyuP8sc+UqadVq+9BNYaBmTg37/Lh
 z4EqaM82UwNG9snyOvP/R9Z1pb0QObI8KKQ7NQA0KpWxBV3sVZE+WZk2xkr9SJLPOmrb
 yqeIAZTmeN5bjdzeAJ5AjToLMLSGMevOl9HVjafJzaYIPK3ov7eu/Sm5lcK1pH3BsN8q
 8Z0BiFe8NWOF2TN1MeEtMN7G/F1Vyr4tmjD6kiJ8BDFY8iPQe9xuva3Xq2BInDNRrOBy
 8zAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=lx4y/FTUcLF8F4OElZ2TX9NqWQepYkeCXbkOZjy118Q=;
 b=n6fk+CF5tfhpa6u0pJWYiqOVSPGdqo/E/PBEdKUTsNnQaSnHUqv78JnLTzC/OiVpDz
 FlhqjEHna6nsTxW8lZ0qNOlBxfJd/N6efvKIMiR1Y9DypoOuNFbVxYxoyIT7rIlxTfQ+
 ayRxaq9qW9TYj0dNp1DcC2S9/BL2npgE7gMQKFEqBo/SX9zbxW+N5ydPzf/SWCtgok7k
 s3+vc8iuwECkVryxROBjQJHh4exZ+3JS8s3mcnzNKSCFN+2w2CwbiP6sRvueFIipBSJb
 ObWIqfwZE51Ls91ooqPwUCysQ+joK9SQBqVmRerfrsTWPIFBx/5wzmv7viuYRpTkKnWR
 tLQA==
X-Gm-Message-State: APjAAAWX3+4CXaLgw0xGgRwfNQ23CLWuZxqNkYu6ZBG6D/ocG0Y0AELF
 fPwexuRur3cOx4MTZ+5MGRAE+JQY
X-Google-Smtp-Source: APXvYqzn5dhuf2Qudwpfy370hKeiZKeNtuINL3cbRi4m+BtYDtON56Nxr+c9+2Q+HrAVdc0fFv7vgA==
X-Received: by 2002:a2e:8906:: with SMTP id d6mr13199101lji.152.1553555057905; 
 Mon, 25 Mar 2019 16:04:17 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.23])
 by smtp.googlemail.com with ESMTPSA id q29sm1605916ljc.8.2019.03.25.16.04.14
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 25 Mar 2019 16:04:15 -0700 (PDT)
Subject: Re: bug#31138: Native json slower than json.el
To: yyoncho <yyoncho@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
 <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <f39310e7-2fa4-410f-0bca-7c9b49f10eba@HIDDEN>
Date: Tue, 26 Mar 2019 01:04:13 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=c3=a9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Ivan,

On 25.03.2019 23:34, yyoncho wrote:

> PS: I really enjoy the ironical passive-aggressive style of 
> communication which I guess is common for emacs-devel but I will still 
> be trying to be constructive. I just want you to know that I won't 
> bother answering and focus only on the stuff that will help to solve the 
> issue...

While the recent message clarified quite a bit, the preceding ones were 
not so easy to interpret, and to understand that you applied the 
necessary rigor when benchmarking, and which results you got.

I'm not sure where you see the "ironical" style of conversation, but 
maybe some questions seemed rhetorical to you. I'm pretty sure they weren't.

P.S. Way to go to label the whole mailing list as "passive-aggressive" 
while calling yourself "constructive".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 21:34:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 17:34:58 2019
Received: from localhost ([127.0.0.1]:58744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8XFB-0002kz-Fn
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 17:34:57 -0400
Received: from mail-qk1-f170.google.com ([209.85.222.170]:42996)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8XF9-0002ki-RN
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 17:34:56 -0400
Received: by mail-qk1-f170.google.com with SMTP id b74so6332961qkg.9
 for <31138 <at> debbugs.gnu.org>; Mon, 25 Mar 2019 14:34:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=2fydiyiApVfamTiqwdxNRvRdBDIYQgwlw+0nPKNIv/I=;
 b=VFU3vkD/e1KjMUVzASXzxkrZ7JRVhcroSjT/M2LXBnM8UjDYXlNjd1rtCpYhVr+nWo
 vww5WZVjLs+hwJjzBt4jBXxJcwgEsP9bSoSF1QnHGDd3NqRWv4wEJYIulYLJVIGR7bFf
 mhjudcxKhNSKSp25+4Cf8uX1lwWju4Ei+Cp5GSErqnOnUQr7Z8ct+F8gSI64BVPGh3zL
 xV7wp5ejQ83ANZvAe5Hzff1Xqf/8qWrk4hp69GrtQay45tU7qy21qKsAgK+Y+n3iJQ5w
 E7blsH2V3GIeUzBSPOjyMmFln7NBPKQJ0Gr4+d8+6bwaxm1A07MRpgg+IqZNye2PtYyL
 6N0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=2fydiyiApVfamTiqwdxNRvRdBDIYQgwlw+0nPKNIv/I=;
 b=h1P6cEMBOVFvfrupRZOghsY2NbHJt98VHXjjXVIgxW9LjzTGa27YD+Y0NRGIPJ9oAT
 yNbrOyjiNFCO+73iBaHJD+DpbSMrlwwPILMygQLk0BzH6jE4o+beW0vJx4dIM+gyXpBb
 2Ein+AQ9GUKgZyIGrvuKoYmF7QcIL3/9tF284OHN1shuGemfQA6i/oKk9mAXTymwh5l6
 06M+OahMEZjbivBqV3OoBb8Dv86IteIZs/+ZIYmOOyx+2ZFzpAfIMtWmjz2S5wNOEb+R
 CJwWXrJ8Ve6ZkhASgZZE6iShyrwof4YnRh2iMrlAj3AyIuGFeBn6nBpPV68S9hZNIiOl
 PTMw==
X-Gm-Message-State: APjAAAV+zaD2v/kdf8+b6w89jJyf1/SmWERFlz3Jr7VppcoXrRW1pQGK
 P074Q349M+JZSIAwV0PBMp5tCUK+mM7gcGTU7Nk=
X-Google-Smtp-Source: APXvYqzvX0fsq4gl7hjOg2z72kdZydT8xJY37B+Wp50qZq0zW7n4wCh758HWlQCjrxYU5iAYxHiggnEzbwigz0t6eZ0=
X-Received: by 2002:a37:624e:: with SMTP id w75mr20514474qkb.11.1553549690312; 
 Mon, 25 Mar 2019 14:34:50 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 <83h8bqn2ik.fsf@HIDDEN>
In-Reply-To: <83h8bqn2ik.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 25 Mar 2019 23:34:38 +0200
Message-ID: <CACCVLQVJpju3guJ4FPVkzex6ek1u+=7Pdj343rnHEwNqN5uC0A@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000006e9f7f0584f1f9bd"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000006e9f7f0584f1f9bd
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

You mean, in your setup it's twice slower than in "emacs -Q"?
>

Yes.


> And you are saying that the changes I made have no effect on the
> performance?  Then what about the 100-fold slowdown you were talking
> about, allegedly caused by the hooks?
>

The slowdown caused by the hooks was caused by the C-g and the issue does
not exist and it is fixed by your patch. Otherwise, it is ~0.6 vs ~1.2secs.


> > I believe that it is caused by code_convert_string .
>
> This needs some more specific explanation, because code_convert_string
> is called in both your setup and in "emacs -Q".  So it isn't
> code_convert_string itself, it's something else, perhaps triggered by
> code_convert_string, like those hooks I disabled.
>

Yes, I think that it is related to switching to different buffers.


>
> > I compiled emacs without that call and
> > there is no difference in performance in both setups and the parsing is
> 2 times faster than emacs -q with
> > code_convert_string.
>
> It's small wonder that removing code makes functions which called that
> code work faster.  What does removing code_convert_string achieve
> except showing this truism in action?
>

It is actually very helpful for me and I guess for you:

1. Now we know where to look for if we want to optimize further emacs -q
parsing performance.
2. Now we know what the difference between emacs -q performance and my
setup is caused by something in that function.


>
> > I want to discuss the native json performance in the context of lsp-mode
> needs. Is it ok to do it in this thread?
>
> It depends on what you want to discuss, exactly.
>
> And I'm still confused regarding the performance that bothers you.  Is
> the problem the two-fold slowdown relative to "emacs -Q", or is the
> problem much worse slowdown in some other situation?  Is the patch I
> sent useful and should be pushed, or do you no longer care about it
> because it doesn't help you?
>

IMO the fix should go in, I summarized what are lsp-mode problems.


> I feel that I no longer understand what problem we are trying to
> solve, and that no matter what improvements I propose, the discussion
> always ends up insisting that code_convert_string is the culprit.
>

...and it actually *was* the culprit, right?  Furthermore, it the
performance test that I mentioned proves it is *still* the culprit...

Here it is the summary of the issues that I see in native json parsing from
lsp-mode (beware that I will list issues that are not relevant to that bug
bug#31138).

1. Hooks might be triggered when performing json parsing(fixed by you). I
hoped that this will fix 2) but apparently these are two separate issues.
2. There is a difference in performance between emacs -q and non-"emacs -q"
. I would expect json parsing to be side effect free. (My guess is that it
is related to switching buffers because with-temp-buffer has some positive
effect).
3. Even in the best case scenario native parsing is not fast enough. In
lsp-mode, you might receive 3.5mb json as a server-side response while you
are typing. E. g. I might type "abc" and get 10.5 mb json. I compared the
performance of nodejs parsing and it is ~10 times faster than emacs -q.
4. JSON parsing can be performed only on the UI thread.

Alternatively, we (lsp-mode team) will be able to solve all these in a
dynamic module if emacs module mechanism is extended to allow creating
emacs lisp structures efficiently.

PS: I really enjoy the ironical passive-aggressive style of communication
which I guess is common for emacs-devel but I will still be trying to be
constructive. I just want you to know that I won't bother answering and
focus only on the stuff that will help to solve the issue...

Thanks,
Ivan

--0000000000006e9f7f0584f1f9bd
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><div>Hi Eli,</=
div><div><br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">You mean, in your setup it&#39;s twice slower than in =
&quot;emacs -Q&quot;?<br></blockquote><div>=C2=A0</div><div>Yes.</div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">And you are s=
aying that the changes I made have no effect on the<br>performance?=C2=A0 T=
hen what about the 100-fold slowdown you were talking<br>about, allegedly c=
aused by the hooks?<br></blockquote><div><br></div><div>The slowdown caused=
 by the hooks was caused by the C-g and the issue does not exist and it is =
fixed by your patch. Otherwise, it is ~0.6 vs ~1.2secs.=C2=A0</div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; I believe t=
hat it is caused by code_convert_string .<br>
<br>This needs some more specific explanation, because code_convert_string<=
br>is called in both your setup and in &quot;emacs -Q&quot;.=C2=A0 So it is=
n&#39;t<br>code_convert_string itself, it&#39;s something else, perhaps tri=
ggered by<br>code_convert_string, like those hooks I disabled.<br></blockqu=
ote><div><br></div><div>Yes, I think that it is related to switching to dif=
ferent buffers.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">
<br>&gt; I compiled emacs without that call and<br>&gt; there is no differe=
nce in performance in both setups and the parsing is 2 times faster than em=
acs -q with<br>&gt; code_convert_string.<br>
<br>It&#39;s small wonder that removing code makes functions which called t=
hat<br>code work faster.=C2=A0 What does removing code_convert_string achie=
ve<br>except showing this truism in action?<br></blockquote><div><br></div>=
<div>It is actually very helpful for me and I guess for you:</div><div><br>=
</div><div>1. Now we know where to look for if we want to optimize further =
emacs -q parsing performance.</div><div>2. Now we know what the difference =
between emacs -q performance and my setup is caused by something in that fu=
nction.</div><div>=C2=A0<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
<br>&gt; I want to discuss the native json performance in the context of ls=
p-mode needs. Is it ok to do it in this thread?<br>
<br>It depends on what you want to discuss, exactly.<br>
<br>And I&#39;m still confused regarding the performance that bothers you.=
=C2=A0 Is<br>the problem the two-fold slowdown relative to &quot;emacs -Q&q=
uot;, or is the<br>problem much worse slowdown in some other situation?=C2=
=A0 Is the patch I<br>sent useful and should be pushed, or do you no longer=
 care about it<br>because it doesn&#39;t help you?<br></blockquote><div><br=
></div><div>IMO the fix should go in, I summarized what are lsp-mode proble=
ms.=C2=A0</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex"><br>I feel that I no longer understand what problem we are trying to<b=
r>solve, and that no matter what improvements I propose, the discussion<br>=
always ends up insisting that code_convert_string is the culprit.<br></bloc=
kquote><div><br></div><div>...and it actually *was* the culprit, right?=C2=
=A0 Furthermore, it the performance test that I mentioned proves it is *sti=
ll* the culprit...</div><div><br></div><div>Here it is the summary of the i=
ssues that I see in native json=C2=A0parsing from lsp-mode (beware that I w=
ill list issues that are not relevant to that bug bug#31138).</div><div><br=
></div><div>1. Hooks might be triggered when performing json parsing(fixed =
by you). I hoped that this will fix 2) but apparently these are two separat=
e issues.=C2=A0</div><div>2. There is a difference in performance between e=
macs -q and non-&quot;emacs -q&quot; .=C2=A0I would expect json parsing to =
be side effect free. (My guess is that it is related to switching buffers b=
ecause with-temp-buffer has some positive effect).</div><div>3. Even in the=
 best case scenario native parsing is not fast enough. In lsp-mode, you mig=
ht receive 3.5mb=C2=A0json as a server-side response while you are typing. =
E. g. I might type &quot;abc&quot; and get 10.5 mb=C2=A0json. I compared th=
e performance of nodejs parsing and it is ~10 times faster than emacs -q.=
=C2=A0</div><div>4. JSON parsing can be performed only on the UI thread.=C2=
=A0</div><div><br></div><div>Alternatively, we (lsp-mode team) will be able=
 to solve all these in a dynamic module if emacs module mechanism is extend=
ed to allow creating emacs lisp structures efficiently.=C2=A0<br></div><div=
><br></div><div>PS: I really enjoy the ironical passive-aggressive style of=
 communication which I guess is common for emacs-devel but I will still be =
trying to be constructive. I just want you to know that I won&#39;t bother =
answering and focus only on the stuff that will help to solve the issue...<=
/div><div><br></div><div>Thanks,</div><div>Ivan=C2=A0</div></div></div></di=
v>

--0000000000006e9f7f0584f1f9bd--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 20:05:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 16:05:45 2019
Received: from localhost ([127.0.0.1]:58705 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8Vqr-0000eA-H1
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 16:05:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41719)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8Vqo-0000du-4w
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 16:05:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42305)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8Vqf-0004yf-8D; Mon, 25 Mar 2019 16:05:34 -0400
Received: from [176.228.60.248] (port=4581 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8Vqa-0003Oi-IA; Mon, 25 Mar 2019 16:05:29 -0400
Date: Mon, 25 Mar 2019 22:05:23 +0200
Message-Id: <83h8bqn2ik.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 21:16:53 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
 <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 21:16:53 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> I am unable to see any difference in the performance of the json parsing in emacs -q and in my setup - it is
> still ~2 times slower.

You mean, in your setup it's twice slower than in "emacs -Q"?

And you are saying that the changes I made have no effect on the
performance?  Then what about the 100-fold slowdown you were talking
about, allegedly caused by the hooks?

> I believe that it is caused by code_convert_string .

This needs some more specific explanation, because code_convert_string
is called in both your setup and in "emacs -Q".  So it isn't
code_convert_string itself, it's something else, perhaps triggered by
code_convert_string, like those hooks I disabled.

> I compiled emacs without that call and
> there is no difference in performance in both setups and the parsing is 2 times faster than emacs -q with
> code_convert_string.

It's small wonder that removing code makes functions which called that
code work faster.  What does removing code_convert_string achieve
except showing this truism in action?

> I want to discuss the native json performance in the context of lsp-mode needs. Is it ok to do it in this thread?

It depends on what you want to discuss, exactly.

And I'm still confused regarding the performance that bothers you.  Is
the problem the two-fold slowdown relative to "emacs -Q", or is the
problem much worse slowdown in some other situation?  Is the patch I
sent useful and should be pushed, or do you no longer care about it
because it doesn't help you?

I feel that I no longer understand what problem we are trying to
solve, and that no matter what improvements I propose, the discussion
always ends up insisting that code_convert_string is the culprit.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 19:17:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 15:17:12 2019
Received: from localhost ([127.0.0.1]:58685 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8V5r-0007xN-OH
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 15:17:12 -0400
Received: from mail-qt1-f175.google.com ([209.85.160.175]:37430)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8V5q-0007x8-2k
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 15:17:10 -0400
Received: by mail-qt1-f175.google.com with SMTP id z16so11721015qtn.4
 for <31138 <at> debbugs.gnu.org>; Mon, 25 Mar 2019 12:17:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=xqOMEgq+VtNDBOM+1RqlNv/wkMZ2RtoCRIhQuShHZ70=;
 b=E6IlFvuf0RK7B4A6LjzFJNY0ZZnWvxsy175TZlzr7jSLZv/I+ruGs8G357VOkZzMYT
 XCcqybL/zkh1/V4hZHY1foNUz2sSQi+cMkUromS2tbRFZvvzjpAeNyeTeVok1gvs4q0d
 1f7KyDSzKPrzTDZTUsaYn2VubT3B58w/dGjWszvmJQgVRb/nMtbqy+ZAyU9Smsh/xUbT
 yGMpWTHlLhWxb14DL+Py9Rjd8Pt59t9Uq7akp2NNulMJ6CJlYlhAoAbvzRICxiuH2DZT
 LyjXJnALf6JgFZ0h3W/L7MEmxv3o7k6AEYNrCBO7o+CD0kGjpM7clNPZb97M8+eXaZpN
 7ZZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=xqOMEgq+VtNDBOM+1RqlNv/wkMZ2RtoCRIhQuShHZ70=;
 b=tE/yjmtHz4IygvQBcN3+rpYASIQ29nD2tC/F9Zzj8GHkwiQ/HfiMYP7HbvSSsvDyKc
 TWFEZJMfR2Uq7esGAUzmLCGvGhNN5GKBG7cp971X76484T7hYSjfEE5Us2bhJMef5jG6
 dgRXeKOt0ZRRoaxFeeJExiVeQpsFZQlNEU49XIjhwphGcVXi8Gx6J9XT+VId76//6x8S
 zc6pUnJSJCi3vnVo3q0VN7LlSLm+V9GxnP3qjpzekfyhtojAIfr5f9nVhBiLt0LVq2rK
 Ax2NarGuibohdEoWP15Zu1wHAkZN+bg7H/zNJCTMSn7JWBZuZ91PywBZ78iXaEoE4pe4
 1JQg==
X-Gm-Message-State: APjAAAVfzLhRg7LY4dg6mL9fPckzcii7zqirbevy74nTqQdLTtgE1OYP
 uvw8ppkECF8kDZ3zJNMo3mGAqfk/O+VXg1c0oF0=
X-Google-Smtp-Source: APXvYqwZh0dXdMRmnzhpk9xQS8LSpzM+ezv9l6IF5G/k3+JmWymSIXnqTrS0Jht0Si5oSQFSESqN5z5nMclhTcunXe4=
X-Received: by 2002:a0c:d6c1:: with SMTP id l1mr21691189qvi.173.1553541424405; 
 Mon, 25 Mar 2019 12:17:04 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 <83lg12n75s.fsf@HIDDEN>
In-Reply-To: <83lg12n75s.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 25 Mar 2019 21:16:53 +0200
Message-ID: <CACCVLQVX8UZz=SNb1_8BULCPuWk7FYjuNMEdGeL=REwQELSS7Q@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000bedfe50584f00cb3"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000bedfe50584f00cb3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

I am unable to see any difference in the performance of the json parsing in
emacs -q and in my setup - it is still ~2 times slower. I believe that it
is caused by code_convert_string . I compiled emacs without that call and
there is no difference in performance in both setups and the parsing is 2
times faster than emacs -q with code_convert_string.

I want to discuss the native json performance in the context of lsp-mode
needs. Is it ok to do it in this thread?

Thanks,
Ivan

On Mon, Mar 25, 2019 at 8:25 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Mon, 25 Mar 2019 20:20:57 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > The patch seems to be addressing the hooks related issue.
>
> Yes.  Do you see improvement in performance?
>

--000000000000bedfe50584f00cb3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi Eli,<div><br></div><div>I am unable to=
 see any difference in the performance of the json=C2=A0parsing in emacs -q=
 and in my setup=C2=A0- it is still ~2 times slower. I believe that it is c=
aused by=C2=A0code_convert_string .=C2=A0I compiled emacs without that call=
 and there is no difference in performance in both setups and the parsing i=
s 2 times faster than emacs -q with code_convert_string.</div><div><br></di=
v><div>I want to discuss the native json performance in the context of lsp-=
mode needs. Is it ok to do it in this thread?</div><div><br></div><div>Than=
ks,</div><div>Ivan</div></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Mon, Mar 25, 2019 at 8:25 PM Eli Zaretskii=
 &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt;=
 wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; Fro=
m: yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN" target=3D"_blank">yyonc=
ho@HIDDEN</a>&gt;<br>
&gt; Date: Mon, 25 Mar 2019 20:20:57 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; The patch seems to be addressing the hooks related issue. <br>
<br>
Yes.=C2=A0 Do you see improvement in performance?<br>
</blockquote></div>

--000000000000bedfe50584f00cb3--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 18:25:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 14:25:19 2019
Received: from localhost ([127.0.0.1]:58662 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8UHf-0006hJ-At
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 14:25:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49737)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8UHd-0006gz-1A
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 14:25:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40580)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8UHV-0004bR-Ny; Mon, 25 Mar 2019 14:25:11 -0400
Received: from [176.228.60.248] (port=2010 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8UHN-0001fN-NR; Mon, 25 Mar 2019 14:25:03 -0400
Date: Mon, 25 Mar 2019 20:25:03 +0200
Message-Id: <83lg12n75s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 20:20:57 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
 <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 20:20:57 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> The patch seems to be addressing the hooks related issue. 

Yes.  Do you see improvement in performance?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 18:21:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 14:21:18 2019
Received: from localhost ([127.0.0.1]:58658 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8UDk-0006Zl-E1
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 14:21:16 -0400
Received: from mail-qt1-f194.google.com ([209.85.160.194]:33295)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8UDh-0006ZY-Ss
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 14:21:14 -0400
Received: by mail-qt1-f194.google.com with SMTP id k14so11520195qtb.0
 for <31138 <at> debbugs.gnu.org>; Mon, 25 Mar 2019 11:21:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=aVvwysavKXvWl2sM/USNz5GoPmlxuBrlblDc7w2kN1M=;
 b=klWedtqjbVhknX3dlbT1MD17ZENCqEHx7qANqb4/uxm/lZf1sbPXmcqzfikSHDRxnW
 kzIBWD43iNWa0F2BkxlR6gzG8ZYpNqRSX/XwNuxkwaIBg/k1AP87puprED4EURusAZtI
 1i2FqrLEzwKxqtOOQE2ldvAVZBd79BsJrAcKuskuxfgeoWl7orWpro9gJtrw0zbiGHdT
 2da3F2xnPCR518Rh2JskPiwK8dRcKHPe7vec7jr1iPE5MDeHW2O5wS8cW8X4hrLgmpiY
 fplfeOPXYvW8Womrruv02YcF1xlgB1lrVye+XDVRT7nGCN5+s5dFXuAuRABf8EOjTfqt
 4UxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=aVvwysavKXvWl2sM/USNz5GoPmlxuBrlblDc7w2kN1M=;
 b=RcF+zq1JXcPGtiVjODzKoal29Y6mAnS71TMxsmVKkP/atRQXit/dglAm8yZO7AQLk7
 qa9pVTIcDxxCR7HAzuU3Yfz65laDunBFWWvcNhpFkOjNudmc5JjFo2NVr1d81+u+PGjg
 1y4UaxVtnVIes3dW9IHM92dP7ku7uKHSyaLNyYxNamRwNjP6Lw5u1iDOa9oU/D5r7VNe
 ef9K9nrPKDKztcNJzfpReDfRKQlWk6PRphem56Ci6y385eJcsBJgRM0vqNU07aw8jugb
 urKv7AKh48uqcYrROnpGoFNtWzUKgGcxehTcs5+4rcEYWjh44/QAK4BpXO9v/GTXBZLD
 GT0w==
X-Gm-Message-State: APjAAAXbF2DQqK+ZOyUKx4VmgHqh6/SKeYRdhthROHCGNsmbZIMoO1nT
 z12OIPHlmYSigbI52W/ypX56KhbAceprylK6OfA=
X-Google-Smtp-Source: APXvYqxN5uREcR2YbOtb3E16YOxyXij1hP+912BZ1hzqt+Dze8NLbgk8KN/OK9Dq4bW6hU1TwIXbZ2onAkffCofh0Yk=
X-Received: by 2002:ac8:544b:: with SMTP id d11mr10738948qtq.134.1553538068333; 
 Mon, 25 Mar 2019 11:21:08 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 <83tvfqnbxc.fsf@HIDDEN>
In-Reply-To: <83tvfqnbxc.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 25 Mar 2019 20:20:57 +0200
Message-ID: <CACCVLQUdHSTWaJsuF9A1eiVBaW62ZD0N88wPOnt-Ga7kO8m45A@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000b549890584ef4464"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000b549890584ef4464
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

The patch seems to be addressing the hooks related issue.

Thanks,
Ivan

On Mon, Mar 25, 2019 at 6:42 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Mon, 25 Mar 2019 07:44:00 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> >  Is this with or without the patch I sent?
> >
> > It is with the patch (in the two profiler.el reports, the "kill" hooks
> are not present)
>
> OK, thanks.
>
> > Just found that it is not my setup which triggers the issue bug pressin=
g
> C-g during the parsing:
>
> Right, I think I see the reason for that.  The patch below should fix
> this.  It also makes buffer-list-update-hook nil when creating and
> killing the conversion buffer, for a good measure.  Please note that
> the patch is relative to the current master, so be sure to run
> "git checkout src/coding.c" before applying.
>
> > I did exactly what you are saying here: I applied the patch and listed
> the effects:
> > 1. The buffer-list-update-hook is called
> > 2. The patch does not affect the perf difference between emacs -q and m=
y
> setup.
> >
> > > I must rely on you in this matter, because I cannot reproduce the
> > > slowdown on my system.
> >
> > I realize that and I am trying to be as helpful as possible by sharing
> all my observations.
>
> OK, but please always say if your observations are before or after the
> last patch I sent.
>
> Thanks.
>
> Here's the patch:
>
> diff --git a/src/coding.c b/src/coding.c
> index 905c7ce..c6d9643 100644
> --- a/src/coding.c
> +++ b/src/coding.c
> @@ -7798,42 +7798,6 @@ static Lisp_Object Vcode_conversion_reused_workbuf=
;
>  static bool reused_workbuf_in_use;
>
>
> -/* Return a working buffer of code conversion.  MULTIBYTE specifies the
> -   multibyteness of returning buffer.  */
> -
> -static Lisp_Object
> -make_conversion_work_buffer (bool multibyte)
> -{
> -  Lisp_Object name, workbuf;
> -  struct buffer *current;
> -
> -  if (reused_workbuf_in_use)
> -    {
> -      name =3D Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name,
> Qnil);
> -      workbuf =3D Fget_buffer_create (name);
> -    }
> -  else
> -    {
> -      reused_workbuf_in_use =3D 1;
> -      if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf)))
> -       Vcode_conversion_reused_workbuf
> -         =3D Fget_buffer_create (Vcode_conversion_workbuf_name);
> -      workbuf =3D Vcode_conversion_reused_workbuf;
> -    }
> -  current =3D current_buffer;
> -  set_buffer_internal (XBUFFER (workbuf));
> -  /* We can't allow modification hooks to run in the work buffer.  For
> -     instance, directory_files_internal assumes that file decoding
> -     doesn't compile new regexps.  */
> -  Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
> -  Ferase_buffer ();
> -  bset_undo_list (current_buffer, Qt);
> -  bset_enable_multibyte_characters (current_buffer, multibyte ? Qt :
> Qnil);
> -  set_buffer_internal (current);
> -  return workbuf;
> -}
> -
> -
>  static void
>  code_conversion_restore (Lisp_Object arg)
>  {
> @@ -7846,7 +7810,12 @@ code_conversion_restore (Lisp_Object arg)
>        if (EQ (workbuf, Vcode_conversion_reused_workbuf))
>         reused_workbuf_in_use =3D 0;
>        else
> -       Fkill_buffer (workbuf);
> +       {
> +         ptrdiff_t count =3D SPECPDL_INDEX ();
> +         specbind (Qbuffer_list_update_hook, Qnil);
> +         Fkill_buffer (workbuf);
> +         unbind_to (count, Qnil);
> +       }
>      }
>    set_buffer_internal (XBUFFER (current));
>  }
> @@ -7857,9 +7826,51 @@ code_conversion_save (bool with_work_buf, bool
> multibyte)
>    Lisp_Object workbuf =3D Qnil;
>
>    if (with_work_buf)
> -    workbuf =3D make_conversion_work_buffer (multibyte);
> +    {
> +      ptrdiff_t count =3D SPECPDL_INDEX ();
> +      if (reused_workbuf_in_use)
> +       {
> +         Lisp_Object name
> +           =3D Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name,
> Qnil);
> +         specbind (Qbuffer_list_update_hook, Qnil);
> +         workbuf =3D Fget_buffer_create (name);
> +         unbind_to (count, Qnil);
> +       }
> +      else
> +       {
> +         if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf)))
> +           {
> +             specbind (Qbuffer_list_update_hook, Qnil);
> +             Vcode_conversion_reused_workbuf
> +               =3D Fget_buffer_create (Vcode_conversion_workbuf_name);
> +             unbind_to (count, Qnil);
> +           }
> +         workbuf =3D Vcode_conversion_reused_workbuf;
> +       }
> +    }
>    record_unwind_protect (code_conversion_restore,
>                          Fcons (Fcurrent_buffer (), workbuf));
> +  if (!NILP (workbuf))
> +    {
> +      struct buffer *current =3D current_buffer;
> +      set_buffer_internal (XBUFFER (workbuf));
> +      /* We can't allow modification hooks to run in the work buffer.  F=
or
> +        instance, directory_files_internal assumes that file decoding
> +        doesn't compile new regexps.  */
> +      Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
> +      Ferase_buffer ();
> +      bset_undo_list (current_buffer, Qt);
> +      bset_enable_multibyte_characters (current_buffer, multibyte ? Qt :
> Qnil);
> +      if (EQ (workbuf, Vcode_conversion_reused_workbuf))
> +       reused_workbuf_in_use =3D 1;
> +      else
> +       {
> +         Fset (Fmake_local_variable (Qkill_buffer_query_functions), Qnil=
);
> +         Fset (Fmake_local_variable (Qkill_buffer_hook), Qnil);
> +       }
> +      set_buffer_internal (current);
> +    }
> +
>    return workbuf;
>  }
>
>

--000000000000b549890584ef4464
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Eli,<div><br></div><div>The patch seems to be addressin=
g the hooks related issue.=C2=A0</div><div><br></div><div>Thanks,</div><div=
>Ivan</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"g=
mail_attr">On Mon, Mar 25, 2019 at 6:42 PM Eli Zaretskii &lt;<a href=3D"mai=
lto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mailto:yyon=
cho@HIDDEN" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Mon, 25 Mar 2019 07:44:00 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt;=C2=A0 Is this with or without the patch I sent?<br>
&gt; <br>
&gt; It is with the patch (in the two profiler.el reports, the &quot;kill&q=
uot; hooks are not present)<br>
<br>
OK, thanks.<br>
<br>
&gt; Just found that it is not my setup which triggers the issue bug pressi=
ng C-g during the parsing:<br>
<br>
Right, I think I see the reason for that.=C2=A0 The patch below should fix<=
br>
this.=C2=A0 It also makes buffer-list-update-hook nil when creating and<br>
killing the conversion buffer, for a good measure.=C2=A0 Please note that<b=
r>
the patch is relative to the current master, so be sure to run<br>
&quot;git checkout src/coding.c&quot; before applying.<br>
<br>
&gt; I did exactly what you are saying here: I applied the patch and listed=
 the effects:<br>
&gt; 1. The buffer-list-update-hook is called<br>
&gt; 2. The patch does not affect the perf difference between emacs -q and =
my setup.<br>
&gt; <br>
&gt; &gt; I must rely on you in this matter, because I cannot reproduce the=
<br>
&gt; &gt; slowdown on my system.<br>
&gt; <br>
&gt; I realize that and I am trying to be as helpful as possible by sharing=
 all my observations.<br>
<br>
OK, but please always say if your observations are before or after the<br>
last patch I sent.<br>
<br>
Thanks.<br>
<br>
Here&#39;s the patch:<br>
<br>
diff --git a/src/coding.c b/src/coding.c<br>
index 905c7ce..c6d9643 100644<br>
--- a/src/coding.c<br>
+++ b/src/coding.c<br>
@@ -7798,42 +7798,6 @@ static Lisp_Object Vcode_conversion_reused_workbuf;<=
br>
=C2=A0static bool reused_workbuf_in_use;<br>
<br>
<br>
-/* Return a working buffer of code conversion.=C2=A0 MULTIBYTE specifies t=
he<br>
-=C2=A0 =C2=A0multibyteness of returning buffer.=C2=A0 */<br>
-<br>
-static Lisp_Object<br>
-make_conversion_work_buffer (bool multibyte)<br>
-{<br>
-=C2=A0 Lisp_Object name, workbuf;<br>
-=C2=A0 struct buffer *current;<br>
-<br>
-=C2=A0 if (reused_workbuf_in_use)<br>
-=C2=A0 =C2=A0 {<br>
-=C2=A0 =C2=A0 =C2=A0 name =3D Fgenerate_new_buffer_name (Vcode_conversion_=
workbuf_name, Qnil);<br>
-=C2=A0 =C2=A0 =C2=A0 workbuf =3D Fget_buffer_create (name);<br>
-=C2=A0 =C2=A0 }<br>
-=C2=A0 else<br>
-=C2=A0 =C2=A0 {<br>
-=C2=A0 =C2=A0 =C2=A0 reused_workbuf_in_use =3D 1;<br>
-=C2=A0 =C2=A0 =C2=A0 if (NILP (Fbuffer_live_p (Vcode_conversion_reused_wor=
kbuf)))<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0Vcode_conversion_reused_workbuf<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D Fget_buffer_create (Vcode_conversion=
_workbuf_name);<br>
-=C2=A0 =C2=A0 =C2=A0 workbuf =3D Vcode_conversion_reused_workbuf;<br>
-=C2=A0 =C2=A0 }<br>
-=C2=A0 current =3D current_buffer;<br>
-=C2=A0 set_buffer_internal (XBUFFER (workbuf));<br>
-=C2=A0 /* We can&#39;t allow modification hooks to run in the work buffer.=
=C2=A0 For<br>
-=C2=A0 =C2=A0 =C2=A0instance, directory_files_internal assumes that file d=
ecoding<br>
-=C2=A0 =C2=A0 =C2=A0doesn&#39;t compile new regexps.=C2=A0 */<br>
-=C2=A0 Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);<br>
-=C2=A0 Ferase_buffer ();<br>
-=C2=A0 bset_undo_list (current_buffer, Qt);<br>
-=C2=A0 bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : =
Qnil);<br>
-=C2=A0 set_buffer_internal (current);<br>
-=C2=A0 return workbuf;<br>
-}<br>
-<br>
-<br>
=C2=A0static void<br>
=C2=A0code_conversion_restore (Lisp_Object arg)<br>
=C2=A0{<br>
@@ -7846,7 +7810,12 @@ code_conversion_restore (Lisp_Object arg)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0if (EQ (workbuf, Vcode_conversion_reused_workbuf=
))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 reused_workbuf_in_use =3D 0;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0else<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0Fkill_buffer (workbuf);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptrdiff_t count =3D SPECPDL_INDEX ();<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specbind (Qbuffer_list_update_hook, Qnil=
);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fkill_buffer (workbuf);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unbind_to (count, Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0set_buffer_internal (XBUFFER (current));<br>
=C2=A0}<br>
@@ -7857,9 +7826,51 @@ code_conversion_save (bool with_work_buf, bool multi=
byte)<br>
=C2=A0 =C2=A0Lisp_Object workbuf =3D Qnil;<br>
<br>
=C2=A0 =C2=A0if (with_work_buf)<br>
-=C2=A0 =C2=A0 workbuf =3D make_conversion_work_buffer (multibyte);<br>
+=C2=A0 =C2=A0 {<br>
+=C2=A0 =C2=A0 =C2=A0 ptrdiff_t count =3D SPECPDL_INDEX ();<br>
+=C2=A0 =C2=A0 =C2=A0 if (reused_workbuf_in_use)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Lisp_Object name<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D Fgenerate_new_buffer_name (Vc=
ode_conversion_workbuf_name, Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specbind (Qbuffer_list_update_hook, Qnil=
);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0workbuf =3D Fget_buffer_create (name);<b=
r>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unbind_to (count, Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
+=C2=A0 =C2=A0 =C2=A0 else<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (NILP (Fbuffer_live_p (Vcode_conversi=
on_reused_workbuf)))<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0specbind (Qbuffer_list_upd=
ate_hook, Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Vcode_conversion_reused_wo=
rkbuf<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D Fget_buffer_cre=
ate (Vcode_conversion_workbuf_name);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unbind_to (count, Qnil);<b=
r>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0workbuf =3D Vcode_conversion_reused_work=
buf;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
+=C2=A0 =C2=A0 }<br>
=C2=A0 =C2=A0record_unwind_protect (code_conversion_restore,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0Fcons (Fcurrent_buffer (), workbuf));<br>
+=C2=A0 if (!NILP (workbuf))<br>
+=C2=A0 =C2=A0 {<br>
+=C2=A0 =C2=A0 =C2=A0 struct buffer *current =3D current_buffer;<br>
+=C2=A0 =C2=A0 =C2=A0 set_buffer_internal (XBUFFER (workbuf));<br>
+=C2=A0 =C2=A0 =C2=A0 /* We can&#39;t allow modification hooks to run in th=
e work buffer.=C2=A0 For<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 instance, directory_files_internal assumes tha=
t file decoding<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 doesn&#39;t compile new regexps.=C2=A0 */<br>
+=C2=A0 =C2=A0 =C2=A0 Fset (Fmake_local_variable (Qinhibit_modification_hoo=
ks), Qt);<br>
+=C2=A0 =C2=A0 =C2=A0 Ferase_buffer ();<br>
+=C2=A0 =C2=A0 =C2=A0 bset_undo_list (current_buffer, Qt);<br>
+=C2=A0 =C2=A0 =C2=A0 bset_enable_multibyte_characters (current_buffer, mul=
tibyte ? Qt : Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 if (EQ (workbuf, Vcode_conversion_reused_workbuf))<br=
>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0reused_workbuf_in_use =3D 1;<br>
+=C2=A0 =C2=A0 =C2=A0 else<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fset (Fmake_local_variable (Qkill_buffer=
_query_functions), Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fset (Fmake_local_variable (Qkill_buffer=
_hook), Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
+=C2=A0 =C2=A0 =C2=A0 set_buffer_internal (current);<br>
+=C2=A0 =C2=A0 }<br>
+<br>
=C2=A0 =C2=A0return workbuf;<br>
=C2=A0}<br>
<br>
</blockquote></div>

--000000000000b549890584ef4464--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 16:42:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 12:42:15 2019
Received: from localhost ([127.0.0.1]:58580 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8Sfu-0003at-Pk
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 12:42:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58391)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8Sfr-0003ad-Rf
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 12:42:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38920)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8Sfm-0007Ru-AH; Mon, 25 Mar 2019 12:42:06 -0400
Received: from [176.228.60.248] (port=3142 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8Sfk-0000JU-ME; Mon, 25 Mar 2019 12:42:05 -0400
Date: Mon, 25 Mar 2019 18:42:07 +0200
Message-Id: <83tvfqnbxc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
 (message from yyoncho on Mon, 25 Mar 2019 07:44:00 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
 <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Mon, 25 Mar 2019 07:44:00 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
>  Is this with or without the patch I sent?
> 
> It is with the patch (in the two profiler.el reports, the "kill" hooks are not present)

OK, thanks.

> Just found that it is not my setup which triggers the issue bug pressing C-g during the parsing:

Right, I think I see the reason for that.  The patch below should fix
this.  It also makes buffer-list-update-hook nil when creating and
killing the conversion buffer, for a good measure.  Please note that
the patch is relative to the current master, so be sure to run
"git checkout src/coding.c" before applying.

> I did exactly what you are saying here: I applied the patch and listed the effects:
> 1. The buffer-list-update-hook is called
> 2. The patch does not affect the perf difference between emacs -q and my setup.
> 
> > I must rely on you in this matter, because I cannot reproduce the
> > slowdown on my system.
> 
> I realize that and I am trying to be as helpful as possible by sharing all my observations.

OK, but please always say if your observations are before or after the
last patch I sent.

Thanks.

Here's the patch:

diff --git a/src/coding.c b/src/coding.c
index 905c7ce..c6d9643 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7798,42 +7798,6 @@ static Lisp_Object Vcode_conversion_reused_workbuf;
 static bool reused_workbuf_in_use;
 
 
-/* Return a working buffer of code conversion.  MULTIBYTE specifies the
-   multibyteness of returning buffer.  */
-
-static Lisp_Object
-make_conversion_work_buffer (bool multibyte)
-{
-  Lisp_Object name, workbuf;
-  struct buffer *current;
-
-  if (reused_workbuf_in_use)
-    {
-      name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
-      workbuf = Fget_buffer_create (name);
-    }
-  else
-    {
-      reused_workbuf_in_use = 1;
-      if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf)))
-	Vcode_conversion_reused_workbuf
-	  = Fget_buffer_create (Vcode_conversion_workbuf_name);
-      workbuf = Vcode_conversion_reused_workbuf;
-    }
-  current = current_buffer;
-  set_buffer_internal (XBUFFER (workbuf));
-  /* We can't allow modification hooks to run in the work buffer.  For
-     instance, directory_files_internal assumes that file decoding
-     doesn't compile new regexps.  */
-  Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
-  Ferase_buffer ();
-  bset_undo_list (current_buffer, Qt);
-  bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil);
-  set_buffer_internal (current);
-  return workbuf;
-}
-
-
 static void
 code_conversion_restore (Lisp_Object arg)
 {
@@ -7846,7 +7810,12 @@ code_conversion_restore (Lisp_Object arg)
       if (EQ (workbuf, Vcode_conversion_reused_workbuf))
 	reused_workbuf_in_use = 0;
       else
-	Fkill_buffer (workbuf);
+	{
+	  ptrdiff_t count = SPECPDL_INDEX ();
+	  specbind (Qbuffer_list_update_hook, Qnil);
+	  Fkill_buffer (workbuf);
+	  unbind_to (count, Qnil);
+	}
     }
   set_buffer_internal (XBUFFER (current));
 }
@@ -7857,9 +7826,51 @@ code_conversion_save (bool with_work_buf, bool multibyte)
   Lisp_Object workbuf = Qnil;
 
   if (with_work_buf)
-    workbuf = make_conversion_work_buffer (multibyte);
+    {
+      ptrdiff_t count = SPECPDL_INDEX ();
+      if (reused_workbuf_in_use)
+	{
+	  Lisp_Object name
+	    = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
+	  specbind (Qbuffer_list_update_hook, Qnil);
+	  workbuf = Fget_buffer_create (name);
+	  unbind_to (count, Qnil);
+	}
+      else
+	{
+	  if (NILP (Fbuffer_live_p (Vcode_conversion_reused_workbuf)))
+	    {
+	      specbind (Qbuffer_list_update_hook, Qnil);
+	      Vcode_conversion_reused_workbuf
+		= Fget_buffer_create (Vcode_conversion_workbuf_name);
+	      unbind_to (count, Qnil);
+	    }
+	  workbuf = Vcode_conversion_reused_workbuf;
+	}
+    }
   record_unwind_protect (code_conversion_restore,
 			 Fcons (Fcurrent_buffer (), workbuf));
+  if (!NILP (workbuf))
+    {
+      struct buffer *current = current_buffer;
+      set_buffer_internal (XBUFFER (workbuf));
+      /* We can't allow modification hooks to run in the work buffer.  For
+	 instance, directory_files_internal assumes that file decoding
+	 doesn't compile new regexps.  */
+      Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
+      Ferase_buffer ();
+      bset_undo_list (current_buffer, Qt);
+      bset_enable_multibyte_characters (current_buffer, multibyte ? Qt : Qnil);
+      if (EQ (workbuf, Vcode_conversion_reused_workbuf))
+	reused_workbuf_in_use = 1;
+      else
+	{
+	  Fset (Fmake_local_variable (Qkill_buffer_query_functions), Qnil);
+	  Fset (Fmake_local_variable (Qkill_buffer_hook), Qnil);
+	}
+      set_buffer_internal (current);
+    }
+
   return workbuf;
 }
 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 05:44:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 01:44:20 2019
Received: from localhost ([127.0.0.1]:57406 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8IPE-0001xT-53
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2019 01:44:20 -0400
Received: from mail-qt1-f177.google.com ([209.85.160.177]:35176)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8IPB-0001xC-J6
 for 31138 <at> debbugs.gnu.org; Mon, 25 Mar 2019 01:44:18 -0400
Received: by mail-qt1-f177.google.com with SMTP id h39so8967772qte.2
 for <31138 <at> debbugs.gnu.org>; Sun, 24 Mar 2019 22:44:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=QZxX4DnUAVMlOolrkGSyiZG1IJ9tWsyuev2kk20Exl8=;
 b=f7jbHlzZbONOcM1okivv2h5AxX0L0c33ew93WLgoEkIZyptim+x1+hf2Bq42r/crov
 dtBEJaSX9Svfo0MhiZLVB22r55jqlc26jvaQ4EXWmPhswop38lIhFZCUyrWiabfcRPDc
 zDOfqOAgt5p2PRlp25tZYWSJ1sOGRxkKhWO6tK9h4uHunvSOih+A995WN2AuGa671vDu
 85AYB2RQjy7abpHJlxzjC2mZX9q3dSA2vTMsIwTeHH4EgRwx7ASWg1RWBSt3Z31Tzd3v
 bxJopMo/SusReT2sPljbrzPDzKcDcVzyW3abKcrtUIvWbfSfLTXV05OkNu2DC0nD5zWu
 ISFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=QZxX4DnUAVMlOolrkGSyiZG1IJ9tWsyuev2kk20Exl8=;
 b=YQZjeY8KWSP2QKDiWUyuIVEru+OThoWLX0FbMx/mNWI2S6wkbLC2rIMZunP4KGjruw
 IphjWdEufYb4dcJnFsnu6G8WJ2rXbq0nYF34S2a0asQYIXnMASrnNcfwWq7CQjEHU8pF
 6QJOzqEH7tDQbRBSYAjGz9jLT3caR2ZqCL2h6LEuBrf8GR8tZVTGG9dgCumzI0BDdXt8
 Ca/BFUPoh6/Qb9RO1drQj1wCafrVu6gORbK3Hhq6mscj/BN9JxaRPY0pg/vlP2wI26GP
 32mIX6FhuryKF8OCyBW60GwezShjJ1xkcyMdEqFWf73VFBSJFMHL1dwiSuUWqzzdovY+
 sqWg==
X-Gm-Message-State: APjAAAUC4WDz7R3IiE7uTPWyBmGe2Xvy4Qe+5qMPeEx1Wp/g9NhfVhz8
 zowYrFMfSaej+PFYv1mwdUm8FaPHOD4P5j2SsRA=
X-Google-Smtp-Source: APXvYqwi3aUe78zFdba5oQGOmCaiOXSm0rHq2Py1/7chs/eCz2xzo8rG3U1Iru0PYie67uyS2csxuankn+e8k71FMcw=
X-Received: by 2002:ac8:13c3:: with SMTP id i3mr18314096qtj.211.1553492651726; 
 Sun, 24 Mar 2019 22:44:11 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 <835zs7och6.fsf@HIDDEN>
In-Reply-To: <835zs7och6.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Mon, 25 Mar 2019 07:44:00 +0200
Message-ID: <CACCVLQU1N9RFdyMt_irVN_7i5Swu_0zKPeKrwz3Nzop3kJWFhw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000aad9e60584e4b124"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000aad9e60584e4b124
Content-Type: text/plain; charset="UTF-8"

Hi Eli,


> Is this with or without the patch I sent?
>

It is with the patch (in the two profiler.el reports, the "kill" hooks are
not present)


>
> > 1. The hooks are not called initially, I am not sure what triggers them.
> This makes the json parsing extremely
> > slow(100 times)
>
> The hooks are not called when decoding strings uses a fixed working
> buffer that is created once and never killed.  Then something in your
> setup causes this single working buffer to become in-use, and Emacs
> then allocates an additional buffer, which is created and killed each
> time we need to decode a string.  Both creating and killing of that
> buffer runs the buffer-list-update-hook.
>

Just found that it is not my setup which triggers the issue bug pressing
C-g during the parsing:

To reproduce:

(benchmark-run 10 (json-parse-string json-string))
(benchmark-run 10000000 (json-parse-string json-string))
(benchmark-run 10 (json-parse-string json-string))

Press C-g when second benchmark-run is processed.


> > 2. Even without the hooks, the JSON parsing is slower than the emacs -q
> native parsing when I am running
> > my setup. This will require additional investigation.
>
> Please, let's first finish fixing the factors we do understand already
> and see what effect that produces.  Otherwise I don't see how we can
> make steady progress in this matter.  That is why I sent an initial,
> most probably incomplete patch.  Please apply it and see what it fixes
> and what it doesn't fix.
>


I did exactly what you are saying here: I applied the patch and listed the
effects:
1. The buffer-list-update-hook is called
2. The patch does not affect the perf difference between emacs -q and my
setup.

> I must rely on you in this matter, because I cannot reproduce the
> slowdown on my system.

I realize that and I am trying to be as helpful as possible by sharing all
my observations.

Thanks,
Ivan

--000000000000aad9e60584e4b124
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>Hi=
 Eli,</div><div><br></div><div class=3D"gmail_quote"><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex"><br>Is this with or without the patch I sent?<b=
r></blockquote><div><br></div><div>It is with the patch (in the=C2=A0two pr=
ofiler.el reports, the &quot;kill&quot; hooks are not present)</div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>&gt; 1. The hooks are not called initially, I am not sure what triggers=
 them. This makes the json parsing extremely<br>&gt; slow(100 times)<br>
<br>The hooks are not called when decoding strings uses a fixed working<br>=
buffer that is created once and never killed.=C2=A0 Then something in your<=
br>setup causes this single working buffer to become in-use, and Emacs<br>t=
hen allocates an additional buffer, which is created and killed each<br>tim=
e we need to decode a string.=C2=A0 Both creating and killing of that<br>bu=
ffer runs the buffer-list-update-hook.<br></blockquote><div><br></div><div>=
Just found that it is not my setup which triggers the issue bug pressing C-=
g during the parsing:</div><div><br></div><div>To reproduce:</div><div><br>=
</div><div><div>(benchmark-run 10 (json-parse-string json-string))</div><di=
v>(benchmark-run 10000000 (json-parse-string json-string))</div><div>(bench=
mark-run 10 (json-parse-string json-string))</div></div><div><br></div><div=
>Press C-g when second benchmark-run is processed.=C2=A0</div><div><br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><br>&gt; 2. Even withou=
t the hooks, the JSON parsing is slower than the emacs -q native parsing wh=
en I am running<br>&gt; my setup. This will require additional investigatio=
n. <br>
<br>Please, let&#39;s first finish fixing the factors we do understand alre=
ady<br>and see what effect that produces.=C2=A0 Otherwise I don&#39;t see h=
ow we can<br>make steady progress in this matter.=C2=A0 That is why I sent =
an initial,<br>most probably incomplete patch.=C2=A0 Please apply it and se=
e what it fixes<br>and what it doesn&#39;t fix.<br></blockquote><div><br></=
div><div><div><br></div><div>I did exactly what you are saying here: I appl=
ied the patch and listed the effects:</div><div>1. The buffer-list-update-h=
ook is called</div><div>2. The patch does not affect the perf difference be=
tween emacs -q and my setup.</div></div><div><br></div><div><div>&gt; I mus=
t rely on you in this matter, because I cannot reproduce the</div><div>&gt;=
 slowdown on my system.</div></div><div><br></div><div>I realize that and I=
 am trying to be as helpful as possible by sharing all my observations.</di=
v><div><br></div><div>Thanks,</div><div>Ivan</div></div></div></div></div><=
/div>

--000000000000aad9e60584e4b124--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 25 Mar 2019 03:32:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 23:32:44 2019
Received: from localhost ([127.0.0.1]:57357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8GLs-0004hX-Ba
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 23:32:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h8GLq-0004hK-CG
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 23:32:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57407)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h8GLj-0003PP-Gr; Sun, 24 Mar 2019 23:32:36 -0400
Received: from [176.228.60.248] (port=2479 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h8GLj-0008Fo-0a; Sun, 24 Mar 2019 23:32:35 -0400
Date: Mon, 25 Mar 2019 05:32:37 +0200
Message-Id: <835zs7och6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
 (message from yyoncho on Sun, 24 Mar 2019 22:57:58 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
 <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 24 Mar 2019 22:57:58 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> From what I can see the Qbuffer_list_update_hook is called.

Is this with or without the patch I sent?

> 1. The hooks are not called initially, I am not sure what triggers them. This makes the json parsing extremely
> slow(100 times)

The hooks are not called when decoding strings uses a fixed working
buffer that is created once and never killed.  Then something in your
setup causes this single working buffer to become in-use, and Emacs
then allocates an additional buffer, which is created and killed each
time we need to decode a string.  Both creating and killing of that
buffer runs the buffer-list-update-hook.

> 2. Even without the hooks, the JSON parsing is slower than the emacs -q native parsing when I am running
> my setup. This will require additional investigation. 

Please, let's first finish fixing the factors we do understand already
and see what effect that produces.  Otherwise I don't see how we can
make steady progress in this matter.  That is why I sent an initial,
most probably incomplete patch.  Please apply it and see what it fixes
and what it doesn't fix.

I must rely on you in this matter, because I cannot reproduce the
slowdown on my system.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 20:58:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 16:58:17 2019
Received: from localhost ([127.0.0.1]:57177 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h8AC8-0003fl-Uw
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 16:58:17 -0400
Received: from mail-qk1-f194.google.com ([209.85.222.194]:36377)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h8AC6-0003fX-JH
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 16:58:15 -0400
Received: by mail-qk1-f194.google.com with SMTP id k130so4186188qke.3
 for <31138 <at> debbugs.gnu.org>; Sun, 24 Mar 2019 13:58:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=qLq7ymcZ1a66v4z+CihkkPyc1YaPM4sBG4r9zWtjQKM=;
 b=FPHUQ0pM3yFm0vZPXUfk040/VLPvBrZkMgAuOmGCHAolUmdmakNXm7TqcCWvdNJ6AY
 RUpoEuUMUCc0G8iDb8Z+xdTSXIDQWbJzUYBvvIe6wSqkqH50LWAvk91UaAQV3XecZCx6
 GOzCMQ/pccWxd0FrokO1Wd22TqZtaI/CPIvo1mdZFS7A8YeYbKaaV3QWUKBV6EBPMuI1
 8mZ4tINgALjvqWt86LDvbV8dmfR68mtRoWtQ/4OEbW4d7Yq9qi8PNQTCPHeJQU//hdfX
 0mq4AxFRopH1YysLER/S4oWWpnRI6JP2mur2mR/ffhfHkJTtuo4GCVtlw4IsDZ26/659
 a8oQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=qLq7ymcZ1a66v4z+CihkkPyc1YaPM4sBG4r9zWtjQKM=;
 b=anGrvRXAhB3avJInO3t0v7EmZwdmPD0uLYXwspBFzhcnD0rCgmsIjwUeSb4+tyW9NA
 8tlsZoJvi92yuVQZKWSHPQPHfycl9cdJOXB7EALLkLimG52wElTiXiXp5efChF5puflE
 MYID+ofBUlkpia/iYtyZXdixU0MF8kWKsPD43ClZUWCpYkqWUS9bjXDPKekj/yavkz1+
 QD0U/84U8oR4RJQGWv2LzutkVHuPxI3f3wG7tJTOEdGWyM0gzaUF8qHko15nO3wBJ5Jc
 bLBNYq9HnX/RaglmVEr8PY67L9g3bM5Pq+e1/1T7T9LWo4uq0wp3hC/cSmo2K44sdLa6
 1lrg==
X-Gm-Message-State: APjAAAVRytCGgOnnZi3eaifPuzQV3bytn7+uMmkPJS05OvgQJ0NCBEWY
 DYAzgFvfS6mWC+QPs+ZrSDrHPsfWuK36tFXUc+c=
X-Google-Smtp-Source: APXvYqwD1/BRRzZA98nDIfGQvyEQtouNfCWp+4u1750gvH4lkH/683LO4QNwDV7KFDI5HhkhS8jwPchuQMcfE3IbpL8=
X-Received: by 2002:a37:4c08:: with SMTP id z8mr16798041qka.32.1553461088978; 
 Sun, 24 Mar 2019 13:58:08 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 <83d0mgnn31.fsf@HIDDEN>
In-Reply-To: <83d0mgnn31.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 24 Mar 2019 22:57:58 +0200
Message-ID: <CACCVLQXUHMWeeHDsepZOfAkQvHO9K1_=Bv7LbV9u1TvQzmMZ5w@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000006189270584dd58c5"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000006189270584dd58c5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

From what I can see the Qbuffer_list_update_hook is called.

- command-execute                                                 865  92%
 - call-interactively                                             865  92%
  - funcall-interactively                                         865  92%
   - eval-defun                                                   865  92%
    - apply                                                       865  92%
     - edebug-eval-defun                                          865  92%
      - eval                                                      865  92%
       - progn                                                    865  92%
        - message                                                 865  92%
         - benchmark-run                                          865  92%
          - let                                                   865  92%
           - list                                                 865  92%
            - benchmark-elapse                                    865  92%
             - let                                                865  92%
              - ignore                                            865  92%
               - json-parse-string                                596  63%
                - run-hooks                                       303  32%
                 - doom-modeline-update-persp-name                116  12%
                  - get-current-persp                             110  11%
                     get-frame-persp                               96  10%
                   + window-persp-set-p                             4   0%
                     #<compiled 0x1594da86eb25>                     1   0%
                 + doom-modeline-set-selected-window                  7   0=
%
                - #<compiled 0x1594da2b4a39>                      268  28%
                 + spacemacs/useful-buffer-p                      245  26%
                 + #<lambda 0x85a9e12ee490302>                     17   1%
                + replace-buffer-in-windows                        21   2%
+ ...                                                              74   7%

I want to share some observations:

1. The hooks are not called initially, I am not sure what triggers them.
This makes the json parsing extremely slow(100 times)
2. Even without the hooks, the JSON parsing is slower than the emacs -q
native parsing when I am running my setup. This will require additional
investigation.

Thanks,
Ivan

On Sun, Mar 24, 2019 at 8:28 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sun, 24 Mar 2019 20:24:35 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > Before starting to test the patch I saw that Fget_buffer_create is
> running Qbuffer_list_update_hook - do we
> > need to do a similar thing for it too?
>
> Maybe, but let's first see if the patch as I sent is already producing
> some positive effect, shall we?
>

--0000000000006189270584dd58c5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: base64

PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+SGkgRWxpLDxkaXY+PGJyPjwvZGl2PjxkaXY+
RnJvbSB3aGF0IEkgY2FuIHNlZSB0aGUgUWJ1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIGlzIGNhbGxl
ZC48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PjxkaXY+LSBjb21tYW5kLWV4ZWN1dGXCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoDg2NcKgIDkyJTwvZGl2PjxkaXY+wqAtIGNhbGwtaW50ZXJhY3RpdmVsecKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgODY1wqAgOTIlPC9kaXY+PGRpdj7CoCAtIGZ1bmNhbGwtaW50ZXJhY3RpdmVsecKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
ODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoC0gZXZhbC1kZWZ1bsKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
ODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoCAtIGFwcGx5wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqA4NjXCoCA5MiU8L2Rpdj48ZGl2PsKgIMKgIMKgLSBlZGVidWctZXZhbC1kZWZ1bsKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIDg2
NcKgIDkyJTwvZGl2PjxkaXY+wqAgwqAgwqAgLSBldmFswqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
ODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoC0gcHJvZ27CoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCA4NjXCoCA5MiU8L2Rpdj48ZGl2PsKgIMKgIMKgIMKgIC0gbWVzc2FnZcKgIMKgIMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoC0gYmVuY2htYXJrLXJ1bsKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IDg2NcKgIDkyJTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAgwqAgLSBsZXTCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoDg2NcKgIDkyJTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAgwqAgwqAtIGxpc3TCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoDg2NcKgIDkyJTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAgwqAgwqAgLSBiZW5jaG1hcmst
ZWxhcHNlwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoC0gbGV0wqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgODY1wqAgOTIlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCAtIGlnbm9yZcKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgIDg2NcKgIDkyJTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAtIGpzb24t
cGFyc2Utc3RyaW5nwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgNTk2wqAgNjMlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCAtIHJ1bi1ob29r
c8KgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgMzAzwqAgMzIlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoC0gZG9vbS1t
b2RlbGluZS11cGRhdGUtcGVyc3AtbmFtZcKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIDExNsKgIDEy
JTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgLSBnZXQtY3VycmVudC1wZXJz
cMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgMTEwwqAgMTElPC9k
aXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGdldC1mcmFtZS1wZXJzcMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgOTbCoCAxMCU8L2Rp
dj48ZGl2PsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgKyB3aW5kb3ctcGVyc3Atc2V0LXDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoDTCoCDCoDAlPC9kaXY+
PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCMmbHQ7Y29tcGlsZWQgMHgxNTk0
ZGE4NmViMjUmZ3Q7wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAxwqAgwqAwJTwvZGl2
PjxkaXY+wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqArIGRvb20tbW9kZWxpbmUtc2V0LXNlbGVj
dGVkLXdpbmRvd8KgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIDfCoCDCoDAlPC9kaXY+PGRpdj7C
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCAtICMmbHQ7Y29tcGlsZWQgMHgxNTk0ZGEyYjRhMzkmZ3Q7
wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgMjY4wqAgMjglPC9kaXY+PGRpdj7CoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCsgc3BhY2VtYWNzL3VzZWZ1bC1idWZmZXItcMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIDI0NcKgIDI2JTwvZGl2PjxkaXY+wqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqArICMmbHQ7bGFtYmRhIDB4ODVhOWUxMmVlNDkwMzAyJmd0O8KgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgMTfCoCDCoDElPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCArIHJlcGxhY2UtYnVmZmVyLWluLXdpbmRvd3PCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCAyMcKgIMKgMiU8L2Rpdj48ZGl2PisgLi4uwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAgwqAgNzTCoCDCoDclPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5J
IHdhbnQgdG8gc2hhcmUgc29tZSBvYnNlcnZhdGlvbnM6PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp
dj4xLiBUaGUgaG9va3MgYXJlIG5vdCBjYWxsZWQgaW5pdGlhbGx5LCBJIGFtIG5vdCBzdXJlIHdo
YXQgdHJpZ2dlcnMgdGhlbS4gVGhpcyBtYWtlcyB0aGUganNvbsKgcGFyc2luZyBleHRyZW1lbHkg
c2xvdygxMDAgdGltZXMpPC9kaXY+PGRpdj4yLiBFdmVuIHdpdGhvdXQgdGhlIGhvb2tzLCB0aGUg
SlNPTiBwYXJzaW5nIGlzIHNsb3dlciB0aGFuIHRoZSBlbWFjcyAtcSBuYXRpdmUgcGFyc2luZyB3
aGVuIEkgYW0gcnVubmluZyBteSBzZXR1cC4gVGhpcyB3aWxsIHJlcXVpcmUgYWRkaXRpb25hbCBp
bnZlc3RpZ2F0aW9uLsKgPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5UaGFua3MsPC9kaXY+PC9k
aXY+PGRpdj5JdmFuPC9kaXY+PC9kaXY+PC9kaXY+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3Rl
Ij48ZGl2IGRpcj0ibHRyIiBjbGFzcz0iZ21haWxfYXR0ciI+T24gU3VuLCBNYXIgMjQsIDIwMTkg
YXQgODoyOCBQTSBFbGkgWmFyZXRza2lpICZsdDs8YSBocmVmPSJtYWlsdG86ZWxpekBnbnUub3Jn
IiB0YXJnZXQ9Il9ibGFuayI+ZWxpekBnbnUub3JnPC9hPiZndDsgd3JvdGU6PGJyPjwvZGl2Pjxi
bG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowcHggMHB4IDBweCAw
LjhleDtib3JkZXItbGVmdDoxcHggc29saWQgcmdiKDIwNCwyMDQsMjA0KTtwYWRkaW5nLWxlZnQ6
MWV4Ij4mZ3Q7IEZyb206IHl5b25jaG8gJmx0OzxhIGhyZWY9Im1haWx0bzp5eW9uY2hvQGdtYWls
LmNvbSIgdGFyZ2V0PSJfYmxhbmsiPnl5b25jaG9AZ21haWwuY29tPC9hPiZndDs8YnI+DQomZ3Q7
IERhdGU6IFN1biwgMjQgTWFyIDIwMTkgMjA6MjQ6MzUgKzAyMDA8YnI+DQomZ3Q7IENjOiBTw6li
YXN0aWVuIENoYXB1aXMgJmx0OzxhIGhyZWY9Im1haWx0bzpzZWJhc3RpZW5AY2hhcHUuaXMiIHRh
cmdldD0iX2JsYW5rIj5zZWJhc3RpZW5AY2hhcHUuaXM8L2E+Jmd0OywgPGJyPg0KJmd0O8KgIMKg
IMKgIMKgPGEgaHJlZj0ibWFpbHRvOjMxMTM4QGRlYmJ1Z3MuZ251Lm9yZyIgdGFyZ2V0PSJfYmxh
bmsiPjMxMTM4QGRlYmJ1Z3MuZ251Lm9yZzwvYT48YnI+DQomZ3Q7IDxicj4NCiZndDsgQmVmb3Jl
IHN0YXJ0aW5nIHRvIHRlc3QgdGhlIHBhdGNoIEkgc2F3IHRoYXQgRmdldF9idWZmZXJfY3JlYXRl
IGlzIHJ1bm5pbmcgUWJ1ZmZlcl9saXN0X3VwZGF0ZV9ob29rIC0gZG8gd2U8YnI+DQomZ3Q7IG5l
ZWQgdG8gZG8gYSBzaW1pbGFyIHRoaW5nIGZvciBpdCB0b28/PGJyPg0KPGJyPg0KTWF5YmUsIGJ1
dCBsZXQmIzM5O3MgZmlyc3Qgc2VlIGlmIHRoZSBwYXRjaCBhcyBJIHNlbnQgaXMgYWxyZWFkeSBw
cm9kdWNpbmc8YnI+DQpzb21lIHBvc2l0aXZlIGVmZmVjdCwgc2hhbGwgd2U/PGJyPg0KPC9ibG9j
a3F1b3RlPjwvZGl2Pg0K
--0000000000006189270584dd58c5--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 18:28:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 14:28:59 2019
Received: from localhost ([127.0.0.1]:57054 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h87re-0008Oe-Sp
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 14:28:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39883)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h87rd-0008OR-IT
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 14:28:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50571)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h87rY-00083E-A8; Sun, 24 Mar 2019 14:28:52 -0400
Received: from [176.228.60.248] (port=4917 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h87rW-0002w5-OM; Sun, 24 Mar 2019 14:28:51 -0400
Date: Sun, 24 Mar 2019 20:28:50 +0200
Message-Id: <83d0mgnn31.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
 (message from yyoncho on Sun, 24 Mar 2019 20:24:35 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
 <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 24 Mar 2019 20:24:35 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> Before starting to test the patch I saw that Fget_buffer_create is running Qbuffer_list_update_hook - do we
> need to do a similar thing for it too?

Maybe, but let's first see if the patch as I sent is already producing
some positive effect, shall we?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 18:24:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 14:24:53 2019
Received: from localhost ([127.0.0.1]:57049 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h87nh-0008Ih-6k
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 14:24:53 -0400
Received: from mail-qt1-f178.google.com ([209.85.160.178]:44577)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h87ng-0008IV-35
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 14:24:52 -0400
Received: by mail-qt1-f178.google.com with SMTP id w5so7870743qtb.11
 for <31138 <at> debbugs.gnu.org>; Sun, 24 Mar 2019 11:24:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=gJhgZRvluNoJZwk0B3HJhQ8UscMUFIOaCENvEiMPkIQ=;
 b=FgFxRe6x7maurcAeF5KWLiXladAq1/eLNrK4idiOTyoUVZ5O/UWUSyck5Ec+nVcNTF
 Qe6Pes7LDdlw8f7DDuLkpqcNrlZ8Uy8KNUUbHDjK+0CSaVNyjhfGORfL7tTFLPyF0jil
 FoCeqkkN8IzXN2qyh1qCGoQaMQexuMAkzoxlL24RuKoCS0g7cdxWgrC9JH+v+BA5Pt0x
 9ZaOnVv9S+PqSg5zqgPtwdCCVcoMF+4EUlnd/RLhxFernIFflNdeMfUZ7eb3NuuTCYoz
 dHQkKnqEKxHxqbbTW6HdzvUki6fmdxOPqHDWvi8S+8cmbn5mypaAL6to0L9yTUch+WSg
 OSLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=gJhgZRvluNoJZwk0B3HJhQ8UscMUFIOaCENvEiMPkIQ=;
 b=qn1XtXG/dohOoSClRXUOVVnQLp5lMUoTmrbX/VGM7N3PGZtIXPHhymStcfasj5CZZY
 RnNCoMwa4T+17JI7K4HfJScGyoTttUhhaJ4L62au8cavNRfmtpTcz85+NJ6jXny+zE2T
 VE4F16WM5gB9uSoCqH00fTnJzWLAB53OvGjeVZ32t9j57ihhAa3oRrY/eZwavzRATnSH
 8u61uE5ZbWxC/tSY/WJ/6YD3XS+k2/Ey+Lo89+/tDUwyUvRgNgBL5OW6tpR3ChhQz5Nb
 qAHqZBRyMZWB0kul+TErM4f6kvqWSlDFzjD53oR0bai7F30/KfEhekmtlR/NaA5W4x+0
 EU1A==
X-Gm-Message-State: APjAAAVg1RZ+Q3LBXKyu7eQvwdIcgZ8UPWN8Zw4m7szACBajMADQpFdb
 skWVX+OIS5HOx1MFUCNDzEksRy8WIBkMJ2nLeD+H76/j
X-Google-Smtp-Source: APXvYqzYYGO7u2mm6Y5cjdlQe54cRkZ2glqGfOuUk84MkVF5AK1P6QzY/m+qwwx5qIF0mf0Ez4u5PHXQrfqZYsS1UWw=
X-Received: by 2002:a0c:d1a6:: with SMTP id e35mr17242186qvh.174.1553451886423; 
 Sun, 24 Mar 2019 11:24:46 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 <83r2awnw0w.fsf@HIDDEN>
In-Reply-To: <83r2awnw0w.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 24 Mar 2019 20:24:35 +0200
Message-ID: <CACCVLQUFsJ+F446NFUO2Ox62eYJXm=1P+h6VkKZp4VjdmMOvbw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ddb2180584db3385"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ddb2180584db3385
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

Before starting to test the patch I saw that Fget_buffer_create is
running Qbuffer_list_update_hook - do we need to do a similar thing for it
too?

Thanks,
Ivan

On Sun, Mar 24, 2019 at 5:15 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sun, 24 Mar 2019 13:37:23 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > After code_convert_string_norecord the callstack is the same as the
> callstack of the JSON parsing (it uses
> > the same method to convert/validate the string).
>
> Got it, thanks.
>
> Please try the patch below and see if it solves the problem in both
> cases.
>
> diff --git a/src/coding.c b/src/coding.c
> index 905c7ce..f9c9dc8 100644
> --- a/src/coding.c
> +++ b/src/coding.c
> @@ -7807,10 +7807,14 @@ make_conversion_work_buffer (bool multibyte)
>    Lisp_Object name, workbuf;
>    struct buffer *current;
>
> +  current =3D current_buffer;
>    if (reused_workbuf_in_use)
>      {
>        name =3D Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name,
> Qnil);
>        workbuf =3D Fget_buffer_create (name);
> +      set_buffer_internal (XBUFFER (workbuf));
> +      Fset (Fmake_local_variable (Qkill_buffer_query_functions), Qnil);
> +      Fset (Fmake_local_variable (Qkill_buffer_hook), Qnil);
>      }
>    else
>      {
> @@ -7819,9 +7823,8 @@ make_conversion_work_buffer (bool multibyte)
>         Vcode_conversion_reused_workbuf
>           =3D Fget_buffer_create (Vcode_conversion_workbuf_name);
>        workbuf =3D Vcode_conversion_reused_workbuf;
> +      set_buffer_internal (XBUFFER (workbuf));
>      }
> -  current =3D current_buffer;
> -  set_buffer_internal (XBUFFER (workbuf));
>    /* We can't allow modification hooks to run in the work buffer.  For
>       instance, directory_files_internal assumes that file decoding
>       doesn't compile new regexps.  */
>

--000000000000ddb2180584db3385
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Hi Eli,<div><br></div><d=
iv>Before starting to test the patch I saw that=C2=A0Fget_buffer_create is =
running=C2=A0Qbuffer_list_update_hook - do we need to do a similar thing fo=
r it too?</div><div><br></div><div>Thanks,<br></div><div>Ivan</div></div></=
div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_at=
tr">On Sun, Mar 24, 2019 at 5:15 PM Eli Zaretskii &lt;<a href=3D"mailto:eli=
z@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"=
mailto:yyoncho@HIDDEN" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Sun, 24 Mar 2019 13:37:23 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; After code_convert_string_norecord the callstack is the same as the ca=
llstack of the JSON parsing (it uses<br>
&gt; the same method to convert/validate the string).=C2=A0 <br>
<br>
Got it, thanks.<br>
<br>
Please try the patch below and see if it solves the problem in both<br>
cases.<br>
<br>
diff --git a/src/coding.c b/src/coding.c<br>
index 905c7ce..f9c9dc8 100644<br>
--- a/src/coding.c<br>
+++ b/src/coding.c<br>
@@ -7807,10 +7807,14 @@ make_conversion_work_buffer (bool multibyte)<br>
=C2=A0 =C2=A0Lisp_Object name, workbuf;<br>
=C2=A0 =C2=A0struct buffer *current;<br>
<br>
+=C2=A0 current =3D current_buffer;<br>
=C2=A0 =C2=A0if (reused_workbuf_in_use)<br>
=C2=A0 =C2=A0 =C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0name =3D Fgenerate_new_buffer_name (Vcode_conver=
sion_workbuf_name, Qnil);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0workbuf =3D Fget_buffer_create (name);<br>
+=C2=A0 =C2=A0 =C2=A0 set_buffer_internal (XBUFFER (workbuf));<br>
+=C2=A0 =C2=A0 =C2=A0 Fset (Fmake_local_variable (Qkill_buffer_query_functi=
ons), Qnil);<br>
+=C2=A0 =C2=A0 =C2=A0 Fset (Fmake_local_variable (Qkill_buffer_hook), Qnil)=
;<br>
=C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0else<br>
=C2=A0 =C2=A0 =C2=A0{<br>
@@ -7819,9 +7823,8 @@ make_conversion_work_buffer (bool multibyte)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Vcode_conversion_reused_workbuf<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D Fget_buffer_create (Vcode_conversion=
_workbuf_name);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0workbuf =3D Vcode_conversion_reused_workbuf;<br>
+=C2=A0 =C2=A0 =C2=A0 set_buffer_internal (XBUFFER (workbuf));<br>
=C2=A0 =C2=A0 =C2=A0}<br>
-=C2=A0 current =3D current_buffer;<br>
-=C2=A0 set_buffer_internal (XBUFFER (workbuf));<br>
=C2=A0 =C2=A0/* We can&#39;t allow modification hooks to run in the work bu=
ffer.=C2=A0 For<br>
=C2=A0 =C2=A0 =C2=A0 instance, directory_files_internal assumes that file d=
ecoding<br>
=C2=A0 =C2=A0 =C2=A0 doesn&#39;t compile new regexps.=C2=A0 */<br>
</blockquote></div>

--000000000000ddb2180584db3385--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 15:15:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 11:15:50 2019
Received: from localhost ([127.0.0.1]:56939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h84qj-0006c3-Tp
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 11:15:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41293)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h84qi-0006Uw-CW
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 11:15:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48163)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h84qc-0004gY-U0; Sun, 24 Mar 2019 11:15:42 -0400
Received: from [176.228.60.248] (port=4509 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h84qc-0006U6-9R; Sun, 24 Mar 2019 11:15:42 -0400
Date: Sun, 24 Mar 2019 17:15:43 +0200
Message-Id: <83r2awnw0w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
 (message from yyoncho on Sun, 24 Mar 2019 13:37:23 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
 <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sun, 24 Mar 2019 13:37:23 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> After code_convert_string_norecord the callstack is the same as the callstack of the JSON parsing (it uses
> the same method to convert/validate the string).  

Got it, thanks.

Please try the patch below and see if it solves the problem in both
cases.

diff --git a/src/coding.c b/src/coding.c
index 905c7ce..f9c9dc8 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7807,10 +7807,14 @@ make_conversion_work_buffer (bool multibyte)
   Lisp_Object name, workbuf;
   struct buffer *current;
 
+  current = current_buffer;
   if (reused_workbuf_in_use)
     {
       name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
       workbuf = Fget_buffer_create (name);
+      set_buffer_internal (XBUFFER (workbuf));
+      Fset (Fmake_local_variable (Qkill_buffer_query_functions), Qnil);
+      Fset (Fmake_local_variable (Qkill_buffer_hook), Qnil);
     }
   else
     {
@@ -7819,9 +7823,8 @@ make_conversion_work_buffer (bool multibyte)
 	Vcode_conversion_reused_workbuf
 	  = Fget_buffer_create (Vcode_conversion_workbuf_name);
       workbuf = Vcode_conversion_reused_workbuf;
+      set_buffer_internal (XBUFFER (workbuf));
     }
-  current = current_buffer;
-  set_buffer_internal (XBUFFER (workbuf));
   /* We can't allow modification hooks to run in the work buffer.  For
      instance, directory_files_internal assumes that file decoding
      doesn't compile new regexps.  */




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 11:37:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 07:37:43 2019
Received: from localhost ([127.0.0.1]:56078 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h81Re-0004oC-Qt
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 07:37:43 -0400
Received: from mail-qt1-f181.google.com ([209.85.160.181]:40945)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h81Rc-0004nw-Tb
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 07:37:41 -0400
Received: by mail-qt1-f181.google.com with SMTP id x12so7307444qts.7
 for <31138 <at> debbugs.gnu.org>; Sun, 24 Mar 2019 04:37:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=AmV5wVFzkC+GYyWFiQ2rZXgsl8MmKWpGKQo9cGWvHns=;
 b=PQPsrU8QZThln1cTRDkMgDUtowgQXE+QoG1yZvQlaK15OXLs7gLzj+jqeyeUeSD/yt
 NyCoOmQ/ZYVHOaOTSG5QA+ltTmpsRmtqqiQA+op5bG9Ce0Cv7jw77BVEgceODvW8/gjw
 wiLgMYlexShUY2hKI0n8UEv7oNW9fs3PqjiRv9cA2c4/ENldaPDfMA0ZHkImZFwujaV4
 uDregl2YlnI5coUGYm9AjxoxrJ+RJT/lgs42zyPGlAoUw+h010419798dvwjZeRRK6M1
 Ik0sqep7YAa1yxV8AJajtAkp8NEx64VmFmvxb12veEaA9p64HRMVfQa7OwIsT+CwSz21
 iwdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=AmV5wVFzkC+GYyWFiQ2rZXgsl8MmKWpGKQo9cGWvHns=;
 b=rx/WYE3JTCuPtB/TY1pYZo+cKPn1l1BH2qOryAROG00VfyiUrdLlWPxf/oiC3+UC3d
 jJM6c+t47aLK42mgnKrrP1uY0R+N7y5W2LJ+o+0CjqEkESfaFZr419V8SwvXc189EbYH
 5eWO9eg5WInDhNCargIiM8X94J/2WYS0I1H3ocTORVzfjeCSvV2s0BbKrmQghyBjuJNk
 U7p9tNIU5QvUisaeUzaSGxLVxsefhrEdsyoqK3sxY1SKW16ejE4EMwEGtY7qE/zXbGPO
 htQ5s0gFLORQE3lMgzwEFclDjwMMgWeyqSX27EuUxjUxIX0OJ5vXuwGVkpiEwvlWeWLX
 I3ng==
X-Gm-Message-State: APjAAAXGQZiY+KK9JMt3jhnzetnSPyjT+sBbokUMVhjaMRZ8BjvoEXfI
 A7vTcAQzTW2ulHH9Cqkwue1OgNOMzNfnDp3UhgE=
X-Google-Smtp-Source: APXvYqz80kjwhQKZsXUBsyh9HYIsJNxrOdzQy3MgK0aj76QeZdZp9OfMewP6hAivCC64AhoXqpjHqKKvx2Xy0HBTQHg=
X-Received: by 2002:a0c:bd2d:: with SMTP id m45mr10715733qvg.229.1553427455230; 
 Sun, 24 Mar 2019 04:37:35 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
 <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
In-Reply-To: <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 24 Mar 2019 13:37:23 +0200
Message-ID: <CACCVLQXMN9oXZnNZR9bUAOVbzPQR_N1hCghRSSeCmJC5-1e41g@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000a747af0584d58366"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000a747af0584d58366
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

After code_convert_string_norecord the callstack is the same as the
callstack of the JSON parsing (it uses the same method to convert/validate
the string).



On Sun, 24 Mar 2019, 13:20 Eli Zaretskii, <eliz@HIDDEN> wrote:

> On March 24, 2019 11:35:25 AM GMT+02:00, yyoncho <yyoncho@HIDDEN>
> wrote:
> > Hi Eli,
> >
> > The callstack is pretty much the same, here are the relevant parts:
> >
> >    [-] code_convert_string_norecord@0x000055555565e30d (coding.c:9488)
> >     [-] module_make_string@0x00005555557d8f0d (emacs-module.c:597)
> >     [-] emacs::convert::<impl emacs::IntoLisp<=E2=80=99e> for &=E2=80=
=99a
> > T>::into_lisp@0x00007fffdeafe8c1 (Unknown source)
> >   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0117e (Unknown source)
> >   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
> >   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb012b3 (Unknown source)
> >   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
> >   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
> >   [-] emacs_json_lsp::parse_string@0x00007fffdeb019a9 (Unknown source)
> >   [-] std::panicking::try::do_call@0x00007fffdeb02a9f (Unknown source)
> >  [-] __rust_maybe_catch_panic@0x00007fffdeb2f26a (src/libpanic_unwind/
> > lib.rs:102)
> >     [-] <emacs::CallEnv as
> > emacs::func::HandleCall>::handle_call@0x00007fffdeb0277a (Unknown
> > source)
> >    [-] emacs_json_lsp::init::extern_lambda@0x00007fffdeb01cc4 (Unknown
> > source)
> >
> > Thanks,
> > Ivan
> >
> > On Sun, Mar 24, 2019 at 5:32 AM Eli Zaretskii <eliz@HIDDEN> wrote:
> >
> > > > From: yyoncho <yyoncho@HIDDEN>
> > > > Date: Sat, 23 Mar 2019 23:04:18 +0200
> > > > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> > > >       31138 <at> debbugs.gnu.org
> > > >
> > > > I will try with run-hooks =3D nil. (I still cannot reproduce the
> > issue
> > > consistently). As a side note, I think that similar
> > > > issue affects emacs dynamic modules based on my limited testing.
> > Please
> > > reply back if you need a callstack.
> > >
> > > Yes, a callstack in the case of modules would be helpful (although I
> > > think I can guess where it will point).
> > >
> > > Thanks.
> > >
>
> Thanks, but where is the call to the hook which iscthe source of the
> problem?  I don't even see Fkill_buffer in the backtrace.  What am I
> missing?
>

--000000000000a747af0584d58366
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>After=C2=A0<span style=3D"font-family:sans-serif">co=
de_convert_string_norecord</span>=C2=A0the callstack is the same as the cal=
lstack of the JSON parsing (it uses the same method to convert/validate the=
 string).=C2=A0=C2=A0<div dir=3D"auto"><br></div><br><br><div class=3D"gmai=
l_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 24 Mar 2019, 13:20 E=
li Zaretskii, &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank" rel=3D"=
noreferrer">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex">On March 24, 2019 11:35:25 AM GMT+02:00, yyoncho &lt;<a href=3D"mailto=
:yyoncho@HIDDEN" rel=3D"noreferrer noreferrer" target=3D"_blank">yyoncho=
@gmail.com</a>&gt; wrote:<br>
&gt; Hi Eli,<br>
&gt; <br>
&gt; The callstack is pretty much the same, here are the relevant parts:<br=
>
&gt; <br>
&gt;=C2=A0 =C2=A0 [-] code_convert_string_norecord@0x000055555565e30d (codi=
ng.c:9488)<br>
&gt;=C2=A0 =C2=A0 =C2=A0[-] module_make_string@0x00005555557d8f0d (emacs-mo=
dule.c:597)<br>
&gt;=C2=A0 =C2=A0 =C2=A0[-] emacs::convert::&lt;impl emacs::IntoLisp&lt;=E2=
=80=99e&gt; for &amp;=E2=80=99a<br>
&gt; T&gt;::into_lisp@0x00007fffdeafe8c1 (Unknown source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0117e (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::json_to_lisp@0x00007fffdeb012b3 (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] emacs_json_lsp::parse_string@0x00007fffdeb019a9 (Unkno=
wn source)<br>
&gt;=C2=A0 =C2=A0[-] std::panicking::try::do_call@0x00007fffdeb02a9f (Unkno=
wn source)<br>
&gt;=C2=A0 [-] __rust_maybe_catch_panic@0x00007fffdeb2f26a (src/libpanic_un=
wind/<br>
&gt; <a href=3D"http://lib.rs:102" rel=3D"noreferrer noreferrer noreferrer"=
 target=3D"_blank">lib.rs:102</a>)<br>
&gt;=C2=A0 =C2=A0 =C2=A0[-] &lt;emacs::CallEnv as<br>
&gt; emacs::func::HandleCall&gt;::handle_call@0x00007fffdeb0277a (Unknown<b=
r>
&gt; source)<br>
&gt;=C2=A0 =C2=A0 [-] emacs_json_lsp::init::extern_lambda@0x00007fffdeb01cc=
4 (Unknown<br>
&gt; source)<br>
&gt; <br>
&gt; Thanks,<br>
&gt; Ivan<br>
&gt; <br>
&gt; On Sun, Mar 24, 2019 at 5:32 AM Eli Zaretskii &lt;<a href=3D"mailto:el=
iz@HIDDEN" rel=3D"noreferrer noreferrer" target=3D"_blank">eliz@HIDDEN</a=
>&gt; wrote:<br>
&gt; <br>
&gt; &gt; &gt; From: yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN" rel=
=3D"noreferrer noreferrer" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; &gt; &gt; Date: Sat, 23 Mar 2019 23:04:18 +0200<br>
&gt; &gt; &gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@c=
hapu.is" rel=3D"noreferrer noreferrer" target=3D"_blank">sebastien@HIDDEN=
</a>&gt;,<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138@HIDDEN=
u.org" rel=3D"noreferrer noreferrer" target=3D"_blank">31138@HIDDEN=
g</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I will try with run-hooks =3D nil. (I still cannot reproduce=
 the<br>
&gt; issue<br>
&gt; &gt; consistently). As a side note, I think that similar<br>
&gt; &gt; &gt; issue affects emacs dynamic modules based on my limited test=
ing.<br>
&gt; Please<br>
&gt; &gt; reply back if you need a callstack.<br>
&gt; &gt;<br>
&gt; &gt; Yes, a callstack in the case of modules would be helpful (althoug=
h I<br>
&gt; &gt; think I can guess where it will point).<br>
&gt; &gt;<br>
&gt; &gt; Thanks.<br>
&gt; &gt;<br>
<br>
Thanks, but where is the call to the hook which iscthe source of the proble=
m?=C2=A0 I don&#39;t even see Fkill_buffer in the backtrace.=C2=A0 What am =
I missing?<br>
</blockquote></div></div></div>

--000000000000a747af0584d58366--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 11:21:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 07:21:05 2019
Received: from localhost ([127.0.0.1]:56073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h81BZ-0002Mv-Ad
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 07:21:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43874)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h81BX-0002M7-1M
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 07:21:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45723)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h81BR-00061J-Db; Sun, 24 Mar 2019 07:20:57 -0400
Received: from [176.12.194.127] (port=34959 helo=[10.211.85.128])
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h81BQ-0001eK-Jr; Sun, 24 Mar 2019 07:20:57 -0400
Date: Sun, 24 Mar 2019 13:20:53 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
 <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#31138: Native json slower than json.el
To: yyoncho <yyoncho@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <40DA9396-044E-4D00-946E-42B776B51BFA@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?ISO-8859-1?Q?S=E9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On March 24, 2019 11:35:25 AM GMT+02:00, yyoncho <yyoncho@gmail=2Ecom> wrot=
e:
> Hi Eli,
>=20
> The callstack is pretty much the same, here are the relevant parts:
>=20
>    [-] code_convert_string_norecord@0x000055555565e30d (coding=2Ec:9488)
>     [-] module_make_string@0x00005555557d8f0d (emacs-module=2Ec:597)
>     [-] emacs::convert::<impl emacs::IntoLisp<=E2=80=99e> for &=E2=80=99=
a
> T>::into_lisp@0x00007fffdeafe8c1 (Unknown source)
>   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0117e (Unknown source)
>   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
>   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb012b3 (Unknown source)
>   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
>   [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
>   [-] emacs_json_lsp::parse_string@0x00007fffdeb019a9 (Unknown source)
>   [-] std::panicking::try::do_call@0x00007fffdeb02a9f (Unknown source)
>  [-] __rust_maybe_catch_panic@0x00007fffdeb2f26a (src/libpanic_unwind/
> lib=2Ers:102)
>     [-] <emacs::CallEnv as
> emacs::func::HandleCall>::handle_call@0x00007fffdeb0277a (Unknown
> source)
>    [-] emacs_json_lsp::init::extern_lambda@0x00007fffdeb01cc4 (Unknown
> source)
>=20
> Thanks,
> Ivan
>=20
> On Sun, Mar 24, 2019 at 5:32 AM Eli Zaretskii <eliz@gnu=2Eorg> wrote:
>=20
> > > From: yyoncho <yyoncho@gmail=2Ecom>
> > > Date: Sat, 23 Mar 2019 23:04:18 +0200
> > > Cc: S=C3=A9bastien Chapuis <sebastien@chapu=2Eis>,
> > >       31138@debbugs=2Egnu=2Eorg
> > >
> > > I will try with run-hooks =3D nil=2E (I still cannot reproduce the
> issue
> > consistently)=2E As a side note, I think that similar
> > > issue affects emacs dynamic modules based on my limited testing=2E
> Please
> > reply back if you need a callstack=2E
> >
> > Yes, a callstack in the case of modules would be helpful (although I
> > think I can guess where it will point)=2E
> >
> > Thanks=2E
> >

Thanks, but where is the call to the hook which iscthe source of the probl=
em?  I don't even see Fkill_buffer in the backtrace=2E  What am I missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 09:35:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 24 05:35:45 2019
Received: from localhost ([127.0.0.1]:56003 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7zXc-00086D-GP
	for submit <at> debbugs.gnu.org; Sun, 24 Mar 2019 05:35:45 -0400
Received: from mail-qt1-f179.google.com ([209.85.160.179]:44850)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7zXZ-00085y-UJ
 for 31138 <at> debbugs.gnu.org; Sun, 24 Mar 2019 05:35:42 -0400
Received: by mail-qt1-f179.google.com with SMTP id w5so7132837qtb.11
 for <31138 <at> debbugs.gnu.org>; Sun, 24 Mar 2019 02:35:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=nuWIMEnUjII03DLbG3GZsiJCulm3gn89pMgBR0rSPD4=;
 b=gxkYXPg4PRanbvQlYCThDNdU4flUYQlQEeqyFlO7bd/JTKWeJ4WV8zeaHUNPWvre8+
 MuqStYA/z0O9Gh4orf5afYBr0MrqZQYfHnzJQr/1iSsQKnwcbqCnjQILmL1tsr587x43
 rMUJBqJEerxHeaNhExxYIKVcgtcbYf5NjNLX1Rd3s0i5hQWv8fNFuksEqgYoREVx3ykH
 yX31/QcDKWAAerOemRTVR/sa4TMIDlZwhL0fcmp4Aa0tJHxJ3hGdXruSv0f5NbDNiYu2
 bZWAaAxPKRBCvKVMG1k3SKCG1QHyb+14bHOvg5BwK/zOc+MlsDdAqsdQkJu+41+Gozrr
 uziA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=nuWIMEnUjII03DLbG3GZsiJCulm3gn89pMgBR0rSPD4=;
 b=LhGCyS+S3ipVcWfWDZbcu1R/HzImf+xARSxjSoK/PR1WIA351iupVQg2LtLJBAIeT6
 j+j4iuqHx8IAL340BS1KxOvLnRGQBPgEsPAExO/CanmU17lZQWyBCwsSqqcEfAhgdy05
 dYIp5mBQnLNMSyrehiR+BO0gG3CH7/pUyJMlneUmzs9icQRW6WF6uaJnP4Rk1/TDwPpx
 yAntmCmcoeMi2adfbuaXQXsPxugIN/Duzaz8lKGO/DRHHQVkITBOn7bdavQYJFDV2bCX
 lee+nkZ5xzqXLwLJDrA32QSA76SyMR+NRpqcNyXAIdFFigFHLXhr4sPD8L+PFrgSdn+4
 vJKQ==
X-Gm-Message-State: APjAAAX1YVqZciL0x5NKMi+hrCakYhmTu3JDnV7jgjzd4RMEPpTxJ1zk
 xM7jxLYQR5Bokx/csW5EENA9O0gQNk1pRQG+RY8=
X-Google-Smtp-Source: APXvYqxuMYsyadefwAgQTwlQ7pfnuwRSIVZazxw2bR9D1ktwFxJwDSqjVK0adP9MgT2QlI8nshXslLoSrfDnbwLbIko=
X-Received: by 2002:ac8:2273:: with SMTP id p48mr15500521qtp.7.1553420136454; 
 Sun, 24 Mar 2019 02:35:36 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 <83tvftne0j.fsf@HIDDEN>
In-Reply-To: <83tvftne0j.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sun, 24 Mar 2019 11:35:25 +0200
Message-ID: <CACCVLQUW=Kg6Wd2AmYaRfJu0phP2bjAOEsR49fJhp+XajHNpRw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000006b9f6c0584d3cf14"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000006b9f6c0584d3cf14
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

The callstack is pretty much the same, here are the relevant parts:

    [-] code_convert_string_norecord@0x000055555565e30d (coding.c:9488)
    [-] module_make_string@0x00005555557d8f0d (emacs-module.c:597)
    [-] emacs::convert::<impl emacs::IntoLisp<=E2=80=99e> for &=E2=80=99a
T>::into_lisp@0x00007fffdeafe8c1 (Unknown source)
    [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0117e (Unknown source)
    [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
    [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb012b3 (Unknown source)
    [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
    [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)
    [-] emacs_json_lsp::parse_string@0x00007fffdeb019a9 (Unknown source)
    [-] std::panicking::try::do_call@0x00007fffdeb02a9f (Unknown source)
    [-] __rust_maybe_catch_panic@0x00007fffdeb2f26a (src/libpanic_unwind/
lib.rs:102)
    [-] <emacs::CallEnv as
emacs::func::HandleCall>::handle_call@0x00007fffdeb0277a (Unknown source)
    [-] emacs_json_lsp::init::extern_lambda@0x00007fffdeb01cc4 (Unknown
source)

Thanks,
Ivan

On Sun, Mar 24, 2019 at 5:32 AM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sat, 23 Mar 2019 23:04:18 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > I will try with run-hooks =3D nil. (I still cannot reproduce the issue
> consistently). As a side note, I think that similar
> > issue affects emacs dynamic modules based on my limited testing. Please
> reply back if you need a callstack.
>
> Yes, a callstack in the case of modules would be helpful (although I
> think I can guess where it will point).
>
> Thanks.
>

--0000000000006b9f6c0584d3cf14
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi Eli,<div><br></div><div>The callstack =
is pretty much the same, here are the relevant parts:</div><div><br></div><=
div><div>=C2=A0 =C2=A0 [-] code_convert_string_norecord@0x000055555565e30d =
(coding.c:9488)<br></div><div>=C2=A0 =C2=A0 [-] module_make_string@0x000055=
55557d8f0d (emacs-module.c:597)</div><div>=C2=A0 =C2=A0 [-] emacs::convert:=
:&lt;impl emacs::IntoLisp&lt;=E2=80=99e&gt; for &amp;=E2=80=99a T&gt;::into=
_lisp@0x00007fffdeafe8c1 (Unknown source)</div><div>=C2=A0 =C2=A0 [-] emacs=
_json_lsp::json_to_lisp@0x00007fffdeb0117e (Unknown source)</div><div>=C2=
=A0 =C2=A0 [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown sou=
rce)</div><div>=C2=A0 =C2=A0 [-] emacs_json_lsp::json_to_lisp@0x00007fffdeb=
012b3 (Unknown source)</div><div>=C2=A0 =C2=A0 [-] emacs_json_lsp::json_to_=
lisp@0x00007fffdeb0169f (Unknown source)</div><div>=C2=A0 =C2=A0 [-] emacs_=
json_lsp::json_to_lisp@0x00007fffdeb0169f (Unknown source)</div><div>=C2=A0=
 =C2=A0 [-] emacs_json_lsp::parse_string@0x00007fffdeb019a9 (Unknown source=
)</div><div>=C2=A0 =C2=A0 [-] std::panicking::try::do_call@0x00007fffdeb02a=
9f (Unknown source)</div><div>=C2=A0 =C2=A0 [-] __rust_maybe_catch_panic@0x=
00007fffdeb2f26a (src/libpanic_unwind/<a href=3D"http://lib.rs:102">lib.rs:=
102</a>)</div><div>=C2=A0 =C2=A0 [-] &lt;emacs::CallEnv as emacs::func::Han=
dleCall&gt;::handle_call@0x00007fffdeb0277a (Unknown source)</div><div>=C2=
=A0 =C2=A0 [-] emacs_json_lsp::init::extern_lambda@0x00007fffdeb01cc4 (Unkn=
own source)</div><div><br></div><div>Thanks,<br></div><div>Ivan</div></div>=
</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_=
attr">On Sun, Mar 24, 2019 at 5:32 AM Eli Zaretskii &lt;<a href=3D"mailto:e=
liz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mailto:yyoncho@g=
mail.com" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 23 Mar 2019 23:04:18 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; I will try with run-hooks =3D nil. (I still cannot reproduce the issue=
 consistently). As a side note, I think that similar<br>
&gt; issue affects emacs dynamic modules based on my limited testing. Pleas=
e reply back if you need a callstack.<br>
<br>
Yes, a callstack in the case of modules would be helpful (although I<br>
think I can guess where it will point).<br>
<br>
Thanks.<br>
</blockquote></div>

--0000000000006b9f6c0584d3cf14--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 24 Mar 2019 03:32:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 23:32:36 2019
Received: from localhost ([127.0.0.1]:55957 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7tsB-0007Ur-OP
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 23:32:35 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47688)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h7ts9-0007Uf-Ry
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 23:32:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42458)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h7ts4-00030w-6u; Sat, 23 Mar 2019 23:32:28 -0400
Received: from [176.228.60.248] (port=1217 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h7ts3-0002b4-NX; Sat, 23 Mar 2019 23:32:28 -0400
Date: Sun, 24 Mar 2019 05:32:28 +0200
Message-Id: <83tvftne0j.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
 (message from yyoncho on Sat, 23 Mar 2019 23:04:18 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
 <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sat, 23 Mar 2019 23:04:18 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> I will try with run-hooks = nil. (I still cannot reproduce the issue consistently). As a side note, I think that similar
> issue affects emacs dynamic modules based on my limited testing. Please reply back if you need a callstack.

Yes, a callstack in the case of modules would be helpful (although I
think I can guess where it will point).

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 21:04:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 17:04:36 2019
Received: from localhost ([127.0.0.1]:55831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7noi-0006Qu-MG
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 17:04:36 -0400
Received: from mail-qt1-f172.google.com ([209.85.160.172]:33332)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7noh-0006Qi-Fd
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 17:04:35 -0400
Received: by mail-qt1-f172.google.com with SMTP id k14so6400091qtb.0
 for <31138 <at> debbugs.gnu.org>; Sat, 23 Mar 2019 14:04:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=AoP5SzZiG8lR43VoImmqZDrIF6ivDgAKd6putmYfCbA=;
 b=NkveYeDMyWL+TNcBVTxg5he15Gv/QUabrBvNsWiwsVbZzrLGRuCWCg2Fgc3gM3X0g/
 6RTP/FrGAN4s1BtA0KMF2/1f0p92oep/vrMv3UpGN78fHxFpNFAkiGMmlk3VZ7GbnsSQ
 azN0acOes2zzVmb6jQQBl9QKLp8FHPP/YA1q/LYF2W127pSeSs/FC0ql3s9mYcJ5ws5h
 1jmGAK+3Zd4sxeyVPchZBTzxVZWqWX+xlYhOOzA3DyPzVkLQYcimPpW++MQemgdd/bsU
 ZYqUWhlwI6F99+EBr6rusV7L7Xrb4iYna0T0Xq6D0j4ZDdEnBM06b4QmHW5IFq9X6hZp
 5HMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=AoP5SzZiG8lR43VoImmqZDrIF6ivDgAKd6putmYfCbA=;
 b=BW94HnzLRbXP/VZi4YBj4Yuw03NlRyjSr/hqXX37fkBd8LrLhqZL00spy1Ka3/tSAK
 4AfdJ1jpgVGlp0Mv2LL7xWw2mB+vTQZ08+mi3ZB+IeALiaC7d1k215f5b43xDNh/iUvT
 gJBeUfUKDfexbRtu+dfRslX36v5rDYnelsbnFsLXtBtsaYAn+amU+KqlqZJWmVjAcT1h
 QCaBHM/YfavmFYSK34sk50LmGU+h6jkKuPzPAdLtdkBkfa8D0/gRuL/CDPIAWCm8CM1N
 S22cYg59N5r2ooaWZiIscDq9l3gK3u4wCrGKyhPAV9XY+C5wx7K+mAYNZQPDJKh2/2+A
 oPFA==
X-Gm-Message-State: APjAAAVJpRro1Tq6de08h1S/1VfQ0e2iXO29JdfPbxZCLlkte5yqhv8g
 r7uPZsuS060oS0Z02EOvommiVpohFDhXWji5ELg=
X-Google-Smtp-Source: APXvYqyj5faMxyWAGrz/muE1CLleciKLt9qrksaPHXf/79JMfx9kWXVNIyTWM0tcDMpakjxnEzrHzd5I60nu4A9kOfU=
X-Received: by 2002:a0c:814d:: with SMTP id 71mr3864137qvc.47.1553375070060;
 Sat, 23 Mar 2019 14:04:30 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 <83va09nwg3.fsf@HIDDEN>
In-Reply-To: <83va09nwg3.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sat, 23 Mar 2019 23:04:18 +0200
Message-ID: <CACCVLQWjmNRAmoB6prVgv+8UPR3wUL6ySMTkip+=30s-9K2i=Q@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000004105780584c951f6"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000004105780584c951f6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

HI Eli,

I will try with run-hooks =3D nil. (I still cannot reproduce the issue
consistently). As a side note, I think that similar issue affects emacs
dynamic modules based on my limited testing. Please reply back if you need
a callstack.

Thanks,
Ivan


On Sat, Mar 23, 2019 at 10:54 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sat, 23 Mar 2019 22:23:49 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > Here it is the offending callstack.
> >
> > https://gist.github.com/yyoncho/7032464b456f60270100c747f42885f8
>
> OK, thanks.  I think I see the reason.
>
> Does it work for you to bind run-hooks to nil around calls to
> json-parse-string?
>

--0000000000004105780584c951f6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">HI Eli,<div><br></div><div>I will try with run-hooks =3D n=
il. (I still cannot reproduce the issue consistently). As a side note, I th=
ink that similar issue affects emacs dynamic modules based on my limited te=
sting. Please reply back if you need a callstack.=C2=A0</div><div><br></div=
><div>Thanks,</div><div>Ivan</div><div><br></div></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 23, 2019 at 10=
:54 PM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&g=
t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; F=
rom: yyoncho &lt;<a href=3D"mailto:yyoncho@HIDDEN" target=3D"_blank">yyo=
ncho@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 23 Mar 2019 22:23:49 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; Here it is the offending callstack. <br>
&gt; <br>
&gt; <a href=3D"https://gist.github.com/yyoncho/7032464b456f60270100c747f42=
885f8" rel=3D"noreferrer" target=3D"_blank">https://gist.github.com/yyoncho=
/7032464b456f60270100c747f42885f8</a><br>
<br>
OK, thanks.=C2=A0 I think I see the reason.<br>
<br>
Does it work for you to bind run-hooks to nil around calls to<br>
json-parse-string?<br>
</blockquote></div>

--0000000000004105780584c951f6--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 20:54:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 16:54:31 2019
Received: from localhost ([127.0.0.1]:55817 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7nex-0006AB-1K
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 16:54:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h7nev-00069z-Kl
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 16:54:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38910)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h7nep-0007Ty-Id; Sat, 23 Mar 2019 16:54:23 -0400
Received: from [176.228.60.248] (port=4544 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h7neo-0001Pw-Qh; Sat, 23 Mar 2019 16:54:23 -0400
Date: Sat, 23 Mar 2019 22:54:20 +0200
Message-Id: <83va09nwg3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
 (message from yyoncho on Sat, 23 Mar 2019 22:23:49 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
 <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sat, 23 Mar 2019 22:23:49 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> Here it is the offending callstack. 
> 
> https://gist.github.com/yyoncho/7032464b456f60270100c747f42885f8

OK, thanks.  I think I see the reason.

Does it work for you to bind run-hooks to nil around calls to
json-parse-string?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 20:24:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 16:24:09 2019
Received: from localhost ([127.0.0.1]:55803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7nBY-0005LI-Tl
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 16:24:09 -0400
Received: from mail-qt1-f182.google.com ([209.85.160.182]:47023)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7nBX-0005Ks-2P
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 16:24:07 -0400
Received: by mail-qt1-f182.google.com with SMTP id z17so6238902qts.13
 for <31138 <at> debbugs.gnu.org>; Sat, 23 Mar 2019 13:24:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=BEsL1FaFC0QPJvcJ8r4GYTRxlOMeNSyhKKmv2WmLi1E=;
 b=KwoyDXrRAYE4B+vayFXcM7YbibgFA3euDAgRWCUpunj7f61VwCk+wWz1pDCqNc0R5u
 n8f9JUrnd9DwwJVPXRamj8N9AK0+mtKFObyseWVpmC5tgsjPVDjlkYmb95XuKCGSok9D
 0QueimTtrKALFtBRk7Yjp0fs5eiCBzSSJ4L3IKIM5bIfY+m5Dxvbr8/ILil2LL+n/Lry
 zuWDX5UjJbdqLEu/GF6QiwG8jMgF4YaidzXTIpt+rNgKGobh7JFf6KDmdPYdimsTBHa4
 0Q9mm2VsNRyDI9EXpQB6sizFxiQUmsKXod86sOaptR+bByhj2cl46vS099sGqbM/J+M6
 v7TQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=BEsL1FaFC0QPJvcJ8r4GYTRxlOMeNSyhKKmv2WmLi1E=;
 b=Ebad/FzLc8/eviqllpdCRiKroq51zNM+gGauaejVt/ZuakxJ3D3ukNrQrEJvQuPtVz
 FlyE6wDArz1tJwqQNf0NnCVrxT9tJZs+iVAti9BMst6Qmb2JCV/qQjuYvFimeMcOTuvY
 U9xHSezHgWHXPQFW5nkvwCaNNLzjpdDPpCdCaLiNgptxhxLo6wTOCeWlu2EROJADn9nU
 QIknLAor3hUoKMTt4eUvEqJPsa+SfxomP+isyzorKSLqHqy6cI+eiOAr80TwPz08V4/v
 UFzSkuECkQze0Nt2GMEam54G8pZMtf9clT/nHRrumpkIPlBeB0rXUxO+bJxKbtel2Bgv
 wYhg==
X-Gm-Message-State: APjAAAUbqQTONPxF1DmYUZpgjMjNSy9xHH4LRBKVgIUKREEcTjLQoAtl
 Y48grZ5qRzJi7uo8klJKCb2G0YGDRV9c31FZ5Ak=
X-Google-Smtp-Source: APXvYqy1lZzwJoGWW0IdDQluu9apAZ+Pz6Ve6GBVeDolgDCspp/v1g1zeEIRU02VhKDJo4Pg/u3fNUS+QdvCb6bTMYI=
X-Received: by 2002:a0c:814d:: with SMTP id 71mr3767037qvc.47.1553372640265;
 Sat, 23 Mar 2019 13:24:00 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 <83zhplo25s.fsf@HIDDEN>
In-Reply-To: <83zhplo25s.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sat, 23 Mar 2019 22:23:49 +0200
Message-ID: <CACCVLQWfCWg+wUuvKZu+n3_85yaOKH9CbCt9N+Y_waN18g+cLw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000006d4a840584c8c08a"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000006d4a840584c8c08a
Content-Type: text/plain; charset="UTF-8"

Hi Eli,

Here it is the offending callstack.

https://gist.github.com/yyoncho/7032464b456f60270100c747f42885f8

Thanks,
Ivan


However, I cannot reproduce what you describe, not with the latest
> Emacs master branch.  When I repeat the recipe you posted in
>
>   https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1
>
> I get zero as the final value of the counter, not 32982.  As I'd
> expect, as I don't see why kill-buffer-query-functions would be called
> in this scenario.  This was in "emacs -Q", do you get a non-zero count
> even in "emacs -Q"?
>

I am also unable to reproduce it with "emacs -q", even it works fine right
after I start my Spacemacs based configuration. It happens after some time
on my system.


>
> To see why kill-buffer-query-functions is invoked in your case, I
> suggest the following:
>
>   . Modify the above recipe to call 'message' inside
>     my/test-query-function.
>   . Run Emacs under GDB after putting a breakpoint in Fmessage (this
>     is the C name of 'message').
>   . Run your recipe.  When the breakpoint in 'message' breaks, display
>     the Lisp backtrace using the "xbacktrace" command (it is defined
>     in src/.gdbinit in the Emacs source tree).
>
> Alternatively (and maybe easier for you), set debug-on-entry to
> trigger when my/test-query-function is called, then run your recipe,
> and look at the backtrace to see why it was called.
>

This does not work since apparently when the breakpoint is hit the


>
> I hope that either of these two ways will allow you to find the code
> which is responsible for calling kill-buffer-query-functions when JSON
> string is being parsed.  Once we understand that, we could see how to
> avoid it.
>
> >  If so, my suggestion would be to run Emacs under 'perf'
> >  and see which parts of json-parse-string take most of the CPU time,
> >  then we'd have solid basis for discussing the significance of the
> >  calls to json_make_string in this scenario.  If you want me to do the
> >  'perf' run (with the caveat that in "emacs -Q" it might run faster
> >  than in your customized Emacs), please give a complete recipe, and I
> >  will do it.
> >
> > Like I said in the first mail - I cannot give you the recipe since I am
> not able to track down what is causing that
> > slowdown and I need help on that. Can you give me a link on how to run
> emacs under "perf"?
>
> Here are a few:
>
>   http://www.brendangregg.com/perf.html
>
> https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record
>
> https://perf.wiki.kernel.org/index.php/Tutorial#Sample_analysis_with_perf_report
>
> The perf man pages are also useful.
>

--0000000000006d4a840584c8c08a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Hi Eli,</div><div><br></div><div>Her=
e it is the offending callstack.=C2=A0</div><div><br></div><div><a href=3D"=
https://gist.github.com/yyoncho/7032464b456f60270100c747f42885f8">https://g=
ist.github.com/yyoncho/7032464b456f60270100c747f42885f8</a><br></div><div><=
br></div><div>Thanks,</div><div>Ivan</div><div><br></div><br><div class=3D"=
gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">However, I c=
annot reproduce what you describe, not with the latest<br>Emacs master bran=
ch.=C2=A0 When I repeat the recipe you posted in<br>
<br>=C2=A0 <a href=3D"https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d66=
00a88a27ae1" rel=3D"noreferrer" target=3D"_blank">https://gist.github.com/y=
yoncho/9e9c4e14734fdd9a22d6600a88a27ae1</a><br>
<br>I get zero as the final value of the counter, not 32982.=C2=A0 As I&#39=
;d<br>expect, as I don&#39;t see why kill-buffer-query-functions would be c=
alled<br>in this scenario.=C2=A0 This was in &quot;emacs -Q&quot;, do you g=
et a non-zero count<br>even in &quot;emacs -Q&quot;?<br></blockquote><div><=
br></div><div>I am also unable to reproduce it with &quot;emacs -q&quot;, e=
ven it works fine right after I start my Spacemacs based configuration. It =
happens after some time on my system.=C2=A0</div><div>=C2=A0</div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">
<br>To see why kill-buffer-query-functions is invoked in your case, I<br>su=
ggest the following:<br>
<br>=C2=A0 . Modify the above recipe to call &#39;message&#39; inside<br>=
=C2=A0 =C2=A0 my/test-query-function.<br>=C2=A0 . Run Emacs under GDB after=
 putting a breakpoint in Fmessage (this<br>=C2=A0 =C2=A0 is the C name of &=
#39;message&#39;).<br>=C2=A0 . Run your recipe.=C2=A0 When the breakpoint i=
n &#39;message&#39; breaks, display<br>=C2=A0 =C2=A0 the Lisp backtrace usi=
ng the &quot;xbacktrace&quot; command (it is defined<br>=C2=A0 =C2=A0 in sr=
c/.gdbinit in the Emacs source tree).<br>
<br>Alternatively (and maybe easier for you), set debug-on-entry to<br>trig=
ger when my/test-query-function is called, then run your recipe,<br>and loo=
k at the backtrace to see why it was called.<br></blockquote><div><br></div=
><div>This does not work since apparently when the breakpoint is hit the=C2=
=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>
<br>I hope that either of these two ways will allow you to find the code<br=
>which is responsible for calling kill-buffer-query-functions when JSON<br>=
string is being parsed.=C2=A0 Once we understand that, we could see how to<=
br>avoid it.<br>
<br>&gt;=C2=A0 If so, my suggestion would be to run Emacs under &#39;perf&#=
39;<br>&gt;=C2=A0 and see which parts of json-parse-string take most of the=
 CPU time,<br>&gt;=C2=A0 then we&#39;d have solid basis for discussing the =
significance of the<br>&gt;=C2=A0 calls to json_make_string in this scenari=
o.=C2=A0 If you want me to do the<br>&gt;=C2=A0 &#39;perf&#39; run (with th=
e caveat that in &quot;emacs -Q&quot; it might run faster<br>&gt;=C2=A0 tha=
n in your customized Emacs), please give a complete recipe, and I<br>&gt;=
=C2=A0 will do it.<br>&gt; <br>&gt; Like I said in the first mail - I canno=
t give you the recipe since I am not able to track down what is causing tha=
t<br>&gt; slowdown and I need help on that. Can you give me a link on how t=
o run emacs under &quot;perf&quot;?<br>
<br>Here are a few:<br>
<br>=C2=A0 <a href=3D"http://www.brendangregg.com/perf.html" rel=3D"norefer=
rer" target=3D"_blank">http://www.brendangregg.com/perf.html</a><br>=C2=A0 =
<a href=3D"https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_pe=
rf_record" rel=3D"noreferrer" target=3D"_blank">https://perf.wiki.kernel.or=
g/index.php/Tutorial#Sampling_with_perf_record</a><br>=C2=A0 <a href=3D"htt=
ps://perf.wiki.kernel.org/index.php/Tutorial#Sample_analysis_with_perf_repo=
rt" rel=3D"noreferrer" target=3D"_blank">https://perf.wiki.kernel.org/index=
.php/Tutorial#Sample_analysis_with_perf_report</a><br>
<br>The perf man pages are also useful.<br>
</blockquote></div></div></div>

--0000000000006d4a840584c8c08a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 18:51:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 14:51:49 2019
Received: from localhost ([127.0.0.1]:55786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7lkD-0003BN-34
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 14:51:49 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h7lkB-0003B9-CM
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 14:51:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37444)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h7lk5-0000Ss-EP; Sat, 23 Mar 2019 14:51:41 -0400
Received: from [176.228.60.248] (port=4812 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h7lk1-0005vD-Nj; Sat, 23 Mar 2019 14:51:41 -0400
Date: Sat, 23 Mar 2019 20:50:55 +0200
Message-Id: <83zhplo25s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
 (message from yyoncho on Sat, 23 Mar 2019 20:03:29 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 <83d0mhpn99.fsf@HIDDEN>
 <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sat, 23 Mar 2019 20:03:29 +0200
> 
>  Sorry, I don't think I understand the issue.  Currently, the native
>  JSON parsing is between 3 and 4 times faster than the Lisp
>  implementation, as shown by my benchmarks posted here, which were
>  confirmed by Sébastien.  So it cannot be unusable, not more so than
>  the Lisp implementation.  Am I missing something?
> 
> You asked why native json parsing calling "kill-buffer-query-functions" for each string transformation is a
> problem - my answer to that is that if we do not find a way to fix that native json parsing will not be usable for
> Elisp developer since it will get slower depending on external factors.
> 
>  As for avoiding the calls to json_make_string: before we discuss that,
>  we should at least establish that those calls eat up a significant
>  percentage of the CPU time in the use cases that are of interest.
> 
> I do not want to avoid calls to json_make_string but I want json_make_string to be changed so it does not
> trigger "kill-buffer-query-functions".

Ah, okay.  Thanks for explaining the problem to me, I now understand
what's bothering you.

However, I cannot reproduce what you describe, not with the latest
Emacs master branch.  When I repeat the recipe you posted in

  https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1

I get zero as the final value of the counter, not 32982.  As I'd
expect, as I don't see why kill-buffer-query-functions would be called
in this scenario.  This was in "emacs -Q", do you get a non-zero count
even in "emacs -Q"?

To see why kill-buffer-query-functions is invoked in your case, I
suggest the following:

  . Modify the above recipe to call 'message' inside
    my/test-query-function.
  . Run Emacs under GDB after putting a breakpoint in Fmessage (this
    is the C name of 'message').
  . Run your recipe.  When the breakpoint in 'message' breaks, display
    the Lisp backtrace using the "xbacktrace" command (it is defined
    in src/.gdbinit in the Emacs source tree).

Alternatively (and maybe easier for you), set debug-on-entry to
trigger when my/test-query-function is called, then run your recipe,
and look at the backtrace to see why it was called.

I hope that either of these two ways will allow you to find the code
which is responsible for calling kill-buffer-query-functions when JSON
string is being parsed.  Once we understand that, we could see how to
avoid it.

>  If so, my suggestion would be to run Emacs under 'perf'
>  and see which parts of json-parse-string take most of the CPU time,
>  then we'd have solid basis for discussing the significance of the
>  calls to json_make_string in this scenario.  If you want me to do the
>  'perf' run (with the caveat that in "emacs -Q" it might run faster
>  than in your customized Emacs), please give a complete recipe, and I
>  will do it.
> 
> Like I said in the first mail - I cannot give you the recipe since I am not able to track down what is causing that
> slowdown and I need help on that. Can you give me a link on how to run emacs under "perf"?

Here are a few:

  http://www.brendangregg.com/perf.html
  https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record
  https://perf.wiki.kernel.org/index.php/Tutorial#Sample_analysis_with_perf_report

The perf man pages are also useful.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 16:30:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 12:30:21 2019
Received: from localhost ([127.0.0.1]:55725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7jXJ-00080g-Jt
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 12:30:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1h7jXH-00080R-9n
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 12:30:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35956)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1h7jXA-00049r-Sp; Sat, 23 Mar 2019 12:30:12 -0400
Received: from [176.228.60.248] (port=3845 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1h7jWt-0003hx-Te; Sat, 23 Mar 2019 12:29:59 -0400
Date: Sat, 23 Mar 2019 18:29:54 +0200
Message-Id: <83d0mhpn99.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yyoncho <yyoncho@HIDDEN>
In-reply-to: <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
 (message from yyoncho on Sat, 23 Mar 2019 17:27:58 +0200)
Subject: Re: bug#31138: Native json slower than json.el
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
 <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
Cc: sebastien@HIDDEN, 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> From: yyoncho <yyoncho@HIDDEN>
> Date: Sat, 23 Mar 2019 17:27:58 +0200
> Cc: Sébastien Chapuis <sebastien@HIDDEN>, 
> 	31138 <at> debbugs.gnu.org
> 
> > OK, but why is that a problem?
> 
> It makes native json parsing slower than the elisp parsing and it is unclear why do we get these calls in the
> performance critical section of the code(at least for lsp-mode) and it is unclear how to avoid them. Without
> such recipe or a code fix native json parsing will be unusable in combination with any package that attaches
> yet to be defined extension point. 

Sorry, I don't think I understand the issue.  Currently, the native
JSON parsing is between 3 and 4 times faster than the Lisp
implementation, as shown by my benchmarks posted here, which were
confirmed by Sébastien.  So it cannot be unusable, not more so than
the Lisp implementation.  Am I missing something?

As for avoiding the calls to json_make_string: before we discuss that,
we should at least establish that those calls eat up a significant
percentage of the CPU time in the use cases that are of interest.  I
don't think we have established that yet; the large number of calls to
that function doesn't by itself mean it consumes a significant portion
of CPU time.

And I'm now confused what is the issue we are investigating here.
Originally, it seemed like the problem was the native JSON processing
being slower than the Lisp implementation.  Then we've established
that the native implementation is 3 to 4 times faster, and the problem
was that in "emacs -Q" it is twice faster than in OP's customized
Emacs session; I suggested a way to try to find the reason(s) for that
slowdown.  Now it seems like you are saying that json_make_string
could be the problem, and the rest of the issue is not really
interesting?  If so, my suggestion would be to run Emacs under 'perf'
and see which parts of json-parse-string take most of the CPU time,
then we'd have solid basis for discussing the significance of the
calls to json_make_string in this scenario.  If you want me to do the
'perf' run (with the caveat that in "emacs -Q" it might run faster
than in your customized Emacs), please give a complete recipe, and I
will do it.

And I still think you should run the profile with *.el files, to see
what is that compiled function which took a significant percentage of
processing time in the profile you showed.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 15:54:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 11:54:14 2019
Received: from localhost ([127.0.0.1]:55710 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7iyL-00077j-Nx
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 11:54:14 -0400
Received: from mail-qt1-f178.google.com ([209.85.160.178]:41223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7iZD-0006US-5H
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 11:28:15 -0400
Received: by mail-qt1-f178.google.com with SMTP id w30so5814490qta.8
 for <31138 <at> debbugs.gnu.org>; Sat, 23 Mar 2019 08:28:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=3X1cWP2L6EKw/zsUIqu4YI09MW+XglQ+l1nJlmmmNFw=;
 b=NWRwBEKX5nKkqZaYDFtM3nVfzUOZbA7zmMv9l7YIOiFQHPN7iXPCBXyUx1ZISj/hsA
 Py9zAnHUiUBgU8HK20xRx+dW+RRizW0pdgzuW8M5SISwyZ/R4ScHHhvdHPaYIMegRhTA
 x0BweRK8NHIoR4n9FSAMN47/ospIx4dLz499tuseTg0wLcCBV8zcVm+k8W21kbfbuwIj
 Ej2q/00Xq2dhvUa8U4/wftkRHKFQtOcSl+NQfVnoTZQV62UEQ2LD9KVhqu+cSB8GJBsR
 6e3I+nfHEj8+qbnwZhPaO9DWA/SI4x63dmLgBQBqD+e/V1w+bqLmGIy/ssvhLRNQHTtv
 z6Dw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=3X1cWP2L6EKw/zsUIqu4YI09MW+XglQ+l1nJlmmmNFw=;
 b=YN+cMihQ5cEWnDdkqpxDm1l1+xXV8/E6HosHFwus0rLggHBLApamclbQOd8MnpJ4tu
 dAMVpfQ7fRSE8vbGR2QEHkAFaM1VOoYA2UPql3/oPi4zn9kdQK8mHfWNcbkZI/7eSx+g
 r9Xk8BNCkaYDYltB48CWqrbM3jWU8jY+7Ls9rLTTGVS/GVxp6epM6ubbKRDWW1ZF7Syg
 d6iYeRE2mIJc1KZCByFr/xKhWJj/76lOnT+yi8GhhyMta6JTR36nxNzSJj39H9CAG40m
 wNMWCeyCUitXfq8TBGJyU58iHm/W9UYXh4zX6ICzIjsvdUpDNLwGCKFdrk1qo9JveLVh
 1Ftw==
X-Gm-Message-State: APjAAAWTTfgEJ0e2vcnn8heVjyO3ujIMJ5jo6gZryNyGEnhhhAgnA+dK
 L/VfkGw2CDiI/zpkwhuak1Om6Q4oeTnbIDm9FMg=
X-Google-Smtp-Source: APXvYqxsASS2Bl6g88yaniVUh44NcC6n/ShsBDYDSuMD2o9CC6et0i+UJxF7BntF9EXKwmxKSLTwCuKodIMjE+lrlTw=
X-Received: by 2002:a0c:89f3:: with SMTP id 48mr13353608qvs.215.1553354889445; 
 Sat, 23 Mar 2019 08:28:09 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
 <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
 <83ftrdprmj.fsf@HIDDEN>
In-Reply-To: <83ftrdprmj.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sat, 23 Mar 2019 17:27:58 +0200
Message-ID: <CACCVLQULs-e-QSZ=8JmG9DFr0OX60ekF=tP1vdpCunjYHY8CtA@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000006545130584c49ec0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
X-Mailman-Approved-At: Sat, 23 Mar 2019 11:54:11 -0400
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000006545130584c49ec0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

> OK, but why is that a problem?

It makes native json parsing slower than the elisp parsing and it is
unclear why do we get these calls in the performance critical section of
the code(at least for lsp-mode) and it is unclear how to avoid them.
Without such recipe or a code fix native json parsing will be unusable in
combination with any package that attaches yet to be defined extension
point.

Thanks,
Ivan

On Sat, Mar 23, 2019 at 4:55 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sat, 23 Mar 2019 16:32:48 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > 6. At this point, my/call-counter is 32982 which means that
> json-parse-string has triggered 32982 calls to
> > my/test-query-function . I would add also that the number of strings in
> the json file that I am using is exactly
> > 32982 so I suspect that the issue is related to json_make_string .
>
> OK, but why is that a problem?
>
> > Here it is the output of from single invocation of json-parse-string -
> > https://gist.github.com/yyoncho/101a87260b407d9f327b24c72ab15a92 - as
> you can see there are numerous
> > elisp functions invoked under json-parse-string.
>
> What I see in the profile is this:
>
>   . json-parse-string takes the lion's share of the CPU time, which is
>     expected;
>   . some byte-compiled function takes another significant portion of
>     CPU time; to see what function is that, load the relevant Lisp
>     code from a .el file, instead of from .elc file, then re-run the
>     profile
>
> > What I am unable to provide is a minimal example so you could reproduce
> this behaviour on your side using
> > emacs -Q.
>
> Actually, I'm not yet sure what to reproduce.  I'm probably missing
> something.
>

--0000000000006545130584c49ec0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli,</div><div><br></div>&gt; OK, but why is that =
a problem?<br><div><br></div><div>It makes native json=C2=A0parsing slower =
than the elisp parsing and it is unclear why do we get these calls in the p=
erformance critical section of the code(at least for lsp-mode) and it is un=
clear how to avoid them. Without such recipe or a code fix native json=C2=
=A0parsing will be unusable in combination with any package that attaches y=
et to be defined extension point.=C2=A0</div><div><br></div><div>Thanks,</d=
iv><div>Ivan</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Sat, Mar 23, 2019 at 4:55 PM Eli Zaretskii &lt;<a href=
=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mail=
to:yyoncho@HIDDEN" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 23 Mar 2019 16:32:48 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; 6. At this point, my/call-counter is 32982 which means that json-parse=
-string has triggered 32982 calls to<br>
&gt; my/test-query-function . I would add also that the number of strings i=
n the json file that I am using is exactly<br>
&gt; 32982 so I suspect that the issue is related to json_make_string .<br>
<br>
OK, but why is that a problem?<br>
<br>
&gt; Here it is the output of from single invocation of json-parse-string -=
<br>
&gt; <a href=3D"https://gist.github.com/yyoncho/101a87260b407d9f327b24c72ab=
15a92" rel=3D"noreferrer" target=3D"_blank">https://gist.github.com/yyoncho=
/101a87260b407d9f327b24c72ab15a92</a> - as you can see there are numerous<b=
r>
&gt; elisp functions invoked under json-parse-string. <br>
<br>
What I see in the profile is this:<br>
<br>
=C2=A0 . json-parse-string takes the lion&#39;s share of the CPU time, whic=
h is<br>
=C2=A0 =C2=A0 expected;<br>
=C2=A0 . some byte-compiled function takes another significant portion of<b=
r>
=C2=A0 =C2=A0 CPU time; to see what function is that, load the relevant Lis=
p<br>
=C2=A0 =C2=A0 code from a .el file, instead of from .elc file, then re-run =
the<br>
=C2=A0 =C2=A0 profile<br>
<br>
&gt; What I am unable to provide is a minimal example so you could reproduc=
e this behaviour on your side using<br>
&gt; emacs -Q. <br>
<br>
Actually, I&#39;m not yet sure what to reproduce.=C2=A0 I&#39;m probably mi=
ssing<br>
something.<br>
</blockquote></div>

--0000000000006545130584c49ec0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 15:54:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 11:54:13 2019
Received: from localhost ([127.0.0.1]:55708 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7iyL-00077a-5c
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 11:54:13 -0400
Received: from mail-qk1-f196.google.com ([209.85.222.196]:38379)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7hhp-0005CE-8P
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 10:33:06 -0400
Received: by mail-qk1-f196.google.com with SMTP id g1so2916627qki.5
 for <31138 <at> debbugs.gnu.org>; Sat, 23 Mar 2019 07:33:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=ZBIFVYgM4wSRBaFoWdnvX16V7PlyiK8MXwURMEVV3Kk=;
 b=UNQOoWcl4jp08+pVlU2x7m7dZy0ksGwBYloBlU9x7+/Ch72DLFivS7mB9E6OCEAYiS
 j29bBbUOk0Z6VXpS7YPOV1TJLCzCUw8Jd6XlF0WrqJu/pIuF5vGS9i9ITYnKPO7kqJR9
 k1Z/41Z4SrkZmacKS0jyl8N1qVXL3baQRAL24FASYZmLJhiwGbdemgRw0NZSFK/Tne1b
 3d/XaKkmD9/EU/7xG/6FNcdBv60QsOeqsQzAztOag62eeALaEAaaPdfiksCeMqh9tiuA
 O//nMhw/IwpckrTvWRWMDdARglov6YlACI1X+LFY2hMKZsBp6Q/vEIw82Qqyq7SbDUDe
 574A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=ZBIFVYgM4wSRBaFoWdnvX16V7PlyiK8MXwURMEVV3Kk=;
 b=rjz/rLh9qjpqDOD2rGGbGgF8kYCJLsKzPYRNPKGBo9BunwxO95UfPmvSP/QQOaEBiA
 0XiTqvaO4a7dFVlKTXW4uJ3eP8QCCnJJOguCVm5YY+mWRle5W5D8fp0J58Il2N0+sLk4
 m4t2Bjhry+u3Wg0J1VUKQXTetk651EmkxHefVsFPQnBLu49qfAK0Q3LGFFLGFw/84/fb
 BQQ6bKGR6pWR4uN5x3cniCYkTUh7IBIS05kILd4H4su6d+slZGtytafDZeGgV0qbCu5v
 TK+KpkK4iadcedUpPiRRbnfm5uPoRde19i5B8j2r2R5dsSCX3gDu30u+C0QbnrImH5dA
 5SsA==
X-Gm-Message-State: APjAAAXKNCyIoEfxBcEfNQIGNQ7RQG87TKnTlkekOUz11hrFvvYx2FD8
 ib1BAPqeBXKL96N1oJLNpka/mJNtZYQjgkPcvTY=
X-Google-Smtp-Source: APXvYqzWBFxIRELXVkAe2kj0xsYA4km2yf1pY1tkMecOJDVl6mWgKf3m8ONL7LlagGeFrAyLgMDsH9DT96PsSLho3K0=
X-Received: by 2002:ae9:ef94:: with SMTP id d142mr6090030qkg.350.1553351579510; 
 Sat, 23 Mar 2019 07:32:59 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
 <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
 <83k1gppu73.fsf@HIDDEN>
In-Reply-To: <83k1gppu73.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sat, 23 Mar 2019 16:32:48 +0200
Message-ID: <CACCVLQUfjaty9rwr0R9TZ9Anx+GynyOALXzkvTinPEpt_gxFcg@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000001bac640584c3d9cf"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
X-Mailman-Approved-At: Sat, 23 Mar 2019 11:54:11 -0400
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000001bac640584c3d9cf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

Sorry for being unclear:

Here it is a summary of the gist from the previous mail is doing:

1. Prepare json string to parse
2. Set counter my/call-counter to 0
3. Create function my/test-query-function which will increase the counter.
4. Add this function to 'kill-buffer-query-functions.
5. Parse the string from 1). using json-parse-string
6. At this point, my/call-counter is 32982 which means that
json-parse-string has triggered 32982 calls to my/test-query-function . I
would add also that the number of strings in the json file that I am using
is exactly 32982 so I suspect that the issue is related to json_make_string
.

Here it is the output of from single invocation of json-parse-string -
https://gist.github.com/yyoncho/101a87260b407d9f327b24c72ab15a92 - as you
can see there are numerous elisp functions invoked under json-parse-string.

What I am unable to provide is a minimal example so you could reproduce
this behaviour on your side using emacs -Q.

Thanks,
Ivan

On Sat, Mar 23, 2019 at 4:00 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: yyoncho <yyoncho@HIDDEN>
> > Date: Sat, 23 Mar 2019 15:31:39 +0200
> > Cc: S=C3=A9bastien Chapuis <sebastien@HIDDEN>,
> >       31138 <at> debbugs.gnu.org
> >
> > Take a look at the following piece of code:
> >
> > https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1
> > (with the latest emacs compiled from master)
>
> OK.
>
> > Unfortunately, I wasn't unable to reproduce the behaviour with "emacs
> -q" and even it does not reproduce
> > right after I load my emacs configuration but after doing some
> navigation/coding.
>
> Sorry, I don't think I understand what behavior you were unable to
> reproduce.  Please elaborate.
>
> > I believe that native parsing is
> > calling some function list defined in the elisp space but I am unable t=
o
> track down this.
>
> Maybe so, but I don't think I see a Lisp function called from json.c code=
.
>
> > Please, let me know what I can do to help to diagnose this issue.
>
> Are we still talking about too-slow performance of json-parse-string?
> If so, and if you think some Lisp code is responsible for that, then
> running your benchmark test under profiler.el would be the first thing
> I'd suggest.
>

--0000000000001bac640584c3d9cf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr">Hi Eli,<div><br></div><div>Sorry for being unclear:</div><div><br=
></div><div>Here it is a summary of the gist from the previous mail is doin=
g:</div><div><br></div><div>1. Prepare json string to parse</div><div>2. Se=
t counter my/call-counter to 0</div><div>3. Create function=C2=A0my/test-qu=
ery-function which will increase the counter.</div><div>4. Add this functio=
n to &#39;kill-buffer-query-functions.</div><div>5. Parse the string from 1=
). using json-parse-string</div><div>6. At this point, my/call-counter is 3=
2982 which means that json-parse-string has triggered 32982 calls to my/tes=
t-query-function .=C2=A0I would add also that the number of strings in the =
json=C2=A0file that I am using is exactly=C2=A032982 so I suspect that the =
issue is related to=C2=A0json_make_string .</div><div><br></div><div>Here i=
t is the output of from single invocation of json-parse-string -=C2=A0<a hr=
ef=3D"https://gist.github.com/yyoncho/101a87260b407d9f327b24c72ab15a92">htt=
ps://gist.github.com/yyoncho/101a87260b407d9f327b24c72ab15a92</a> - as you =
can see there are numerous elisp functions invoked under json-parse-string.=
=C2=A0</div><div><br></div><div>What I am unable to provide is a minimal ex=
ample so you could reproduce this behaviour on your side using emacs -Q.=C2=
=A0</div><div><br></div><div>Thanks,</div><div>Ivan</div></div></div></div>=
</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_=
attr">On Sat, Mar 23, 2019 at 4:00 PM Eli Zaretskii &lt;<a href=3D"mailto:e=
liz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">&gt; From: yyoncho &lt;<a href=3D"mailto:yyoncho@g=
mail.com" target=3D"_blank">yyoncho@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 23 Mar 2019 15:31:39 +0200<br>
&gt; Cc: S=C3=A9bastien Chapuis &lt;<a href=3D"mailto:sebastien@HIDDEN" t=
arget=3D"_blank">sebastien@HIDDEN</a>&gt;, <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:31138 <at> debbugs.gnu.org" tar=
get=3D"_blank">31138 <at> debbugs.gnu.org</a><br>
&gt; <br>
&gt; Take a look at the following piece of code:<br>
&gt; <br>
&gt; <a href=3D"https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d6600a88a=
27ae1" rel=3D"noreferrer" target=3D"_blank">https://gist.github.com/yyoncho=
/9e9c4e14734fdd9a22d6600a88a27ae1</a><br>
&gt; (with the latest emacs compiled from master)<br>
<br>
OK.<br>
<br>
&gt; Unfortunately, I wasn&#39;t unable to reproduce the behaviour with &qu=
ot;emacs -q&quot; and even it does not reproduce<br>
&gt; right after I load my emacs configuration but after doing some navigat=
ion/coding.<br>
<br>
Sorry, I don&#39;t think I understand what behavior you were unable to<br>
reproduce.=C2=A0 Please elaborate.<br>
<br>
&gt; I believe that native parsing is<br>
&gt; calling some function list defined in the elisp space but I am unable =
to track down this.<br>
<br>
Maybe so, but I don&#39;t think I see a Lisp function called from json.c co=
de.<br>
<br>
&gt; Please, let me know what I can do to help to diagnose this issue.<br>
<br>
Are we still talking about too-slow performance of json-parse-string?<br>
If so, and if you think some Lisp code is responsible for that, then<br>
running your benchmark test under profiler.el would be the first thing<br>
I&#39;d suggest.<br>
</blockquote></div>

--0000000000001bac640584c3d9cf--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31138; Package emacs. Full text available.

Message received at 31138 <at> debbugs.gnu.org:


Received: (at 31138) by debbugs.gnu.org; 23 Mar 2019 15:54:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 23 11:54:13 2019
Received: from localhost ([127.0.0.1]:55706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h7iyK-00077Y-C9
	for submit <at> debbugs.gnu.org; Sat, 23 Mar 2019 11:54:13 -0400
Received: from mail-qt1-f170.google.com ([209.85.160.170]:46987)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yyoncho@HIDDEN>) id 1h7gke-0003Xn-Nv
 for 31138 <at> debbugs.gnu.org; Sat, 23 Mar 2019 09:31:57 -0400
Received: by mail-qt1-f170.google.com with SMTP id z17so5570292qts.13
 for <31138 <at> debbugs.gnu.org>; Sat, 23 Mar 2019 06:31:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=5tddGI6aDz5PwB3rfuHTxN07G/X02xchEZi1TaEH1bI=;
 b=Qh3WGWcyjnj8b2tCFQ5VxMVXa4rnNcv1C2LP6YXtmdmbIaDR8u8NE4J0kHHmkBbJ5H
 OSgZRS1BLAMLjfCQ8xp+JLu3UOoxXe6gDoFIAvO0kkgLqK2KMdX5wtzvNFu/If+YAV/U
 G/6F+KNdtKUNsHXywC/8Fncf/z/fW0ISvhUkMkMyROkNYMJz2okGrhBEVNTR1Tp76m1M
 9/mb+E4dmTKTGKzR2ePYVEmabKktpeEAbiC/C5ubmGDIHo7CbuqG968hvmYsPe2GaF4q
 gjJucSaqhwV/y67shk4QgHTjt/DopvAczWQSe7yOzQZCKzcLYsIClWMe1UHL4tDeYoWw
 tPeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=5tddGI6aDz5PwB3rfuHTxN07G/X02xchEZi1TaEH1bI=;
 b=ZgMxto5qsbTOT6/lOqwQAOQKoJkCotlINEehujEg0zTxdVIwNaIEoz5JUOIzCWKxL5
 laCX0C/1cxJjXAAj0ZgwAv+JB5crpvLrZlBrIeyBEwKM9IeOol0xGmL25R7z7V+hshc0
 U2jNk6s7dlX5CdV4NFNuzyKFwY48NxrTr8D5Mv7dYGyab+A04Mo/YUgh6s9A01Gs+2yt
 IPttuQpEZr8H0MMfty2ZQMqtEjq2KkD0n8bI0TifIqZioirZzppgCFhhV4NVeqpB+6+Q
 h6jFHlrzkdW7TrdzWcnVLAJKkJONb65GlWg1utBUGT2RIootOY/WD8GTBD7SUbHF8TAF
 O5jA==
X-Gm-Message-State: APjAAAUeZBa0qSqAu5IKZlZIF3xOFoD1lCZp2sEseNslTY+xRa1kqgdN
 zqesMN/sNPJUsbbiKBsOR4TSmJMN/m2JoyAc8Cg=
X-Google-Smtp-Source: APXvYqyVginLZZR6qSS6q4V1cjzP91BPO1YBK+R7o8HuOBWLn65d0RR6Wewn9VlAaYeqFNtfA7ON7oyhjvWOwtErFMk=
X-Received: by 2002:a0c:d1a6:: with SMTP id e35mr12713177qvh.174.1553347911046; 
 Sat, 23 Mar 2019 06:31:51 -0700 (PDT)
MIME-Version: 1.0
References: <87sh806xwa.fsf@HIDDEN> <834lkf7ely.fsf@HIDDEN>
 <878t9own1p.fsf@HIDDEN> <838t9o4hvl.fsf@HIDDEN>
 <CAN2Hsvw3DF7ztuBQJ3MUuyGcmrpiVxbAvsyLUebaaV73x1r4yQ@HIDDEN>
 <83r2ayovkx.fsf@HIDDEN> <83pnqiormy.fsf@HIDDEN>
 <CAN2Hsvy9FW7s3U2pN2Q_7ydzajY7R_kxagCevZZ5XCk8xiSdew@HIDDEN>
 <83lg15pvzr.fsf@HIDDEN>
In-Reply-To: <83lg15pvzr.fsf@HIDDEN>
From: yyoncho <yyoncho@HIDDEN>
Date: Sat, 23 Mar 2019 15:31:39 +0200
Message-ID: <CACCVLQXMTtWPg2AZmLKvG83JkSxLR_S4==nx1Fov2oxj1vpVfw@HIDDEN>
Subject: Re: bug#31138: Native json slower than json.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000007359f70584c2fed6"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31138
X-Mailman-Approved-At: Sat, 23 Mar 2019 11:54:11 -0400
Cc: =?UTF-8?Q?S=C3=A9bastien_Chapuis?= <sebastien@HIDDEN>,
 31138 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000007359f70584c2fed6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Eli,

Take a look at the following piece of code:

https://gist.github.com/yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1
(with the latest emacs compiled from master)

Unfortunately, I wasn't unable to reproduce the behaviour with "emacs -q"
and even it does not reproduce right after I load my emacs configuration
but after doing some navigation/coding. I believe that native parsing is
calling some function list defined in the elisp space but I am unable to
track down this. Please, let me know what I can do to help to diagnose this
issue.

Thanks,
Ivan

On Sat, Mar 23, 2019 at 3:21 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: S=C3=A9bastien Chapuis <sebastien@HIDDEN>
> > Date: Sat, 23 Mar 2019 20:59:46 +0800
> > Cc: Ivan Yonchovski <yyoncho@HIDDEN>, 31138 <at> debbugs.gnu.org
> >
> > Sorry for not being clear, my main concern was the difference when
> > wrapping json-parse-string with with-temp-buffer or not.
>
> Ah, okay.  I thought the concern was with the native JSON support
> being slower than json.el.
>
> > You are right, I tested with the current master branch and it is
> > faster (emacs -Q):
> >
> > (with-current-buffer  "large.json"
> >   (benchmark-run 10 (json-parse-string (buffer-string))))
> > ;;; (1.45898128 10 0.15294547200000003)
> >
> > (with-current-buffer  "large.json"
> >   (let ((str (buffer-string)))
> >     (benchmark-run 10 (with-temp-buffer (json-parse-string str)))))
> > ;;; (0.706171416 10 0.18795709700000002)
> >
> > (with-current-buffer  "large.json"