From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: JSON/YAML/TOML/etc. parsing performance Date: Sun, 29 Oct 2017 20:48:33 +0000 Message-ID: References: <87poaqhc63.fsf@lifelogs.com> <8360ceh5f1.fsf@gnu.org> <83h8vl5lf9.fsf@gnu.org> <83r2um3fqi.fsf@gnu.org> <43520b71-9e25-926c-d744-78098dad6441@cs.ucla.edu> <83o9pnzddc.fsf@gnu.org> <472176ce-846b-1f24-716b-98eb95ceaa47@cs.ucla.edu> <83d163z6dy.fsf@gnu.org> <73477c99-1600-a53d-d84f-737837d0f91f@cs.ucla.edu> <83poa2ya8j.fsf@gnu.org> <21b0ba97-ed49-43ae-e86f-63fba762353a@cs.ucla.edu> <83lgkqxe3l.fsf@gnu.org> <903b4aaa-36e6-9985-7313-177d9d34b7ec@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114d8ad4c861cd055cb5a5f9" X-Trace: blaine.gmane.org 1509310187 9517 195.159.176.226 (29 Oct 2017 20:49:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Oct 2017 20:49:47 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 29 21:49:38 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8uWY-0001Yq-FJ for ged-emacs-devel@m.gmane.org; Sun, 29 Oct 2017 21:49:38 +0100 Original-Received: from localhost ([::1]:37700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8uWf-0006v8-OO for ged-emacs-devel@m.gmane.org; Sun, 29 Oct 2017 16:49:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8uVi-0006th-UO for emacs-devel@gnu.org; Sun, 29 Oct 2017 16:48:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8uVi-0002zW-4U for emacs-devel@gnu.org; Sun, 29 Oct 2017 16:48:46 -0400 Original-Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:43485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8uVg-0002yI-FK; Sun, 29 Oct 2017 16:48:44 -0400 Original-Received: by mail-qk0-x230.google.com with SMTP id w134so13923301qkb.0; Sun, 29 Oct 2017 13:48:44 -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=bm8UbRH7F0hg+rN6J7IntU12LE3MS9Gxw7HNxD4kzaw=; b=brilsN25TA7RYaZRneiJuob4r53ohSB60eOn4IGXzRHTBQmxSTclDImt2+1wPqE7SR O0/9bAbVQ19Q4q32f6q3XrtZ0jOZ1iewAgApPLygcuOcNz/sdW1rtkcopD4ygImBTgO0 EG5RrT9s0L9GSDIMom+40yvvQ1zBscZ2qqgIEwtPhj5jFUGcFOy2SLG/hJIL1GAjFF8L auTF2IbUKq7FFNp2KdI5WLSYyc/Xk8OjaGA9Dc3g7A4/j/4dsifAkwtqfYgbfD3hR1a0 YnBznDcd9xiww0/tfPB59rRCLEj9G3yxlFjpvkK+TDseOsVN81NLGOk/XXt36q1Nx2SM QAQA== 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=bm8UbRH7F0hg+rN6J7IntU12LE3MS9Gxw7HNxD4kzaw=; b=kOS9to/glKY3KtrZqjBGydp3WUsSzd3U+dImqa7e2Zan+jzrbR7L3hOZKDmAQrnS9+ dojK36SlSX31MGJA66PdqN7eaHS/ojecxG+ok5huk8LjjE6rR/iLSGx+QzSvX32OR2Wy hNtun303BxJ1/85sFV/JIHb2EyRDOO+Sf6CAk3YNpCZj1yBslvhk4DihB07/GXWpQyT6 UbkxZwpejL/WGgZx3nbG4ZsVXwGUO9viuVu6VHKom9ZsY8/DMgCeoXzS/OnDjGpIeldo /Q0c69EzW8Hu4poTyLJxrWgXOss2dKv4gbr+dewPJBHfcaXRksgokO74wzdHIgbMePdV TT+A== X-Gm-Message-State: AMCzsaX0r+O5zE6oDmROaV3btq2RlG3cWenh3pacpUnSvDwlM6NHwNMf uPWZv0VxN9oopqIYv68q3PIbWJ/qoix39UdWyz2EyA== X-Google-Smtp-Source: ABhQp+Rn9/YaWzKLBy28TNbMsFTGoHMW6Xh9SpK1QLdDFnZDjg/YAC0aLvjL6f/j+yfjq1KKUFT2akCxVe3WmJN9lmw= X-Received: by 10.55.157.133 with SMTP id g127mr10125054qke.296.1509310123760; Sun, 29 Oct 2017 13:48:43 -0700 (PDT) In-Reply-To: <903b4aaa-36e6-9985-7313-177d9d34b7ec@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219820 Archived-At: --001a114d8ad4c861cd055cb5a5f9 Content-Type: text/plain; charset="UTF-8" Paul Eggert schrieb am Mo., 9. Okt. 2017 um 08:19 Uhr: > Philipp Stephani wrote: > > I don't think Jansson can use xmalloc because xmalloc can exit > nonlocally, > > which is not expected by a third-party library such as Jansson. It could > > use a suitable wrapper of lmalloc, though. > > That would be overkill, as lmalloc arranges for Lisp alignment, which > Jansson > does not need. We could define new functions (smalloc and srealloc, say), > that > act like malloc and realloc except they return NULL for requests larger > than > PTRDIFF_MAX. Right now, I expect only the JSON code needs this sort of > thing so > we could put the new functions in json.c. If other code needs it later we > could > move these new functions to alloc.c. > Yes, that sounds reasonable. --001a114d8ad4c861cd055cb5a5f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am Mo., 9. Okt. 2017 um 08:19=C2=A0Uhr:
Philipp Stephani wrote:
> I don't think Jansson can use xmalloc because xmalloc can exit non= locally,
> which is not expected by a third-party library such as Jansson. It cou= ld
> use a suitable wrapper of lmalloc, though.

That would be overkill, as lmalloc arranges for Lisp alignment, which Janss= on
does not need. We could define new functions (smalloc and srealloc, say), t= hat
act like malloc and realloc except they return NULL for requests larger tha= n
PTRDIFF_MAX. Right now, I expect only the JSON code needs this sort of thin= g so
we could put the new functions in json.c. If other code needs it later we c= ould
move these new functions to alloc.c.

Ye= s, that sounds reasonable.=C2=A0
--001a114d8ad4c861cd055cb5a5f9--