You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.
Usage of Buffer isn't really necessary for browsers.
We just want simpler functions that let us encode and decode data to/from UInt8Array instances.
Looking at https://github.com/feross/buffer/blob/master/index.js the implemetation actually has internal checks and assertions which could be skipped, which could speed up our encoding and decoding process in the browser.
If this ever succeeds, we can even use these UInt8Array functions on the node implementation for speed, since UInt8Arrays can be converted to Buffer instances anyways.
Notes:
This would also require stricter type checks, such as isPlainObject implementation from Lodash.
fetch requests accepts UInt8Array instances directly as ArrayBufferView, XMLHttpRequest also accepts UInt8Array as BufferSource
process.binding('buffer') is now deprecated and set to be removed in future node releases, so for fuck's sake we will be using native Buffer instances for speed in server-side implementation
Usage of Buffer isn't really necessary for browsers.
We just want simpler functions that let us encode and decode data to/from UInt8Array instances.
Looking at https://github.com/feross/buffer/blob/master/index.js the implemetation actually has internal checks and assertions which could be skipped, which could speed up our encoding and decoding process in the browser.
If this ever succeeds, we can even use these UInt8Array functions on the node implementation for speed, since UInt8Arrays can be converted to Buffer instances anyways.
Notes:
fetch
requests accepts UInt8Array instances directly asArrayBufferView
,XMLHttpRequest
also accepts UInt8Array asBufferSource
fetch
response body has.arrayBuffer()
method which returns an ArrayBuffernew UInt8Array(arrayBuffer);
( new UInt8Array() ).buffer
References
The text was updated successfully, but these errors were encountered: