On 2012-09-16, at 21:50, Camillo Bruni <[email protected]> wrote:
>> 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 ? > > I assume that the overhead only occurs for small files... > > > ZnClient new > signalProgress: true; > systemPolicy; > beOneShot; > url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main?format=raw'; > get. > > with progress 2.5secs without, 57ms.. :/ well might be that the server > responds with an incomplete header or so... another remark with signalProgress the time to run highly varies, 250ms - 2500ms. whereas without progress notification it stays <140ms
