From edi at agharta.de Sun Aug 22 18:55:04 2004 From: edi at agharta.de (Edi Weitz) Date: Sun, 22 Aug 2004 20:55:04 +0200 Subject: [cl-ppcre-devel] Re: freeze-type ing cl-ppcre? In-Reply-To: (Jim Prewett's message of "Sun, 22 Aug 2004 10:18:39 -0600 (MDT)") References: Message-ID: <87r7pzf1fb.fsf@bird.agharta.de> Hi Jim! On Sun, 22 Aug 2004 10:18:39 -0600 (MDT), Jim Prewett wrote: > I was poking around the CMUCL optimizations page and came across the > freeze-type declaration. > > I tried adding it to LoGS and it made a notable improvement. I also > tried adding it to CL-PPCRE and found that that seemed to help as > well. > > Is this going to bite me? Do the cl-ppcre types change ever? I'm not familiar with FREEZE-TYPE. How did you use it and how did it improve CL-PPCRE? Is this new in 19a? Would you mind taking the rest of this exchange to the mailing list (see Cc)? Thanks. Cheers, Edi. From download at hpc.unm.edu Mon Aug 23 13:36:46 2004 From: download at hpc.unm.edu (Jim Prewett) Date: Mon, 23 Aug 2004 07:36:46 -0600 (MDT) Subject: [cl-ppcre-devel] Re: freeze-type ing cl-ppcre? In-Reply-To: <87r7pzf1fb.fsf@bird.agharta.de> Message-ID: Hi Edi, > I'm not familiar with FREEZE-TYPE. How did you use it and how did it > improve CL-PPCRE? Is this new in 19a? Apparently, yes it is new in 19a. I simply added the declaration: (declaim (extensions:freeze-type regex seq alternation lookahead lookbehind repetition register standalone back-reference char-class str anchor everything word-boundary branch void)) * I just grepped for defclass to build this list of classes * The CMUCL manual says this: "The extensions:freeze-type declaration is a CMUCL extension that enables more efficient compilation of user-defined types by asserting that the definition is not going to change. This declaration may only be used globally (with declaim or proclaim). Currently freeze-type only affects structure type testing done by typep, typecase, etc." My "benchmark" was really quick and dirty, so i'm not sure I trust the results. :) Thanks Edi!, Jim -- James E. Prewett "everything that is, that was, was not enough" Systems Team Leader 505.277.8210 Designated Security Officer download at hpc.unm.edu Jim at Prewett.org HPC Systems Engineer III @ HPC at UNM OpenPGP key: pub 1024D/31816D93 From edi at agharta.de Mon Aug 23 14:22:02 2004 From: edi at agharta.de (Edi Weitz) Date: Mon, 23 Aug 2004 16:22:02 +0200 Subject: [cl-ppcre-devel] Re: freeze-type ing cl-ppcre? In-Reply-To: (Jim Prewett's message of "Mon, 23 Aug 2004 07:36:46 -0600 (MDT)") References: Message-ID: <87y8k6lyt1.fsf@bird.agharta.de> On Mon, 23 Aug 2004 07:36:46 -0600 (MDT), Jim Prewett wrote: > Apparently, yes it is new in 19a. > > I simply added the declaration: > > (declaim (extensions:freeze-type regex seq alternation lookahead > lookbehind repetition register standalone back-reference char-class > str anchor everything word-boundary branch void)) > > * I just grepped for defclass to build this list of classes * > > The CMUCL manual says this: > > "The extensions:freeze-type declaration is a CMUCL extension that > enables more efficient compilation of user-defined types by > asserting that the definition is not going to change. This > declaration may only be used globally (with declaim or > proclaim). Currently freeze-type only affects structure type testing > done by typep, typecase, etc." > > My "benchmark" was really quick and dirty, so i'm not sure I trust > the results. :) OK, from this description I suppose it's safe to add this to CL-PPCRE because the class definitions don't change. You /might/ see a little performance increase but only during scanner creation I guess. Cheers, Edi. From download at hpc.unm.edu Mon Aug 23 14:37:33 2004 From: download at hpc.unm.edu (Jim Prewett) Date: Mon, 23 Aug 2004 08:37:33 -0600 (MDT) Subject: [cl-ppcre-devel] Re: freeze-type ing cl-ppcre? In-Reply-To: <87y8k6lyt1.fsf@bird.agharta.de> Message-ID: That would explain my benchmark! I was creating new scanners left and right! (I dynamically generate regexps at run-time; the stuff i've been doing lately makes *a lot* of them :) But, the speed-up is relatively minor. :) Jim On Mon, 23 Aug 2004, Edi Weitz wrote: > On Mon, 23 Aug 2004 07:36:46 -0600 (MDT), Jim Prewett wrote: > > > Apparently, yes it is new in 19a. > > > > I simply added the declaration: > > > > (declaim (extensions:freeze-type regex seq alternation lookahead > > lookbehind repetition register standalone back-reference char-class > > str anchor everything word-boundary branch void)) > > > > * I just grepped for defclass to build this list of classes * > > > > The CMUCL manual says this: > > > > "The extensions:freeze-type declaration is a CMUCL extension that > > enables more efficient compilation of user-defined types by > > asserting that the definition is not going to change. This > > declaration may only be used globally (with declaim or > > proclaim). Currently freeze-type only affects structure type testing > > done by typep, typecase, etc." > > > > My "benchmark" was really quick and dirty, so i'm not sure I trust > > the results. :) > > OK, from this description I suppose it's safe to add this to CL-PPCRE > because the class definitions don't change. You /might/ see a little > performance increase but only during scanner creation I guess. > > Cheers, > Edi. > -- James E. Prewett "everything that is, that was, was not enough" Systems Team Leader 505.277.8210 Designated Security Officer download at hpc.unm.edu Jim at Prewett.org HPC Systems Engineer III @ HPC at UNM OpenPGP key: pub 1024D/31816D93