From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31138: Native json slower than json.el Date: Mon, 22 Apr 2019 19:28:55 +0300 Message-ID: <83v9z657i0.fsf@gnu.org> References: <87sh806xwa.fsf@chapu.is> <83zhphliil.fsf@gnu.org> <181b93a3-3861-0481-1b95-8344410d1049@yandex.ru> <83r2a2hdxn.fsf@gnu.org> <21f68973-a684-2a65-82eb-c8f3df90127f@yandex.ru> <83d0lmgez2.fsf@gnu.org> <7d503be9-4d85-3d0b-6829-631ad376ba3d@yandex.ru> <831s22gcci.fsf@gnu.org> <83y349gasn.fsf@gnu.org> <83d0lfag4x.fsf@gnu.org> <5cf45a21-65c3-67ee-f123-be83a6ee7c99@yandex.ru> <83a7gjaen6.fsf@gnu.org> <10ca4e2f-b116-16bc-c81e-24036752c867@yandex.ru> <83lg026xxb.fsf@gnu.org> <0d42dab4-6c5c-be3a-d402-f17b39e7fc3c@yandex.ru> <83k1fm6vly.fsf@gnu.org> <19b19dec-a5a0-e08d-6026-0b9621d38143@yandex.ru> <8336ma6oia.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="163771"; mail-complaints-to="usenet@blaine.gmane.org" Cc: p.stephani2@gmail.com, sebastien@chapu.is, yyoncho@gmail.com, 31138@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 22 18:35:28 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIbug-000gQP-EK for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 18:35:26 +0200 Original-Received: from localhost ([127.0.0.1]:39848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIbuf-0003Dj-7L for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 12:35:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIbuV-0003Ac-ES for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 12:35:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIbpU-0007vI-7Z for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 12:30:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIbpU-0007v4-0P for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 12:30:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIbpT-0003gW-ID for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 12:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2019 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31138 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 31138-submit@debbugs.gnu.org id=B31138.155595055514061 (code B ref 31138); Mon, 22 Apr 2019 16:30:02 +0000 Original-Received: (at 31138) by debbugs.gnu.org; 22 Apr 2019 16:29:15 +0000 Original-Received: from localhost ([127.0.0.1]:51391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIbog-0003ei-JU for submit@debbugs.gnu.org; Mon, 22 Apr 2019 12:29:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIboe-0003eP-6L for 31138@debbugs.gnu.org; Mon, 22 Apr 2019 12:29:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIboY-0007Tk-HB; Mon, 22 Apr 2019 12:29:06 -0400 Original-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 ) id 1hIboW-0005UG-Ub; Mon, 22 Apr 2019 12:29:05 -0400 In-reply-to: (message from Dmitry Gutov on Mon, 22 Apr 2019 19:16:15 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158056 Archived-At: > Cc: p.stephani2@gmail.com, sebastien@chapu.is, yyoncho@gmail.com, > 31138@debbugs.gnu.org > From: Dmitry Gutov > 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.