Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In C you're allocating about 381MB of memory assuming 32bit integers, and iterating over it. In Perl, you're allocating 100,000,000 scalars, and passing them on the call stack. Your C code and what Perl is doing are far from comparable. You could see at least part of what's going on by browsing the XS source file for List::MoreUtils, here: MoreUtils.xs. But that doesn't show how the list is being built by Perl, nor how it's being passed on "The Stack." Just keep in mind that you're dealing with one hundred million Perl scalars, not one hundred million ints. Dave In reply to Re: Why it takes so much time here?
by davido
|
|