[erlang-questions] Fast directory walker

Max Lapshin max.lapshin@REDACTED
Sat Dec 10 14:36:45 CET 2016


When you just call file:list_dir,  you make gen_server:call to a singleton
process.

When you start driver and make prim_file calls to it, you are working on
your own thread.


Of course you must avoid lists if you do micro benchmarks:



list_dir(Port, Dir) ->
  {ok, Entries} = prim_file:list_dir(H, Dir),
  [list_dir(Port, <<Dir/binary, "/", (list_to_binary(E))/binary>>) || E <-
Entries].

and of course, there should not be any magical performance.

Tests on your laptop are usually void and useless.  Take loaded server and
make tests on it.  How your software will work when HDD is responding
during 30 seconds.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161210/72c5db0e/attachment.htm>


More information about the erlang-questions mailing list