Closed
Bug 871549
Opened 11 years ago
Closed 11 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)
2.57 KB,
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•11 years ago
|
Assignee: nobody → vladimir
Assignee | ||
Comment 1•11 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•11 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•11 years ago
|
tracking-firefox23:
--- → ?
Assignee | ||
Comment 3•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b0d31eceef1
Assignee | ||
Comment 4•11 years ago
|
||
Yeah, we'll need the reset bits on Aurora, but should just take the whole thing.
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3b0d31eceef1
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Comment 6•11 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•11 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•11 years ago
|
||
Huh, I thought it landed on 23 also. In that case, nothing needed!
Flags: needinfo?(vladimir)
Updated•11 years ago
|
tracking-firefox23:
? → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•