Closed
Bug 871549
Opened 12 years ago
Closed 12 years ago
Use Content-Length in XHR ArrayBuffer request, maybe introduce X-Decoded-Length
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: vlad, Assigned: vlad)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
With bug 866431, the memory usage of ArrayBuffer XHR requests was reduced by reading directly into a growing ArrayBuffer. We can do even better by trusting Content-Length in the header and using that as the initial allocation size, avoiding realloc fragmentation.
Using just Content-Length would be a big win, because it's unlikely that ArrayBuffer-XHR content will be served with gzip encoding. But it might be, and there's no good way to handle that; I'd suggest introducing a new X-Decoded-Length header that we'll honor if present for that case.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → vladimir
Assignee | ||
Comment 1•12 years ago
|
||
Simple patch. Use Content-Length on ArrayBuffer loads if it's specified, up to a max of 1GB.
Also adds a missing reset() to ResetResponse(), which is a bug currently (if the arraybuffer XHR is aborted without the response being read, a subsequent load would keep appending right now).
Attachment #749648 -
Flags: review?(bzbarsky)
Comment 2•12 years ago
|
||
Comment on attachment 749648 [details] [diff] [review]
use Content-Length, and fix ResetResponse
r=me.
We'll need at least the reset() bits on Aurora, right?
Attachment #749648 -
Flags: review?(bzbarsky) → review+
Updated•12 years ago
|
tracking-firefox23:
--- → ?
Assignee | ||
Comment 3•12 years ago
|
||
Assignee | ||
Comment 4•12 years ago
|
||
Yeah, we'll need the reset bits on Aurora, but should just take the whole thing.
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Comment 6•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #2)
> Comment on attachment 749648 [details] [diff] [review]
> use Content-Length, and fix ResetResponse
>
> r=me.
>
> We'll need at least the reset() bits on Aurora, right?
Bug 866431 only landed on 24, so what & why do we need something for Aurora here?
Comment 7•12 years ago
|
||
Ah, I thought it had landed on 23. Vlad, do we need anything on Aurora here, or are we all good there?
Flags: needinfo?(vladimir)
Assignee | ||
Comment 8•12 years ago
|
||
Huh, I thought it landed on 23 also. In that case, nothing needed!
Flags: needinfo?(vladimir)
Updated•12 years ago
|
tracking-firefox23:
? → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•