| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Use var here until v8 can optimize let better.
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, you'll also need to move the var i declaration out and above and change var i = 1; a few lines below to i = 1 to avoid a linter error.
Sorry, something went wrong.
There was a problem hiding this comment.
yep, just noticed that locally. Thanks
Sorry, something went wrong.
|
For bonus points, you can change for (var x = args[i]; i < len; x = args[++i]) {to while (i < len) {
const x = args[i++];to avoid an eager deopt due to potential out of bounds access on args. |
Sorry, something went wrong.
|
Ah, totally missed the case where f is not a string. Added a benchmark and updated for that as well |
Sorry, something went wrong.
There was a problem hiding this comment.
String(f) here can probably just be replaced with just f since it should already be a string at that point.
Sorry, something went wrong.
|
ooo good catch |
Sorry, something went wrong.
Sorry, something went wrong.
|
Just for fun I replaced the regexp + replace function with a simple loop and improved performance an additional 60-200% in the benchmarks included (and no change in the no-replace case) in this PR. |
Sorry, something went wrong.
|
wow, nice |
Sorry, something went wrong.
|
Marking this LTS watch but I'd rather this sit for a bit before getting pulled back. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Running CI again: https://ci.nodejs.org/job/node-test-pull-request/1851/ |
Sorry, something went wrong.
PR-URL: nodejs#5360 Reviewed-By: James M Snell <jasnell@gmail.com>
By manually copying arguments and breaking the try/catch out, we are able to improve the performance of util.format by 20-100% (depending on the types). PR-URL: nodejs#5360 Reviewed-By: James M Snell <jasnell@gmail.com>
Replacing the regexp and replace function with a loop improves performance by ~60-200%. PR-URL: nodejs#5360 Reviewed-By: James M Snell <jasnell@gmail.com>
|
@jasnell would you want to include this in a future lts? |
Sorry, something went wrong.
|
I believe so yes. |
Sorry, something went wrong.
|
@jasnell / @nodejs/lts how much longer to we want this to live before backporting? |
Sorry, something went wrong.
|
I haven't heard of any regressions. We may be good on this one
|
Sorry, something went wrong.
By manually copying arguments and breaking the try/catch out, we are able to improve the performance of util.format by 20-100% (depending on the types). PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
Replacing the regexp and replace function with a loop improves performance by ~60-200%. PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
|
I've gone ahead and added this to v4.x-staging and will include it in the v4.5.0 rc. @evanlucas please let me know if there are any accompanying patch's we need to make this work |
Sorry, something went wrong.
|
@evanlucas as a heads up you need to provide the commit before your initial commit when doing the ... syntax to specify a range. 735e0df...c490b8b does not include 735e0df |
Sorry, something went wrong.
By manually copying arguments and breaking the try/catch out, we are able to improve the performance of util.format by 20-100% (depending on the types). PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
Replacing the regexp and replace function with a loop improves performance by ~60-200%. PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
|
@thealphanerd there shouldn't be anything else need to land these. Thanks for the heads up on the range syntax as well :] |
Sorry, something went wrong.
By manually copying arguments and breaking the try/catch out, we are able to improve the performance of util.format by 20-100% (depending on the types). PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
Replacing the regexp and replace function with a loop improves performance by ~60-200%. PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #5360 Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
By manually copying arguments and breaking the try/catch out, we are able to improve the performance of util.format by 20-100% (depending on the types).
Also includes a util.format benchmark.
The numbers:
EDIT: I updated the numbers after rebasing on master and with @mscdex's changes included as well.