This is no surprise, regexp is a relatively heavy function, a lot of dirty
work behind the scene.
On Thu, Apr 16, 2009 at 2:13 PM, John W. Krahn wrote:
> Emen Zhao wrote:
>
>> This is off topic. But I'm just curious about why "4096" is picked here.
>> Is
>> there any particular reason behind it?
Thank you, Chas! This is great to know. I guess I got used to taking a
plethora of memory as granted. :-)
--Emen
Emen Zhao wrote:
This is off topic. But I'm just curious about why "4096" is picked here. Is
there any particular reason behind it? I guess you can even calc the lines
like this -
perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
Except that it's slower than using tr///:
$ time perl -ln077
On Thu, Apr 16, 2009 at 00:58, Emen Zhao wrote:
> This is off topic. But I'm just curious about why "4096" is picked here. Is
> there any particular reason behind it? I guess you can even calc the lines
> like this -
> perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
>
> Thanks,
> Emen
>
409
This is off topic. But I'm just curious about why "4096" is picked here. Is
there any particular reason behind it? I guess you can even calc the lines
like this -
perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
Thanks,
Emen
On 15 Apr 2009, at 13:01, John W. Krahn wrote:
Dermot wrote:
2009/4/14 Chas. Owens :
On Tue, Apr 14, 2009 at 11:49, Rick wrote:
is it true that perl will be just as fast as c for reading files ?
for example
cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
my $count = 0;
$/ =
Dermot wrote:
2009/4/14 Chas. Owens :
On Tue, Apr 14, 2009 at 11:49, Rick wrote:
is it true that perl will be just as fast as c for reading files ?
for example
cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
my $count = 0;
$/ = \4096;
while (<>) {
$count += tr/\n//;
2009/4/14 Chas. Owens :
> On Tue, Apr 14, 2009 at 11:49, Rick wrote:
>> is it true that perl will be just as fast as c for reading files ?
>>
>> for example
>>
> cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
> my $count = 0;
>
> $/ = \4096;
> while (<>) {
> $count += tr/\n//
On Tue, Apr 14, 2009 at 11:49, Rick wrote:
> is it true that perl will be just as fast as c for reading files ?
>
> for example
>
> will below be as fast as if it were written in c?
> I said this because on random posts, I see that perl is optimized to work w/
> text files and it should be as fas
is it true that perl will be just as fast as c for reading files ?
for example
will below be as fast as if it were written in c?
I said this because on random posts, I see that perl is optimized to
work w/ text files and it should be as fast as perl
open FILE, $file or die "bad filename: $!"
Haslock; [EMAIL PROTECTED]
Subject: Re: C vs. Perl
Thank-you to everyone for the responses.
Roger,
1) I am personally obsessed with effeciency. This is why I am considering
moving to C or C++.
2) I am not exactly sure what you mean by "profiled your Perl", however I do
do benchmarks o
ob Showalter'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 7:04 PM
Subject: RE: C vs. Perl
> not to get flamed here but one of the reasons I dont like perl is that
there
> are sometimes too many ways to do something ... and all of them
> 2) I am not exactly sure what you mean by "profiled your Perl", however I
do
> do benchmarks on code. I am in the process of redesigning our website,
and
> thus taking this opportunity to improve upon old scripts that will need
> changing anyways. Current improvements to our main script have
Hello folks,
I am closing this thread. Although it is a very interesting conversation to
have with people, this really isn't the place for it. Feel free to continue it
off-list with interested parties, but consider this thread closed and do not
respond to the list itself. Thanks for your cooperat
nt: Wednesday, January 02, 2002 11:44 AM
Subject: Re: C vs. Perl
> There are many views on this.
>
> 1) Well designed and implemented C will be faster if the application is
> CPU-intensive. Is this the case?
> 2) Have you profiled your Perl? Have you experimented with the Inline
ing.
3. If you really want Perl binaries, see if
http://www.indigostar.com/perl2exe.htm is of any help.
-Original Message-
From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 02 January, 2002 12:10
To: [EMAIL PROTECTED]
Subject: C vs. Perl
Ok, the local Linux guru has pr
> -Original Message-
> From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 2:21 PM
> To: 'Maciejewski, Thomas'
> Cc: [EMAIL PROTECTED]
> Subject: RE: C vs. Perl
>
>
> No flames from me.
>
> One of Perl's st
From: Daniel Gardner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:44 PM
To: Maciejewski, Thomas
Cc: 'Hanson, Robert'; Agustin Rivera; [EMAIL PROTECTED]
Subject: Re[2]: C vs. Perl
Wednesday, January 02, 2002, 7:06:34 PM, Maciejewski, Thomas wrote:
> how ?
> thr
n.org/search?dist=Apache-Session
http://search.cpan.org/search?dist=MLDBM-Sync
hth,
daniel
> -Original Message-
> From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 2:09 PM
> To: Maciejewski, Thomas; Agustin Rivera; [EMAIL PROTECTED]
> Subj
development to use C?
- Roger -
- Original Message -
From: "Agustin Rivera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 5:10 PM
Subject: C vs. Perl
> Ok, the local Linux guru has proclaimed that C would be faster than Perl.
I
>
On Wed, 2 Jan 2002, Dean Theophilou wrote:
> Your quote is incorrect, from what I remember, that is. It's more like "a more
> wretched hive of scum and villainy" (sp?).
*shrug* My quotes come up completely randomly -- I have no control over
how accurate or not accurate they are. :-)
-- Brett
On Wed, 2 Jan 2002, Hanson, Robert wrote:
> I don't deal with IPC, so I can't give you an example off the top of my
> head. The perlfork manpage has a bunch of info though depending on what you
> want to do, and there are probably a bunch of modules out there as well to
> simplify the process.
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> heh ... again though in large groups ... this becomes a bit of a problem
> since you all have to kind of be in sync with coding styles and courteous
> coding
This is more a part of the software development process than it is the
responsibility of
'Bob Showalter'; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> not to get flamed here but one of the reasons I dont like perl is that
> there are sometimes too many ways to do something ... and all of them
> are fairly cryptic ... peo
would it be rude to ask ya'll to take this thread elsewhere. this list is
so high-traffic already. if as a fledgling newbie i've overstepped any
bounds, my apologies.
tia,
ken
On Wed, 2 Jan 2002, Brett W. McCoy wrote:
> On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
>
> > not to get flam
ago when I
played around with IPC, but I forget the name.
Rob
-Original Message-
From: Maciejewski, Thomas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:07 PM
To: Hanson, Robert; Agustin Rivera; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
how ?
through CGI?
can y
I am actually programming perl for work and am trying to learn it ...
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:22 PM
To: Maciejewski, Thomas
Cc: 'Bob Showalter'; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
On
, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:21 PM
To: Maciejewski, Thomas
Cc: [EMAIL PROTECTED]
Subject: RE: C vs. Perl
No flames from me.
One of Perl's strong/weak points is that there are too many ways to do
something... I agree with that. But it is up to the progr
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> not to get flamed here but one of the reasons I dont like perl is that
> there are sometimes too many ways to do something ... and all of them
> are fairly cryptic ... people having different coding styles can really
> confuse the hell out of some
opt for
the first... saves me lots of time and typing.
Just be curtious when you code.
Rob
-Original Message-
From: Maciejewski, Thomas [mailto:[EMAIL PROTECTED]]
Subject: RE: C vs. Perl
not to get flamed here but one of the reasons I dont like perl is that there
are sometimes too many
: Agustin Rivera; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> agreed that OO isnt always better but the point that I was trying to make
> was that I would rather build more structured code that is easier to
> maintain / debug than to worry
how ?
through CGI?
can you post an example?
-Original Message-
From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:09 PM
To: Maciejewski, Thomas; Agustin Rivera; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
"One benifit to running java though .
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> agreed that OO isnt always better but the point that I was trying to make
> was that I would rather build more structured code that is easier to
> maintain / debug than to worry about the internal speed of a program ...
> also wanted to point out t
ustin Rivera; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
agreed that OO isnt always better but the point that I was trying to make
was that I would rather build more structured code that is easier to
maintain / debug than to worry about the internal speed of a program ...
also wanted to point out
, January 02, 2002 1:58 PM
To: Maciejewski, Thomas
Cc: [EMAIL PROTECTED]
Subject: RE: C vs. Perl
> -Original Message-
> From: Maciejewski, Thomas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 1:44 PM
> To: 'Brett W. McCoy'; Agustin Rivera
> Cc: [E
t W. McCoy'; Agustin Rivera
Cc: [EMAIL PROTECTED]
Subject: RE: C vs. Perl
how about all of the issues involved with spawning off processes ...
in java servlets I know this is handled because the servlet is always
running ...
you may end up with a more efficient system and easier to debug
:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 2:01 PM
To: Maciejewski, Thomas
Cc: Agustin Rivera; [EMAIL PROTECTED]
Subject: RE: C vs. Perl
On Wed, 2 Jan 2002, Maciejewski, Thomas wrote:
> how about all of the issues involved with spawning off processes ...
>
> in java servlets I kno
> -Original Message-
> From: Maciejewski, Thomas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 1:44 PM
> To: 'Brett W. McCoy'; Agustin Rivera
> Cc: [EMAIL PROTECTED]
> Subject: RE: C vs. Perl
>
>
> how about all of the issues
y end up with a more efficient system and easier to debug code and all
> of the other benifits from OO ... pretty much all around better by
> re-writing in java ... rather than c
Bah, OO isn't always the best way. I won't get into a Java vs. C vs. Perl
thing here, but you code in a s
PROTECTED]
Subject: Re: C vs. Perl
I personally think if you have working, secure scripts in Perl, and are
accustomed to maintaining them, then it is not worthwhile to port to C.
While it is faster, I think the time spent fussing with the porting, etc is
not worth it. If you really, really need more
by
re-writing in java ... rather than c
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 1:21 PM
To: Agustin Rivera
Cc: [EMAIL PROTECTED]
Subject: Re: C vs. Perl
On Wed, 2 Jan 2002, Agustin Rivera wrote:
> Ok, the local Linux guru
On Wed, 2 Jan 2002, Agustin Rivera wrote:
> Ok, the local Linux guru has proclaimed that C would be faster than Perl. I
> know C is very effecient so I don't really doubt him, but my question is
> would it make that much of a difference? I certainly wouldn't mind learning
> C, the only ques
ot;Agustin
Rivera" To: <[EMAIL PROTECTED]>
Su
--- Agustin Rivera <[EMAIL PROTECTED]> wrote:
> Ok, the local Linux guru has proclaimed that C would be faster than Perl. I
> know C is very effecient so I don't really doubt him, but my question is
> would it make that much of a difference? I certainly wouldn't mind learning
> C, the only q
code with the speed benefit... most likely it would be far
cheaper just to add another processor to your web box.
Rob
-Original Message-
From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 12:10 PM
To: [EMAIL PROTECTED]
Subject: C vs. Perl
Ok, the local
-Original Message-
From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 12:10 PM
To: [EMAIL PROTECTED]
Subject: C vs. Perl
Ok, the local Linux guru has proclaimed that C would be faster than Perl. I
know C is very effecient so I don't really doubt him, b
Ok, the local Linux guru has proclaimed that C would be faster than Perl. I
know C is very effecient so I don't really doubt him, but my question is
would it make that much of a difference? I certainly wouldn't mind learning
C, the only question is would be worth the time to port our Perl sc
47 matches
Mail list logo