From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables. Date: Fri, 10 Feb 2017 10:33:05 +0530 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <712df469-190d-aeab-e239-1f225be3333f@gmail.com> <25a6003d-1d9b-381f-29b0-aece30af1def@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1486703020 24071 195.159.176.226 (10 Feb 2017 05:03:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2017 05:03:40 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 10 06:03:31 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 1cc3Mp-0005gN-2L for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2017 06:03:31 +0100 Original-Received: from localhost ([::1]:41838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc3Mu-0001KP-Qv for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2017 00:03:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc3Ml-0001Jx-RE for emacs-devel@gnu.org; Fri, 10 Feb 2017 00:03:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cc3Ml-0003nB-1r for emacs-devel@gnu.org; Fri, 10 Feb 2017 00:03:27 -0500 Original-Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:34144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cc3Mk-0003mY-UP for emacs-devel@gnu.org; Fri, 10 Feb 2017 00:03:26 -0500 Original-Received: by mail-yw0-x243.google.com with SMTP id v73so1848858ywg.1 for ; Thu, 09 Feb 2017 21:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DdhC3KEHFHcC+keZ6x4zRgcYARV9NhqdTprlccnT+P4=; b=D7FwV7iJzXB4+oke9007N7xmIi136DoXC7RIgR0HV6CeSGgdTLtCuFRQy27q1xEyK7 4hxG1+6y9Op9XabJliA55a2IC1mGZdcfYv7NmgOdfTAjnq9Uo5V+xKxwmtFa3xhdGewg 8hDFqbcReMA2/8BviQrZygDomxKLmF7W8+H18WlAvRksidlYtw0l6q/7ZLEbnHtEQcDP BcmFD3EhaeFklXdVFI0Lbj11Pt2VVtZ2o5tlxuza3HRP2Wwn1ED45IN6cB0CAAike8Bl pV4w1PYpBwwM0w7DpJlaQm2uekOgi1qb6UTnLJlxPK50OXXZJCGwNXCeopDU9VbKEBxv 1JJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DdhC3KEHFHcC+keZ6x4zRgcYARV9NhqdTprlccnT+P4=; b=h9bsYmfQEVwoNd4tp+94z3oml5S13Fqkw7qOBSb2hb+DL2jc4edHasfTAyDniOWCCy WygC8+KNfuw6qjHrQtqF9e9Z91uY1dao+7w7deFfCp1Qfw2KGA8bh8RMw50ugeAJOIW+ HNvMXR4vSpzAtCmDmIGE8LByXJP7GI1vCLz4D245lnbWBGiZMboS/KVKj66yPwoD7h9x NXvmOKofi7Kv8tC3XxuBn6koC2a+iibr7q61u6XvEmLZKEJ2WNl55xnMXYlj0L7XxoyS CCYBbJmPolRU/XP9hrYOhU86vqdGYcY+6WD6ittpsdy2KhBIxTq4hoTfECjomE2fUKbD MRJw== X-Gm-Message-State: AMke39ldH8UgZ05CFU0SYao3a15xwz0ZvwBxPyJNqqcWc+1RvY69uPVY/JfkuDF9RR6/qIqhr8itzSjIwkQUvw== X-Received: by 10.13.252.131 with SMTP id m125mr5578779ywf.49.1486703006225; Thu, 09 Feb 2017 21:03:26 -0800 (PST) Original-Received: by 10.129.153.77 with HTTP; Thu, 9 Feb 2017 21:03:05 -0800 (PST) In-Reply-To: <25a6003d-1d9b-381f-29b0-aece30af1def@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::243 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:212196 Archived-At: On Fri, Feb 10, 2017 at 9:47 AM, Cl=C3=A9ment Pit-Claudel wrote: > On 2017-02-09 23:12, Vibhav Pant wrote: >> The linear search code has been shifted to bytecode.c, since there >> are a couple of assumptions about the jump table that we can't make >> for a regular hash table, so regular gethash shouldn't be affected. > > That's unfortunate: linear scans for small hash tables sounded like a nea= t optimization. > What are the assumptions that make this unsuitable for regular gethash? 1. For jump tables, HASH_TABLE_SIZE (h) =3D=3D h->count, so using h->count = directly saves the cost of an array lookup. 2. Since the size equals the count, we don't need to check whether HASH_HASH (h, i) (the hash code) is non nil in every pass of the linear search loop (maphash needs to do this, before calling the providing function). --=20 Vibhav Pant vibhavp@gmail.com