From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables. Date: Wed, 08 Feb 2017 19:56:11 +0200 Message-ID: <83y3xg4ldw.fsf@gnu.org> References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1486576630 30565 195.159.176.226 (8 Feb 2017 17:57:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2017 17:57:10 +0000 (UTC) Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Vibhav Pant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 08 18:57:06 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 1cbWUK-0007bV-2s for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2017 18:57:04 +0100 Original-Received: from localhost ([::1]:60762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbWUP-00017V-SR for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2017 12:57:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbWTi-00015l-J3 for emacs-devel@gnu.org; Wed, 08 Feb 2017 12:56:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbWTf-0003U3-IW for emacs-devel@gnu.org; Wed, 08 Feb 2017 12:56:26 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbWTf-0003Tx-G1; Wed, 08 Feb 2017 12:56:23 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2992 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cbWTd-00079a-R2; Wed, 08 Feb 2017 12:56:23 -0500 In-reply-to: (message from Vibhav Pant on Wed, 8 Feb 2017 19:08:12 +0530) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:212143 Archived-At: > From: Vibhav Pant > Date: Wed, 8 Feb 2017 19:08:12 +0530 > Cc: Stefan Monnier , > "emacs-devel@gnu.org" > > The following patch makes hash_lookup use linear search when the number of keys > in the hash table is <= 5 (chosen arbitrarily). switch bytecode run with this > patch takes 15.96 seconds to run the benchmark, while the goto-if-nil code takes > 17.15 seconds. Thanks. Please mention in the comments that 5 is arbitrary, and perhaps some considerations for choosing the value.