Re: [whatwg/encoding] " push a copy of input " (#92)

I assumed implementations didn't actually copy the bytes but did a synchronous decode and retain decoder state deep in the bowels of the decoder implementation (e.g. ICU, etc) as @ricea mentions; implicitly a "scratch buffer" but not necessarily coded as such. I know Blink does this, both for ICU and custom decoders. 

Since it's always that case that undetectable differences cannot preclude implementations, I don't see why it's worth specifically calling out here. Then again, if we have evidence this is an implementation mistake (is that why Gecko is failing?) no objection to a non-normative implementation hint.

And re: detaching the buffer: as an anecdote, we recently made parts of Blob creation unobservably async in Blink, but it can lead to cases where script loses a natural throttle and starts chewing up more memory faster than the rest of the system can keep up, eventually hitting OOM. The actual script-referenced memory is low, it's the implicit references to the original buffer that are bloating things. Stick ricea@'s example in a loop and the same thing will happen. So... yeah, color me nervous about blithely introducing detaching.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/92#issuecomment-278732529

Received on Thursday, 9 February 2017 18:38:57 UTC