Re: [XHR2] Progress events during synchronous requests

On Thu, Feb 12, 2009 at 1:19 AM, Anne van Kesteren <annevk@opera.com> wrote:
> On Wed, 11 Feb 2009 22:44:17 +0100, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> Is there a reason why the spec says to not send progress events
>> (upload and download) during synchronous requests, while still saying
>> that readystatechange events should be fired?
>>
>> I guess it can be argued that progress events (especially the load
>> event) is less useful for synchronous loads and that not dispatching
>> them is a performance optimization. Is that the reason?
>>
>> I don't really feel strongly either way, though I do think that from a
>> web developers point of view it would be more useful to dispatch the
>> events than not to dispatch them. And being consistent with regards to
>> readystatechange is always nice.
>
> It is a performance optimization, yes. Firing a lot of progress events for a
> large file that is synchronously downloaded in a Web Worker seems like
> waste. The reason readystatechange events are dispatched is because Internet
> Explorer already did that.

At least in gecko it is not a big performance win. In fact, I doubt
that it's even measurable. I'd be surprised if this was significantly
different in other implementations.

That said, I'm personally fine with waiting to add these events until
authors start asking for them. But I suspect they will.

/ Jonas

Received on Thursday, 12 February 2009 09:52:53 UTC