From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Implement fast verisons of json-parse functions Date: Sat, 23 Mar 2024 13:11:40 +0200 Message-ID: <867chtyzgz.fsf@gnu.org> References: <87h6h2rsgn.fsf@gmail.com> <867chy3vpm.fsf@gnu.org> <87cyrqrqnb.fsf@gmail.com> <865xxi3tsu.fsf@gnu.org> <874jd2rnwj.fsf@gmail.com> <864jd14lqs.fsf@gnu.org> <87edc1rzig.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38310"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?G=E9za_Herman?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 23 12:12:26 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rnzIY-0009lp-9C for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Mar 2024 12:12:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnzHt-0006LN-6C; Sat, 23 Mar 2024 07:11:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnzHr-0006Kq-A3 for emacs-devel@gnu.org; Sat, 23 Mar 2024 07:11:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnzHr-0007Re-0j; Sat, 23 Mar 2024 07:11:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=o9A9cBdyjV39x87Ith43iETtAKeg9Rozostxwnxg8qU=; b=J3wF1q8b+wxeOhUPniG7 DZp584V+IEgW8Dg8GUug2ECXYhzX1q9sjS9HbxGLWRp+bnljU0Ih2xttYC08zH9W0Llv57fw3IRV/ XcjM0SDamgwrdxIXHsHQPdfhfsWe/pvHf+1bERVIwOtS0esXFcP+t/ivCHspqXZcyD1ZChPXBibSt XjXjrWHuK2itkHS5OAUp6+Oi7NPR+/lXc1U1eAAtFVN5ujrCgFUxc5npQOwHN6OGRnp8Dw0LT3EYF PbCcbiQetN6TzFE9Jcnd4iQXbmixuKYSKw05zvQvM0Npj/my3vpwRW/TWg9K4Okow78N/dG+QikuI IGajraiiO1kkmg==; In-Reply-To: <87edc1rzig.fsf@gmail.com> (message from Herman, =?iso-8859-1?Q?G=E9za?= on Sat, 23 Mar 2024 11:40:41 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317249 Archived-At: > From: Herman, Géza > Cc: Géza Herman , > emacs-devel@gnu.org > Date: Sat, 23 Mar 2024 11:40:41 +0100 > > Eli Zaretskii writes: > > >> If we want to have conditional compilation, is there a simple > >> similar conditional compilation case already in Emacs? So I can > >> copy the approach easily (supposedly I need to add a flag to > >> configure, it needs to add a -DUSE_OWN_JSON_PARSER switch to the > >> compiller, etc.) > > > > Let's wait with this until we have a clear idea whether we need > > this. My suggestion was just to present a possibility, not > > necessarily a decision that we should have this. I'm not sure yet > > whether we need to offer the possibility of using libjansson for > > parsing JSON as an option. > > What is the process for deciding this? We install the new parser, and wait for complaints about it that could justify letting people optionally use libjansson. Like performance problems that only happen sometimes and cannot be fixed in the new parser, or some other similar issues. If and when such complaints come up, we consider the possibility of leaving libjansson-based parser in our sources. > I attached the latest version of the parser. I reverted the Lisp > vector based workspace to use a malloc based one, and added a note > regarding that the GC most not run during parsing. I also > implemented some additional optimizations, this version runs ~10x > faster on my LSP dataset. I also run the parser on all the JSON > files I found on my computer (~60,000 files, 1.5 GiB), no problems > were found. The parser runs ~6.5x faster (3.5 sec vs 23.4 sec) on > this dataset. Thanks. I'll wait for a few days before installing this, in case there are objections or further comments.