Uh oh!
There was an error while loading. Please reload this page.
buffer: implement iterable interface - #525
Conversation
This makes possible to use `for..of` loop with buffers. Also related `keys`, `values` and `entries` methods are added for feature parity with `Uint8Array`.
vkurchatkin
commented
Jan 20, 2015
Benchmark results: |
vkurchatkin
commented
Jan 20, 2015
Basically it's 30 times slower. Not that bad. Eventually will become faster: https://code.google.com/p/v8/issues/detail?id=3822 Looks like functions with |
rvagg
commented
Jan 20, 2015
Another one for 1.1.0 perhaps |
There was a problem hiding this comment.
@vkurchatkin Can you drop the license boilerplate? The TC recently decided to do away with it.
bnoordhuis
commented
Jan 20, 2015
LGTM but like @rvagg said, on hold for 1.1. The strategy for minor version bumps will be discussed in tomorrow's TC meeting. But thanks for doing this, Vladimir! |
feross
commented
Jan 20, 2015
@vkurchatkin If you're feeling ambitious, please also send a PR to the npm module |
9aba596 to
d67e2f7Comparevkurchatkin
commented
Jan 21, 2015
@feross I'll look into it, but a quick test shows that it works already in Chrome since |
vkurchatkin
commented
Jan 21, 2015
added one more benchmark case which use iterator, but not variter=buffer[Symbol.iterator]();varcur=iter.next();while(!cur.done){console.log(cur.value);cur=iter.next();}Results: I think we can expect at least as much speed with |
rvagg
commented
Jan 23, 2015
this was tagged with tc-agenda but I'm not sure we properly covered it, @bnoordhuis your call as to whether the tag is removed or left for next meeting bundled with further versioning discussion |
rvagg
commented
Jan 27, 2015
#625 being merged has forced us to a semver-minor situation so this could probably be merged now so it makes it in to 1.1.0, I don't see any -1s here. |
This makes possible to use `for..of` loop with buffers. Also related `keys`, `values` and `entries` methods are added for feature parity with `Uint8Array`. PR-URL: #525 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
vkurchatkin
commented
Jan 28, 2015
landed in 45d8d9f |
See #204
R=@bnoordhuis