From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Inefficiency in Bgotoifnil byte-code instruction Date: Tue, 03 Jul 2012 09:19:53 -0400 Message-ID: References: <87k3yq2htz.fsf@fleche.redhat.com> <87y5n2vupa.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341321620 4540 80.91.229.3 (3 Jul 2012 13:20:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2012 13:20:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 03 15:20:16 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sm31Z-0000mt-ME for ged-emacs-devel@m.gmane.org; Tue, 03 Jul 2012 15:20:14 +0200 Original-Received: from localhost ([::1]:53093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm31Y-0007TH-Eq for ged-emacs-devel@m.gmane.org; Tue, 03 Jul 2012 09:20:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm31Q-0007PX-Eg for emacs-devel@gnu.org; Tue, 03 Jul 2012 09:20:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm31I-0000Ba-JA for emacs-devel@gnu.org; Tue, 03 Jul 2012 09:20:04 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:15866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm31I-0000BN-F2 for emacs-devel@gnu.org; Tue, 03 Jul 2012 09:19:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCquH/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA0kMYdrBboJkEQDozOBWIMF X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="192530607" Original-Received: from 76-10-171-135.dsl.teksavvy.com (HELO pastel.home) ([76.10.171.135]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Jul 2012 09:19:53 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 48AAE4E706; Tue, 3 Jul 2012 09:19:53 -0400 (EDT) In-Reply-To: <87y5n2vupa.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon, 02 Jul 2012 13:17:37 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151387 Archived-At: > +#define Bstack_ref1 1 [...] > + LABEL (Bstack_ref1), [...] Can't we merge those two exhaustive lists (the first is only used in the non-threaded case and the other only in the threaded case). If we turn the first set of #defines into an enum, we should be able to bring the syntax of the two declarations close enough that the difference can be abstracted out into a few macros. > FWIW I suspect a bigger win would be had by applying this treatment -- > or even better, a full threaded interpreter -- to the regexp matcher. > Back when I did some profiling of Emacs, the regexp matcher was higher > in my profiles than the bytecode interpreter. There's a lot of room for improvement in the regexp-matcher as well, yes. If we could generate the code via something like vmgen it would be even better. Stefan