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

Ok, what about pure CPU speed limitations?

15/100,000,000 s per iteration
= 0.00000015 s per iteration
= 150 ns per iteration

Is that unreasonable?

Replies are listed 'Best First'.
Re^4: Why it takes so much time here?
by PerlOnTheWay (Monk) on Dec 28, 2011 at 03:42 UTC

    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..

      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?