by Željko Filipin
This is slightly edited conversation Is there a way to make file_field.set faster? from wtr-general mailing list.
Is there a way to make
I have noticed that this is the slowest part of my tests. It takes about 10 seconds to set file field. I have read that it can not be set directly because that would be security issue, but I wonder what I could do to make it faster. I upload extremely small files (a few bytes), but I have to do it frequently, and every time it takes about 10 seconds just to set file field.
This works for me and it is much faster because it uses the handle of the object.
startClickerworks double faster than
Then I removed line with
It is now even faster (for three seconds) after I removed line with
sleep 3(when I noticed that comment says that it can be removed).
file_field.setneeded approximately 10.6 seconds to set file field,
startClicker4.4, and when I removed
sleep 3,it is down to 1.4. That saved me approximately 9 seconds for each file upload (and I do it a lot).