Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Why it takes so much time here?

by PerlOnTheWay (Scribe)
on Dec 28, 2011 at 03:42 UTC ( #945275=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Why it takes so much time here?
in thread Why it takes so much time here?

I printed the time before and after the iteration, the result is both 1325041218:

print time . "\n"; my @a = any {$_== 92} 1..100000000; print "\n"; print time;

So the time is not taken by the iteration..


Comment on Re^4: Why it takes so much time here?
Select or Download Code
Re^5: Why it takes so much time here?
by ikegami (Pope) on Dec 28, 2011 at 04:27 UTC
    oh, yes it is. 1..100000000 is executed a compile-time (constant folding).

      The same number of int takes less than 1 second to initialize

      Isn't 15 secs too much time even though a scalar requires more storage(16 bytes after test) than int?

        The same number of int takes less than 1 second to initialize

        What does that mean?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-03 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls