From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Bug#38708: eq vs eql in byte-compiled code Date: Sat, 04 Jan 2020 13:54:01 -0500 Message-ID: References: <8cd1b5b2-b94e-ce64-0d70-c1b8b012d685@cs.ucla.edu> <1e0940ff-e418-bafc-66d3-72b562b2c65b@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="74272"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Mattias =?windows-1252?Q?Engdeg=E5rd?= , Pip Cet , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 04 19:54:25 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1inoZ6-000JB4-I4 for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 19:54:24 +0100 Original-Received: from localhost ([::1]:36080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inoZ5-00052r-EY for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 13:54:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44412) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inoYr-0004sc-JY for emacs-devel@gnu.org; Sat, 04 Jan 2020 13:54:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inoYo-0000gz-Oy for emacs-devel@gnu.org; Sat, 04 Jan 2020 13:54:08 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4790) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inoYo-0000fV-Hu for emacs-devel@gnu.org; Sat, 04 Jan 2020 13:54:06 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C657444D9DD; Sat, 4 Jan 2020 13:54:05 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3D5AA44D9D6; Sat, 4 Jan 2020 13:54:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1578164044; bh=hbNA+tHXBSSob2ESY2gtJE4kMYdsLW/z/xXaAbHVMqE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Y/BsigWgOEzaXIw0h/eM0A4iLQviZqjb6H1IYeWdDjlXH6NuhVUPEmqNwL9KJyJPR lraYbQYCPXuVeGeNsDTjIRv4aZve7d4K67RnFelgtLMki1xZbLuKtSaiwraxvjtj+0 Nk1GjwrcdjjGSEf/xfVaB6MsX/pMVPoddKirS+Tt1uF+ONGYtqJv0PYKnT+RC6lo3j KPUgNJ7bRnCIQoga67LC8gGvxM7H7KuOCrxHqNl+BJwRwPc6vNS+Y7NG73wRYIJriL KcbINgZo4D3cW6eP5RgBRFOZP+nntQ7nbwksne2A9MwCeMOT5QHHc815AEi+B0w/dt W7ryGUiIVZr6Q== Original-Received: from pastel (65-110-220-116.cpe.pppoe.ca [65.110.220.116]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E733E120C71; Sat, 4 Jan 2020 13:54:03 -0500 (EST) In-Reply-To: <1e0940ff-e418-bafc-66d3-72b562b2c65b@cs.ucla.edu> (Paul Eggert's message of "Wed, 1 Jan 2020 23:52:12 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243929 Archived-At: > * Should we try hash-consing floats too? A float operation is typically extremely quick (less than 10 CPU cycles), so the relative overhead of hash-consing them will be very much higher than the 38% worst case you got on bignums. IOW, it would be fine for the case where we don't use floats very much, but it would make float operations too expensive IMO. > * The attached patch could probably be sped up a bit by supporting > sets as well as mappings at the low level, since bignum_map is really > just a set of bignums. Not sure it's worth the effort, though. I don't think a "hash-set" would be much smaller than a hash-map, so the benefit would be fairly small (the ~5 words-per-entry cost of a hash-table are hash+index+next+key+value, so a set would only save one of those). OTOH defining a hash-set as the base structure and then building hash-table on-top would make it possible to safely export the "hash-lookup" such that `incf` on a hash-table could perform the lookup only once. > From 2cc2d34a4f0fe866714f062dde7bfcc485b3b9e4 Mon Sep 17 00:00:00 2001 > From: Paul Eggert > Date: Wed, 1 Jan 2020 23:18:58 -0800 > Subject: [PATCH] Hash-cons bignums > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > Suggested by Stefan Monnier in: > https://lists.gnu.org/r/emacs-devel/2020-01/msg00010.html > This improves performance of =E2=80=98make compile-always=E2=80=99 > by about 7% on my platform (x86-64 Ubuntu 18.04.3). > * src/alloc.c (make_pure_bignum): Remove, as we can=E2=80=99t copy (much > less purecopy) bignums any more. Sounds dangerous: it means that pure objects which point to bignums could end up with dangling pointers because the GC won't see those pointers and will then GC the corresponding bignum. I think we should instead *move* the bignum to pure space. Stefan