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: Sun, 21 Apr 2019 15:15:07 +0300 Message-ID: <83zhoj8shg.fsf@gnu.org> References: <87sh806xwa.fsf@chapu.is> <83r2awnw0w.fsf@gnu.org> <83d0mgnn31.fsf@gnu.org> <835zs7och6.fsf@gnu.org> <83tvfqnbxc.fsf@gnu.org> <83lg12n75s.fsf@gnu.org> <83h8bqn2ik.fsf@gnu.org> <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> <837ebnabkf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155145"; mail-complaints-to="usenet@blaine.gmane.org" Cc: sebastien@chapu.is, dgutov@yandex.ru, 31138@debbugs.gnu.org To: yyoncho Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 21 14:16:18 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 1hIBOJ-000eCq-EW for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 14:16:15 +0200 Original-Received: from localhost ([127.0.0.1]:52647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIBOI-0003oM-FJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Apr 2019 08:16:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIBO8-0003oG-NU for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 08:16:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIBO6-0000dU-RF for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 08:16:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIBO6-0000d8-8y for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 08:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIBO5-0000DV-SM for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2019 08:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2019 12:16:01 +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.1555848930789 (code B ref 31138); Sun, 21 Apr 2019 12:16:01 +0000 Original-Received: (at 31138) by debbugs.gnu.org; 21 Apr 2019 12:15:30 +0000 Original-Received: from localhost ([127.0.0.1]:47908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIBNZ-0000Cf-KJ for submit@debbugs.gnu.org; Sun, 21 Apr 2019 08:15:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIBNW-0000CR-1q for 31138@debbugs.gnu.org; Sun, 21 Apr 2019 08:15:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIBNP-0000LV-Vz; Sun, 21 Apr 2019 08:15:20 -0400 Original-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 ) id 1hIBNP-0001sy-2f; Sun, 21 Apr 2019 08:15:19 -0400 In-reply-to: (message from yyoncho on Sun, 21 Apr 2019 14:38:04 +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:157940 Archived-At: > From: yyoncho > Date: Sun, 21 Apr 2019 14:38:04 +0300 > Cc: Dmitry Gutov , Sébastien Chapuis , > 31138@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.