[erlang-questions] Speeding up text file I/O
Per Gustafsson
per.gustafsson@REDACTED
Mon Jan 7 16:52:39 CET 2008
Christian S wrote:
> Do you know if this has been benchmarked against the more attractive code
> that R12B makes more efficient? Because those functions make me want to
> change profession to something where you get to hurt people.
>
I found that the following function is about 10% faster then the
unrolled function when using BEAM R12B:
find_8(Buffer, Char, Pos) ->
case Buffer of
<< Char, _/bits >> -> Pos;
<< _, Rest/bits >> ->
find_8(Rest, Char, Pos+1);
_ ->
not_found
end.
It might depend a little on the input though and when both functions
were native compiled there was no major difference between them.
Per
More information about the erlang-questions
mailing list