I just benchmarked Filter, and it was worse than 100 times slower
In a message dated 2/19/2004 6:53:56 PM Eastern Standard Time,
[EMAIL PROTECTED] writes:
last time i benchmark a source filter, it's about 100 times slower. has that
change since v5.8?
-Will
---
Anthony Vanelverdinghe wrote:
>
> Hi
Hello,
> Could anyone please tell me what's wrong with the following "program"?
> The compiler gives errors in the switch statement.
>
> %commands=('v',0,'w',1,'t',2,'/pattern/',3,'s',4,'x',5);
> $end = 0;
> while (!end){
> print "bookmarks.html>";
> $operat
Rob Dixon wrote:
> <[EMAIL PROTECTED]> wrote:
>>
>> The Advantage is you get to use the switch statement. The disadvantage is
>> your code will run extraordinarily slow because the Switch module uses a
>> run time Filter. In short: isn't an is-elsif-else statement enough??
>
> Are you saying that
On Feb 19, 2004, at 5:21 PM, Paul Johnson wrote:
The problem is that Switch.pm is a source filter, which is effectively
an extra level of processing before compilation.
Personally, I wouldn't use a source filter for anything I cared about.
The docs for Switch state:
There are undoubtedly serio
On Thu, Feb 19, 2004 at 10:46:33PM -, Rob Dixon wrote:
> <[EMAIL PROTECTED]> wrote:
> >
> > The Advantage is you get to use the switch statement. The disadvantage is
> > your code will run extraordinarily slow because the Switch module uses a run time
> > Filter. In short: isn't an is-elsif-els
This:
if ($op == 0) {}
elsif ($op == 1) {}
elsif ($op == 2) {}
elsif ($op == 3) {}
elsif ($op == 4) {}
elsif ($op == 5) {}
is faster than this:
use Switch;
switch ($op) {
case 0 { last }
case 1 { last }
case 2 { last }
case 3 { last }
case 4 { last }
case 5 { last }
}
B
<[EMAIL PROTECTED]> wrote:
>
> The Advantage is you get to use the switch statement. The disadvantage is
> your code will run extraordinarily slow because the Switch module uses a run time
> Filter. In short: isn't an is-elsif-else statement enough??
Are you saying that 'if-elsif-else' is a compil
In addition, I've been playing around with the 'use diagnostics' feature in perl.
That's in addition to 'use warnings'. I don't recommend it for regular coding but
when stumped it may help.
> On Feb 19, 2004, at 3:14 PM, Anthony Vanelverdinghe wrote:
>
> > Hi
>
> Howdy.
>
> > Could anyone
The Advantage is you get to use the switch statement. The disadvantage is
your code will run extraordinarily slow because the Switch module uses a run time
Filter. In short: isn't an is-elsif-else statement enough??
In a message dated 2/19/2004 4:40:56 PM Eastern Standard Time, [EMAIL PROTECTED]
--As of Thursday, February 19, 2004 10:29 PM +0100, Anthony Vanelverdinghe
is alleged to have said:
Didn't know it wasn't in Perl, but I've just discovered it's possible
with some file called "Switch.pm"
--As for the rest, it is mine.
You mean the 'Switch' module. (Sorry, I should have mentione
On Feb 19, 2004, at 3:14 PM, Anthony Vanelverdinghe wrote:
Hi
Howdy.
Could anyone please tell me what's wrong with the following "program"?
I'll try.
The compiler gives errors in the switch statement.
Perl doesn't have a native switch statement, but it is included as a
module in 5.8+
Thx!!
An
Didn't know it wasn't in Perl, but I've just discovered it's possible with
some file called "Switch.pm"
From: Daniel Staal <[EMAIL PROTECTED]>
Reply-To: Perl Beginners <[EMAIL PROTECTED]>
To: Perl Beginners <[EMAIL PROTECTED]>
Subject: Re: switch
--As of Thursday, February 19, 2004 10:14 PM +0100, Anthony Vanelverdinghe
is alleged to have said:
Could anyone please tell me what's wrong with the following "program"?
The compiler gives errors in the switch statement.
--As for the rest, it is mine.
You mean, besides the fact that Perl doesn'
13 matches
Mail list logo