-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: remove {writeableState/readableState}.length #12857
Conversation
As with #12860, is performance impacted by these changes? |
Should documentation be added for the new property? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to document these properties? would it make sense to underscore prefix them and not publicly document them? |
I will run the benchmarks next week when I am back. |
@mcollina great thanks! we don't have a rush on this one, it's been open for a while so we should fix it right. |
@calvinmetcalf can you rebase? It's failing if I try to apply this. |
ok I'll rebase |
c1b27b7
to
23f2ca9
Compare
lib/_stream_duplex.js
Outdated
@@ -61,6 +61,13 @@ function Duplex(options) { | |||
this.once('end', onend); | |||
} | |||
|
|||
|
|||
Object.defineProperty(Duplex.prototype, 'writeLength', { | |||
get: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these could just be get() { ... }
Any benchmark results for this yet? |
@mscdex my fault. I've been busy and I did not have time. I'll get things done next week. |
I have pulled this on top of current master, and here are the result:
IMHO we can land this, there are no regressions. |
ok let me fix the nits and rebase |
23f2ca9
to
606964b
Compare
ok done |
Can we use 'readable' and 'writable' as the prefixes instead of just 'read' and 'write' respectively, to further reduce the likelihood of a clash with userland? I'm still -1 on adding all of these individual properties to everyone's streams. I would rather see something like an object housing all of these... |
Currently we are creating an accessory object (the state) for every Readable and Writable, and two for Duplex (and descendants). This is already a bottleneck, so I'm -1 on adding a new object for both Readable and Writable. BTW, I'm fine with documenting the _ properties, and/or remapping those. |
If we're going to document the existing ones, I'd prefer to get rid of the |
@jasnell that is not feasible either, as everyone is using those _ properties. |
@mscdex are you still -1 on this? This might require some more reviews/approvals.. @nodejs/ctc as we discussed in the last meeting. |
@mcollina Yes, I am still -1 in general to these and the related changes from other PRs. |
@calvinmetcalf Do you think you could rebase this? Otherwise I guess one of us could do that. |
I can do this in a week, or if someone is willing to help please go ahead
and land.
Il giorno mar 28 nov 2017 alle 08:02 Anna Henningsen <
notifications@github.com> ha scritto:
… @calvinmetcalf <https://github.com/calvinmetcalf> Do you think you could
rebase this? Otherwise I guess one of us could do that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12857 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADL46E03AzAdukGrmEWyFKEqE79BJ5Bks5s62KrgaJpZM4NR4Cu>
.
|
ae9f3cd
to
7753a77
Compare
As part of the readableState/writableState mega issue nodejs#445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter.
7753a77
to
915dab7
Compare
CI before landing: |
Landed as 36ffa21. |
As part of the readableState/writableState mega issue #445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter. See: #445 PR-URL: #12857 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As part of the readableState/writableState mega issue #445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter. See: #445 PR-URL: #12857 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As part of the readableState/writableState mega issue #445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter. See: #445 PR-URL: #12857 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Notable change: * async_hooks: - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither API were documented. (Andreas Madsen) #16972 * deps: - update nghttp2 to 1.29.0 (James M Snell) #17908 - upgrade npm to 5.6.0 (Kat Marchán) #17535 - cherry-pick 50f7455 from upstream V8 (Michaël Zasso) #16591 * events: - remove reaches into _events internals (Anatoli Papirovski) #17440 * http: - add rawPacket in err of `clientError` event (XadillaX) #17672 * http2: - implement maxSessionMemory (James M Snell) #17967 - add initial support for originSet (James M Snell) #17935 - add altsvc support (James M Snell) #17917 - perf_hooks integration (James M Snell) #17906 * net: - remove Socket.prototype.write (Anna Henningsen) #17644 - remove Socket.prototype.listen (Ruben Bridgewater) #13735 * repl: - show lexically scoped vars in tab completion (Michaël Zasso) #16591 * stream: - rm {writeable/readable}State.length (Calvin Metcalf) #12857 - add flow and buffer properties to streams (Calvin Metcalf) #12855 * util: - allow wildcards in NODE_DEBUG variable (Tyler) #17609 * zlib: - add ArrayBuffer support (Jem Bezooyen) #16042 * Addedew collaborator** - [starkwang](https://github.com/starkwang) Weijia Wang * Addedew TSC member** - [danbev](https://github.com/danbev) Daniel Bevenius PR-URL: #18069
Notable change: * async_hooks: - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither API were documented. (Andreas Madsen) #16972 * deps: - update nghttp2 to 1.29.0 (James M Snell) #17908 - upgrade npm to 5.6.0 (Kat Marchán) #17535 - cherry-pick 50f7455 from upstream V8 (Michaël Zasso) #16591 * events: - remove reaches into _events internals (Anatoli Papirovski) #17440 * http: - add rawPacket in err of `clientError` event (XadillaX) #17672 * http2: - implement maxSessionMemory (James M Snell) #17967 - add initial support for originSet (James M Snell) #17935 - add altsvc support (James M Snell) #17917 - perf_hooks integration (James M Snell) #17906 - Refactoring and cleanup of Http2Session and Http2Stream destroy (James M Snell) #17406 * net: - remove Socket.prototype.write (Anna Henningsen) #17644 - remove Socket.prototype.listen (Ruben Bridgewater) #13735 * repl: - show lexically scoped vars in tab completion (Michaël Zasso) #16591 * stream: - rm {writeable/readable}State.length (Calvin Metcalf) #12857 - add flow and buffer properties to streams (Calvin Metcalf) #12855 * util: - allow wildcards in NODE_DEBUG variable (Tyler) #17609 * zlib: - add ArrayBuffer support (Jem Bezooyen) #16042 * Addedew collaborator** - [starkwang](https://github.com/starkwang) Weijia Wang * Addedew TSC member** - [danbev](https://github.com/danbev) Daniel Bevenius PR-URL: #18069
Notable change: * async_hooks: - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither API were documented. (Andreas Madsen) #16972 * deps: - update nghttp2 to 1.29.0 (James M Snell) #17908 - upgrade npm to 5.6.0 (Kat Marchán) #17535 - cherry-pick 50f7455 from upstream V8 (Michaël Zasso) #16591 * events: - remove reaches into _events internals (Anatoli Papirovski) #17440 * http: - add rawPacket in err of `clientError` event (XadillaX) #17672 * http2: - implement maxSessionMemory (James M Snell) #17967 - add initial support for originSet (James M Snell) #17935 - add altsvc support (James M Snell) #17917 - perf_hooks integration (James M Snell) #17906 - Refactoring and cleanup of Http2Session and Http2Stream destroy (James M Snell) #17406 * net: - remove Socket.prototype.write (Anna Henningsen) #17644 - remove Socket.prototype.listen (Ruben Bridgewater) #13735 * repl: - show lexically scoped vars in tab completion (Michaël Zasso) #16591 * stream: - rm {writeable/readable}State.length (Calvin Metcalf) #12857 - add flow and buffer properties to streams (Calvin Metcalf) #12855 * util: - allow wildcards in NODE_DEBUG variable (Tyler) #17609 * zlib: - add ArrayBuffer support (Jem Bezooyen) #16042 * Addedew collaborator** - [starkwang](https://github.com/starkwang) Weijia Wang * Addedew TSC member** - [danbev](https://github.com/danbev) Daniel Bevenius PR-URL: #18069
As part of the readableState/writableState mega issue #445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter. See: nodejs/node#445 PR-URL: nodejs/node#12857 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
As part of the readableState/writableState mega issue #445, this
removes all of the references to .length on those properties and
replaces them with a readLength and writeLength getter.
cc @nodejs/streams
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
streams, tls, net