Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: one-liner hogs

by extremely (Priest)
on Feb 01, 2001 at 03:59 UTC ( #55605=note: print w/replies, xml ) Need Help??


in reply to one-liner hogs

How about this for processor churn?
perl -e '$_="abcd"x100000;while(1){y/abcd/bcda/}'
perl -e '@_=0..1000000;while(1){foreach(@_){++$_,--$_}}'
perl -e '@_=0..100000;while(1){foreach(@_){$a=$_/++$_;--$_}}'

The first exercises about about 8MB of memory fairly heavily.
The second beats up 64MB of memory with light mathops.
The third eats 9MB with a heavier math op.

Obviously you can tweak how much memory is eaten with monster number in there... HTH.

--
$you = new YOU;
honk() if $you->love(perl)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://55605]
help
Chatterbox?
[shmem]: fuel is only one fuel that fuels the fools... it is all about power and control - which NOBODY will have.
[shmem]: ...can't have, since silly
[Discipulus]: yes. the central thing is the power. itself

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-04-29 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.