Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!know!samsung!sol.ctr.columbia.edu!lll-winken!uunet!pmafire!uudell!bigtex!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: Arrays and me :-( Message-ID: <110898@convex.convex.com> Date: 13 Dec 90 01:14:45 GMT References: <29144@sequoia.execu.com> <110684@convex.convex.com> Sender: usenet@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 35 I wrote: : # METHOD 2 : $passwd[1 + $.] = until eof(PASSWD); : split(/:/, $passwd[50]); : for $i (0..8) { : printf "%d %s\n", $i, $_[$i]; : } : :This runs in this time and produces the same output: : : 2.271481 real 0.654493 user 1.345908 sys : :which is a lot better, albeit to my mind still a tad slow. Silly me -- I even mentioned this in another post. I can just do: @passwd = ; unshift(@passwd, ''); # fix subscripts and now it runs this fast: 0.650994 real 0.380643 user 0.175185 sys which is better still. Why all the system time difference? I'm not sure. I did run it a few times so as to get it all in cache, but I did that for both versions. Larry, any ideas? Are you calling sbrk more efficiently (like once for a bunch) with the gobble-up-the-whole-file method? --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "With a kernel dive, all things are possible, but it sure makes it hard to look at yourself in the mirror the next morning." -me