GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — net: use icu's punycode implementation by jasnell · Pull Request #7355 · nodejs/node Conversation
|
|
does the binary size change much? i don't think it should. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
With the code, no. Not sure about the data files. I need to track down
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Maybe uts46? maybe the stringprep dir? https://github.com/nodejs/node/blob/master/tools/icu/icu_small.json#L37 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah, likely both. I'll play around with adding those into the small-icu subset and see what happens ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You'll at least want to do a CHECK_NE(dest, nullptr)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Better yet, use MaybeStackBuffer.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
High-level comment: is punycode prevalent enough to warrant optimizing for? I'm inclined to say it isn't. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis Maybe this is what you meant, but the function is called every time |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Let me rephrase: does |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis ... it's not used extensively by our code, no, but it is used pretty much every time Ultimately what I'd really like is for us to deprecate the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis ... to give an idea, below is a comparison of url.parse benchmarks in v6.2.2 against master with this patch applied: The "five" case is an exception and I believe that something else unrelated to this change is going on there.. but the perf boost for the typical use cases is significant. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis @saghul @trevnorris @srl295 .. updated! PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
does this give a simple yes/no on failure, or is there additional information that may be useful to the error message?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In this particular case the possible failures are rare and non-interesting.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks like you can test for info.errors & UIDNA_ERROR_DOMAIN_NAME_TOO_LONG, maybe other values. The status itself is likely to be something like out of memory, invalid parameters, etc. You could ThrowError including u_errorName(status) to return the ICU status code - that would be good. I don't know if ThrowError takes a parameter.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
what a pain. so // url.parse() automatically runs toASCII() on the // domain, but isn't documented to do so. const o = url.parse('http://見.香港/見'); o.pathname = encodeURI(o.pathname); const url = url.format(o); Anyway, not directly anything to do with this PR. In terms of performance, I think Strictly from the code perspective, the updates LGTM. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This only needs full-icu currently. There are a couple of minor data files currently missing in the small-icu subset that would need to be added but those are minimal. Those can be added to small-icu without too much impact. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
And I'm working on a better URL impl to deal with the other issues ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
How? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mathiasbynens By playing to V8's strengths while avoiding its weaknesses. :-) For example, .toASCII() calls String#split() twice and is heavy on the map-over-substrings idiom. It would probably be faster to:
There is probably more but that is what stood out from a quick look. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
should we have a spacing rule for destructuring before we start using it in full? // @Trott
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In other places we have spaces around the name.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI had a failure on smartos... green everywhere else. Small tweak and running again: https://ci.nodejs.org/job/node-test-pull-request/3108/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@trevnorris @bnoordhuis @srl295 ... CI is good. This now no-longer requires full-icu data. PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
should be able to put these two on the same line. git grep "return.*Throw" shows that's how it's done in 260 other places.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM with style nits. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis @trevnorris .. updated to address the nits |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ICU has a punycode implementation built in. Use it instead of the javascript implementation because it's much faster.
|
Final CI before landing: https://ci.nodejs.org/job/node-test-pull-request/3134/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI is green. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #7355 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
ICU has a punycode implementation built in. Use it instead of the javascript implementation because it's much faster. PR-URL: #7355 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #7355 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
ICU has a punycode implementation built in. Use it instead of the javascript implementation because it's much faster. PR-URL: #7355 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
|
@thealphanerd Correct and correct. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.