On 15 Sep 2012, at 01:02, Camillo Bruni <camillobruni@gmail.com> wrote:
On 2012-09-14, at 23:11, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 14 Sep 2012, at 20:57, Frank Shearar <frank.shearar@gmail.com> wrote:
Is it possible to notify every time interval? Say, every second or so. That way the cost would also not vary with download/upload speed.
Good idea, it will take some tweaking to get this to work well, I guess. I remember that some changes like this were done for the unit tests progress as well, I'll try find that code.
I still think it's not the amount of notifications that causes the pauses there must be more to it... given that the download took around 1000ms longer we would have spend more than 30ms per notification! no-way :)
running the download in the profiler showed the 1s lost is spent in the idle process ;) IMO that's rather funny :)
I wrote some code to try to have something executable to work with, but I can't find anything. (The examples use the extended version of HTTPProgress, http://code.google.com/p/pharo/issues/detail?id=6674 ) I created 1Mb and 10Mb files somewhere public. Full progress is currently only available in Zn when doing stream, as in #downloadTo: '/tmp/10Mb.bin' asFileReference ensureDeleted. [ ZnClient new systemPolicy; beOneShot; url: 'http://s3-eu-west-1.amazonaws.com/public-stfx-eu/10Mb.bin'; downloadTo: '/tmp/' ] timeToRun. [ UIManager default informUserDuring: [ :bar | bar label: 'Downloading...'. [ ZnClient new signalProgress: true; systemPolicy; beOneShot; url: 'http://s3-eu-west-1.amazonaws.com/public-stfx-eu/10Mb.bin'; downloadTo: '/tmp/' ] on: HTTPProgress do: [ :progress | bar label: progress printString. progress isEmpty ifFalse: [ bar current: progress percentage ]. self crLog: progress printString. progress resume ] ] ] timeToRun. As fas as I can tell, both run at the same speed (more or less). Is is possible to show the code where you noticed the slowdown ? Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill