Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Believably slow..

by ant9000 (Monk)
on Jun 23, 2003 at 13:29 UTC ( [id://268141]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Believably slow..
in thread Unbelievably slow..

I've been trying your optimized code on my machine (an old Duron 700MHz, under medium load):
$ time ./bench.pl
187692

real    17m12.507s
user    10m3.640s
sys     0m1.300s

so it's still very slow compared to what it does.
Then, I've tried to compile it:
$ perlcc -O -o bench bench.pl
$ time ./bench
187692

real    12m35.665s
user    6m1.480s
sys     0m0.720s

It still is definitely slow, but you get an evident boost in performance just by compiling it into C code... something to remember for situations in which you really need Perl for doing lengthy tasks.

Replies are listed 'Best First'.
Re: Re: Re: Re: Believably slow..
by diotalevi (Canon) on Jun 23, 2003 at 13:37 UTC

    Well... at that point you should be using Inline::C. You write just that one function in C and leave the rest in C. You should not be under the illusion that perlcc is a substitute for that. In fact, Inline::C is one of the premier ways to interface with C stuff these days. You'd probably even want to pick it over XS when possible.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://268141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found