Archive: Weak performance


Weak performance
i'm using the Locate plugin and ReplaceInFile to write file names into a file. unfortunately, this performs incredibly slow.

for reference:
275 files (max. file size 43kb) in 12 folders took more than 2 minutes on a core2quad 2.66mhz and a intel postville g2 ssd

here the essential commands:

${locate::Open} "$MyDirectory" "/D=0 /G=1 /M=*.$MyFileType /SD=NAME /SF=NAME" $0

..
StrCpy $R0 0
StrCpy $R1 1
loop:
${locate::Find} $0 $1 $2 $3 $4 $5 $6
IfFileExists "$1" 0 close
${ReplaceInFile} "$MyScript.nsi" "##MYFILE-$R0##" "File $\"$3$\"$\n ##MYFILE-$R1##"
IntOp $R0 $R0 + 1
IntOp $R1 $R1 + 1
Goto loop
close:


any ideas why this takes so long?

Could you comment out the call to ${ReplaceInFile} to check the performance of locate? It should not be slow unless the plugin is badly designed. It would not surprise me if ReplaceInFile is the problem, NSIS code is not super fast, and FileRead to read one line at the time in a loop is going to be slow...


that's it. i shouldn't be surprised, had performance issues with ReplaceInFile before. i take it then that afrow's function ain't much faster. let's see how good textreplace is.


that did the job, the same task is done within a few seconds. thanks!