From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: pcase-memoize: equal first branch, yet different Date: Tue, 05 Mar 2013 04:59:45 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <8738warwtq.fsf@lifelogs.com> References: <87hakv6tek.fsf@web.de> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362477605 30459 80.91.229.3 (5 Mar 2013 10:00:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 10:00:05 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 05 11:00:30 2013 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 1UCofa-0003rf-R8 for ged-emacs-devel@m.gmane.org; Tue, 05 Mar 2013 11:00:26 +0100 Original-Received: from localhost ([::1]:40310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCofF-0000s9-Bl for ged-emacs-devel@m.gmane.org; Tue, 05 Mar 2013 05:00:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCofB-0000pR-7c for emacs-devel@gnu.org; Tue, 05 Mar 2013 05:00:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCofA-0000Df-51 for emacs-devel@gnu.org; Tue, 05 Mar 2013 05:00:01 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:46901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCof9-0000CN-Ta for emacs-devel@gnu.org; Tue, 05 Mar 2013 05:00:00 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UCofT-0003kP-68 for emacs-devel@gnu.org; Tue, 05 Mar 2013 11:00:19 +0100 Original-Received: from c-50-136-52-92.hsd1.ma.comcast.net ([50.136.52.92]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Mar 2013 11:00:19 +0100 Original-Received: from tzz by c-50-136-52-92.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Mar 2013 11:00:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-50-136-52-92.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:1JrnmWSADvWU59dO2WMrxV1y5oQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:157526 Archived-At: On Mon, 04 Mar 2013 14:33:41 -0500 Stefan Monnier wrote: SM> The pcase macro's expansion can take a significant amount of time to SM> generate. When done during byte-compilation, it's a non-issue, but in SM> the above example it will be done every time you click. SM> For this reason, pcase uses a memoization mechanism, to try and reuse SM> previous expansions. Sadly, this is unreliable because it is difficult SM> to figure out when two chunks of code are actually identical and to do SM> so without incurring undue overheads. Would it make sense to implement some parts of `pcase' at the C level? As it becomes widely used, byte-compilation delays can also become significant. (For the record, I like `pcase' a lot, and really appreciate the simplicity pattern matching brings to code.) Ted