| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Nice, LGTM. The change in performance doesn't look statistically significant.
Sorry, something went wrong.
|
I resolved a conflict here |
Sorry, something went wrong.
There was a problem hiding this comment.
This is nice! Just some nits below.
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: this would be slightly nicer aligned with the code part above, rather than just indented two spaces.
Sorry, something went wrong.
There was a problem hiding this comment.
Unnecessary parentheses here.
Sorry, something went wrong.
There was a problem hiding this comment.
I would also inline path.charCodeAt(len - 1).
Sorry, something went wrong.
There was a problem hiding this comment.
This is unnecessary. This could all be just one if statement. path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. I would just go ahead and inline lots of charCodeAt calls.
Sorry, something went wrong.
There was a problem hiding this comment.
I would also inline path.charCodeAt(len - 1).
Sorry, something went wrong.
There was a problem hiding this comment.
It should be fine to inline path.charCodeAt(j).
Sorry, something went wrong.
There was a problem hiding this comment.
It should be fine to inline path.charCodeAt(1).
Sorry, something went wrong.
There was a problem hiding this comment.
It should be fine to inline path.charCodeAt(j)
Sorry, something went wrong.
There was a problem hiding this comment.
It should be fine to inline pathCharCodeAt(j)
Sorry, something went wrong.
There was a problem hiding this comment.
It should be fine to inline path.charCodeAt(2)
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, this applies to a lot of places here ;-)
Sorry, something went wrong.
There was a problem hiding this comment.
@BridgeAR there are too many places like this. I think it will be better to fix it in a another pull request. What do you think?
Sorry, something went wrong.
There was a problem hiding this comment.
Hm, I personally think this would actually be the right place to do so. The reason is that it touches the same lines. @apapirovski what do you think?
Sorry, something went wrong.
There was a problem hiding this comment.
code seems to mostly be there to avoid constantly calling path.charCodeAt(x) within the same conditional but now that these are a function, it seems like their purpose is gone. I would say that this could definitely be done in this PR even though it adds a bunch of work.
Sorry, something went wrong.
There was a problem hiding this comment.
@BridgeAR ok, I was just worried that it might affect some logic here. Nonetheless, I'll fix it
Sorry, something went wrong.
There was a problem hiding this comment.
@daynin it'll probably take some effort to validate all the places where it's safe to do so. Would suggest doing it as a separate commit. Should make reviews easier.
Sorry, something went wrong.
There was a problem hiding this comment.
@apaprocki ok, sure
Sorry, something went wrong.
There was a problem hiding this comment.
It should be relatively straight forward. Try to remove them from the most inner function and go to the outer one. I checked it for one big function and as far as I saw it was possible to remove all of them besides a single one that should switch to be const.
Sorry, something went wrong.
There was a problem hiding this comment.
@apapirovski @BridgeAR fixed
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Here in this case it would be better to keep the code above as it will otherwise require two lookups for this branch.
Sorry, something went wrong.
There was a problem hiding this comment.
Here it would be better to keep code because this branch otherwise has to do a second lookup.
Sorry, something went wrong.
There was a problem hiding this comment.
Here it would be better to keep the code because of a second lookup.
Sorry, something went wrong.
There was a problem hiding this comment.
Please code here to prevent a second lookup.
Sorry, something went wrong.
There was a problem hiding this comment.
Please keep code here.
Sorry, something went wrong.
There was a problem hiding this comment.
Please keep code here.
Sorry, something went wrong.
Sorry, something went wrong.
It will also remove useless "code" variables by inlining path.charCodeAt. PR-URL: nodejs#18693 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
It will also remove useless "code" variables by inlining path.charCodeAt. PR-URL: #18693 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
It will also remove useless "code" variables by inlining path.charCodeAt. PR-URL: #18693 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
It will also remove useless "code" variables by inlining path.charCodeAt. PR-URL: #18693 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
It will also remove useless "code" variables by inlining path.charCodeAt. PR-URL: nodejs#18693 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
A benchmark results (there are no significant changes):