[REBOL] Re: byte frequencies
From: jeff:rebol at: 6-Jul-2001 23:26
> Joel Neely wrote:
> > Jeff Kreis wrote:
> > >
> > > If you're handling very large files you'd want to use:
> > >
> > > fi: open/binary/direct fi
> > >
> > > while [ch: pick fi 1][
> > > .... fi: next fi
> > > ]
>
> Well, having done the benchmarking, I am *really* clueless
> as to how the above could ever help performance. Perhaps I
> misread the suggestion...
My apologies for not being robust above.
You are correct. Using COPY on a direct port, as
recommended by rcug, will be the fastest. I wasn't specific
enough, but was alluding to cases where reading in the whole
file would cause paging-- I just changed the file access and
used the same algorithm. You apparently understood this
issue clearly since you included the better algorithm for
the direct port case.
-jeff
P.S. I think benchmarks that involve performance impacted by
potential page faults are more meaningful when accompanied
by the test system memory stats (available system ram, etc.)
(-: No need to provide -- I believe your results. :-)