optimization ?
Vladimir Sekissov
svg@REDACTED
Tue Apr 22 09:43:30 CEST 2003
Good day,
cpressey> > dirs(Top, Tail, T ++ Acc)
cpressey> ^^^^^^^^
cpressey> This is probably one reason that it's kind of slow. To perform T ++
cpressey> Acc, the runtime has to search for the end of the T list, which is
cpressey> expensive compared to a simple cons. You might want to try [T|Acc]...
According to fprof function spends most time in {file,read_link_info}:
CNT ACC
{test,dirs,3} 1086 2365.887
{file,read_link_info,1} 1010 2152.686
{erlang,'++',2}, 1085 24.044
Best Regards,
Vladimir Sekissov
More information about the erlang-questions
mailing list