Re: The rename command…
Johnny Rosenberg
gurus.knugum at gmail.com
Thu Aug 28 10:16:03 UTC 2008
2008/8/28 Ulf Rompe <Ulf.Rompe at icem.com>
> On Mi, 2008-08-27 at 21:46 +0200, Johnny Rosenberg wrote:
> > I don't know very much about Perl, almost nothing at all, but isn't
> > Perl a programming language that doesn't use a compiler? Maybe I
> > misunderstood, but isn't the Perl rename thing written in Perl? If so,
> > shouldn't that mean that rename is quite a lot slower than it would be
> > if it was written in, for example, C, like I think the rest of the
> > Unix/GNU/Linux commands are, such as mv?
>
> You're right, Perl is an interpreted language. Therefore in general the
> startup time of a program written in Perl is longer that that of a
> compiled C program. OTOH, when it comes to regular expressions, Perl is
> unbeatable fast, so a Perl program may well outperform a C counterpart
> in runtime.
Yes, I think you are right there. And my simple tests seem to agree with
you. When find only sent files that should be renamed to rename, it took
slightly more time to perform the operations than if find sent all the links
it could find, letting rename do the selection. Not that it's that big
difference with only 342 files out of a little less than 22000 files, maybe
I should have made a couple of thousand links to change, to really see the
difference.
>
>
> I don't think your use case is complex enough to really precipitate a
> difference between both that would be more than just measurable, but for
> sure you could construct commands that would perform way better in
> either the C or the Perl variants.
Probably…
>
>
> [x] ulf
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080828/eba5f68b/attachment.html>
More information about the ubuntu-users
mailing list