From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: yyoncho Newsgroups: gmane.emacs.bugs Subject: bug#31138: Native json slower than json.el Date: Tue, 26 Mar 2019 19:45:38 +0200 Message-ID: References: <87sh806xwa.fsf@chapu.is> <834lkf7ely.fsf@gnu.org> <878t9own1p.fsf@chapu.is> <838t9o4hvl.fsf@gnu.org> <83r2ayovkx.fsf@gnu.org> <83pnqiormy.fsf@gnu.org> <83lg15pvzr.fsf@gnu.org> <83k1gppu73.fsf@gnu.org> <83ftrdprmj.fsf@gnu.org> <83d0mhpn99.fsf@gnu.org> <83zhplo25s.fsf@gnu.org> <83va09nwg3.fsf@gnu.org> <83tvftne0j.fsf@gnu.org> <40DA9396-044E-4D00-946E-42B776B51BFA@gnu.org> <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> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000531d37058502e47b" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="36310"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?Q?S=C3=A9bastien?= Chapuis , 31138@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 26 18:46:19 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 1h8q9Q-00098V-El for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 18:46:16 +0100 Original-Received: from localhost ([127.0.0.1]:35847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8q9P-0005iH-E2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 13:46:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8q9D-0005go-RG for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2019 13:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8q9C-0001Xm-Ee for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2019 13:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h8q9C-0001Xb-AL for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2019 13:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h8q9C-0001GG-69 for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2019 13:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: yyoncho Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Mar 2019 17:46: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.15536223584836 (code B ref 31138); Tue, 26 Mar 2019 17:46:02 +0000 Original-Received: (at 31138) by debbugs.gnu.org; 26 Mar 2019 17:45:58 +0000 Original-Received: from localhost ([127.0.0.1]:60520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h8q98-0001Fv-1K for submit@debbugs.gnu.org; Tue, 26 Mar 2019 13:45:58 -0400 Original-Received: from mail-qt1-f179.google.com ([209.85.160.179]:37231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h8q96-0001Fj-AB for 31138@debbugs.gnu.org; Tue, 26 Mar 2019 13:45:56 -0400 Original-Received: by mail-qt1-f179.google.com with SMTP id z16so15645078qtn.4 for <31138@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) In-Reply-To: <83zhphliil.fsf@gnu.org> 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:156829 Archived-At: --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 wrote: > > From: yyoncho > > Date: Mon, 25 Mar 2019 23:34:38 +0200 > > Cc: S=C3=A9bastien Chapuis , > > 31138@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
Hi Eli,

I think I get similar results.<= /div>

* ~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@gnu.org> wrote:
> From: yyoncho <yyoncho@gmail.com>
> Date: Mon, 25 Mar 2019 23:34:38 +0200
> Cc: S=C3=A9bastien Chapuis <sebastien@chapu.is>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A031138@debbugs.gnu.org
>
> 3. Even in the best case scenario native parsing is not fast enough. I= n lsp-mode, you might receive 3.5mb
> json as a server-side response while you are typing. E. g. I might typ= e "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?=C2=A0 My testing indicates that decoding strings<= br> by UTF-8 runs at about 50 msec per MByte for short strings, and about
4 times faster for very large strings.=C2=A0 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 efficien= tly.

I think we should only consider this after we profile JSON parsing and
see which parts take the most processing time.
--000000000000531d37058502e47b--