util: fix negative 0 check in inspect#17507
Conversation
lib/util.js
Outdated
There was a problem hiding this comment.
The performance concern is real (3x slower for Object.is) but does it really matter in this case? It feels like this might be a micro-optimization too far.
There was a problem hiding this comment.
It got better recently but those changes may not be in 6.3 yet. And yeah, I don't think Object.is() is going to be the expensive part here.
lib/util.js
Outdated
There was a problem hiding this comment.
The comment should be adjusted if this is being changed to Object.is again.
lib/util.js
Outdated
There was a problem hiding this comment.
Sorry, I was thinking something more along the lines of:
// Format -0 as '-0'. A `value === -0` check won't distinguish 0 from -0.
We don't really need to talk about the performance of it, IMHO.
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM but we definitely should add a test before landing.
|
@BridgeAR would you mind reviewing this? It appears your feedback might've been addressed. Thank you! |
|
Landed in 86527bd |
PR-URL: #17507 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #17507 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #17507 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
|
Should this be backported to |
PR-URL: #17507 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #17507 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
closes #17500
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
util