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: I created a faster JSON parser Date: Fri, 08 Mar 2024 16:10:15 +0200 Message-ID: <86ttlgzuew.fsf@gnu.org> References: <87a5n96mb5.fsf@gmail.com> <861q8l0w2c.fsf@gnu.org> <878r2s99j0.fsf@gmail.com> <86y1aszxom.fsf@gnu.org> <874jdg97xm.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="2371"; 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 Fri Mar 08 15:11:45 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 1riawq-0000QR-7S for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Mar 2024 15:11:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riavw-0007MO-8z; Fri, 08 Mar 2024 09:10:48 -0500 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 1riavr-0007Km-90 for emacs-devel@gnu.org; Fri, 08 Mar 2024 09:10:44 -0500 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 1riavr-0000TG-06; Fri, 08 Mar 2024 09:10:43 -0500 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=CLFRIrv6yO8PQd2viA/7ZHn+nRIiUN3CxKxayVYch0Y=; b=V2ET2wpuR1Z1EkH9IjiO 6PTtZFIY7AsGc7WtG4DweYvxJ4r0YJ1KB3hF8kUn7hbfjiMeq4cVwM0Hra3n7L4+J8HRYnufawNEn yphejPJpvhrDTW5s2x99LQlKbCtARqpOxqcoYLZNv0O1eEXVd4cCNE0i5ZtBeZAM6qNg49bTlWkpf 1FE9C7C8oS9tAJb3rUBTNmedeBQbKDvHJdX+Feq/7AdKjFlRcbYbckRU5n5ubRIrBmEukN30AXC8S kxt8/Zyypq8dQlwRfDWDt1ovYtAzoXAbHSg5XIgSzVUwShTAblfdrX4J0Ufm13L+KxEk/wjnzbzrY k5vW1E2Vs4tlTQ==; In-Reply-To: <874jdg97xm.fsf@gmail.com> (message from Herman, =?iso-8859-1?Q?G=E9za?= on Fri, 08 Mar 2024 14:12:19 +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:316913 Archived-At: > From: Herman, Géza > Cc: Géza Herman , > emacs-devel@gnu.org > Date: Fri, 08 Mar 2024 14:12:19 +0100 > > > > . clean up the code (e.g., currently it still calls the > > function > > that on MS-Windows loads the jansson DLL, which is now > > unneeded) > > and adjust it to our style and conventions; > I can remove the WINDOWSNT related #ifs. Are there any more > comments? I formatted my code with clangd, is there anything else > that should be done? The following is based on an initial reading of the patch: . Redundant braces (for blocks of a single code line) is one issue. . The way you break a long line at the equals sign '=' is another (we break after '=', not before). . The code must not call malloc/realloc/free, but their x* variants, xmalloc/xrealloc/xfree. . The names should be changed to remove the "my_" and "My" prefixes. . Many functions should have a commentary before them explaining their purpose and use, the exception is short function whose purpose is clear from reading the code. . Some of the generic 'json-parse-error' errors should probably be more specific; for example, UTF-8 encoding problems should be flagged as such. . The code which handles integers seems to assume that 'unsigned long' is a 64-bit type? if so, this is not true on Windows; please see how we handle this elsewhere in Emacs, in particular in the WIDE_EMACS_INT case. A more general comment is that you seem to be parsing buffer text assuming it's UTF-8? If so, this is not accurate, as the internal representation is a superset of UTF-8, and can represent characters above 0x10FFFF. There could be other issues as well. > > . thoroughly test the code on the available test suites (or > > maybe > > you already did); > I tested it on github.com/nst/JSONTestSuite, it passes all "y_" > and "n_" tests in the directory "test_parsing". If you're aware > of other test repositories, I'm happy to test on them as well. I don't know about such test suites, but maybe someone else does. > > . for you to assign the copyright to the FSF, without which we > > cannot accept such a substantial contribution > Can you please send me the necessary documents? Sent off-list. Thanks.