<div dir="ltr"><div class="gmail_extra">When you just call file:list_dir,  you make gen_server:call to a singleton process.</div><div class="gmail_extra"><br></div><div class="gmail_extra">When you start driver and make prim_file calls to it, you are working on your own thread.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Of course you must avoid lists if you do micro benchmarks:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">list_dir(Port, Dir) -></div><div class="gmail_extra">  {ok, Entries} = prim_file:list_dir(H, Dir),</div><div class="gmail_extra">  [list_dir(Port, <<Dir/binary, "/", (list_to_binary(E))/binary>>) || E <- Entries].</div><div class="gmail_extra"><br></div><div class="gmail_extra">and of course, there should not be any magical performance.</div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>