[Pdx-pm] string comparison vs hash

chromatic chromatic at wgz.org
Tue May 29 23:58:08 PDT 2007

On Tuesday 29 May 2007 23:47:38 Eric Wilhelm wrote:

> # on Tuesday 29 May 2007 03:54 pm:
> >Worse than that, the first code to read the file pays the penalty of
> >populating file buffers.  Subsequent reads probably all come from a
> > warm cache.

> Are we talking operating-system cache or perl guts? 

OS cache.

> And, if only the OS, is there anything tying that to a given process?

Not in any OS I know.  (NB: I understand how a modern Unix works, which means 
nothing when it comes to Windows or anything as exotic as Mac OS X.)

> I'm under the impression that given a linux machine which is not
> actively swapping memory that the cache is as warm as it is going to
> get after e.g. 'grep . file > /dev/null'.  Other than obvious machine
> load, is there anything else going on there WRT per-process caching or
> perl?

Perl, no.  OS--depends.

Still, if the benchmark's fast enough to say "I didn't run enough iterations 
to get a reliable count", I start to suspect that seek time and transfer 
rates will suddenly start to matter a lot more than the difference between 
indexed and keyed aggregate access.

Accurate benchmarking is Not Easy.

-- c

More information about the Pdx-pm-list mailing list