-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
url: always show password for URL instances #12420
Conversation
lib/internal/url.js
Outdated
const innerOpts = Object.assign({}, ctx); | ||
if (recurseTimes !== null) { | ||
innerOpts.depth = recurseTimes - 1; | ||
var separator = ', '; |
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.
Is performance the reason for changing const
to var
?
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.
Yes, permanent deopt.
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.
Didn't read commit message, sorry.
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.
Is there a V8 bug for this? cc @nodejs/v8
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.
@joyeecheung I don't think it's a 'bug' per se, just something that isn't optimized yet in the version of V8 in master.
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.
I think we might want to add a comment here in case someone feels like replacing those with const
again.
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.
I'm not sure it needs a comment. Many optimizations are made without comments describing why they exist, including prior permanent deopt fixes. Also, the hope is that V8 will (or already has) fix the deopt (perhaps with ignition + turbofan... I don't recall which pipeline the function was being optimized under).
Ideally such permanent deopts would be checked when pushing such code in the first place. Perhaps having a Makefile target that runs the parallel tests with --trace-opt --trace-deopt
and greps for /aborted|disabled/
would be helpful in achieving this in an automated way.
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.
Ideally, I agree - but since it was missed the first time around in mscdex@6b6123c#diff-7fa9474fccb31c3ccef5d728fbd5248bR865 and I don't think performance regressions are run against every small refactoring I think a comment would still be useful in this particular case.
If we can figure how to do it in an automated way that would be great, I don't think contributors are not very familiar with the basic performance tooling like --trace-deopt
let alone can understand their output very easily.
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.
@benjamingr It's not just this one line though. Many times all const
/let
in the containing function has to be changed before the perm deopt goes away.
As far as checking for permanent deopts, the method I described works well enough:
node --trace-opt --trace-deopt foo.js | grep -iP 'abort|disabled'
If anything shows up, then there is a perm deopt somewhere. The name of the function or variable is included in the output FWIW.
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.
Then I'm +1 on adding it to the makefile, worst case someone will not understand it and open an issue and we can discuss whether or not it's confusing then, good case - people understand it right off the bat.
lib/internal/url.js
Outdated
@@ -874,32 +871,32 @@ class URLSearchParams { | |||
this[context] = null; | |||
} | |||
|
|||
[util.inspect.custom](recurseTimes, ctx) { | |||
[util.inspect.custom](depth, opts) { |
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.
I prefer the recurseTimes
/ctx
wording since that's what's used in util.js
.
I'm good with this but it may be worthwhile putting the const to var changes in their own commit that can be easily reverted once the optimization issue is resolved in master |
I might just fold the deopt fixes into #12456 instead... |
e17ebce
to
5584f10
Compare
Ok, I've removed the deopt change and I guess I'll just forget the variable name changes.... I'll let someone else submit a PR if they want to use consistent names. So now it's just the password change. |
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.
Still LGTM.
This needs a rebase. |
This matches browser behavior.
5584f10
to
bd7c5c9
Compare
This matches browser behavior. PR-URL: #12420 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Landed in d7ba2a6 |
This matches browser behavior. PR-URL: #12420 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This matches browser behavior. PR-URL: #12420 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This matches browser behavior. PR-URL: #12420 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This matches browser behavior.
CI: https://ci.nodejs.org/job/node-test-pull-request/7413/
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)