-
Notifications
You must be signed in to change notification settings - Fork 30k
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: Improve url module performance #3 #2303
Conversation
@STRML do you think you could re-add the whatwg tests ala https://github.com/nodejs/io.js/pull/1561/files#diff-5632d0587131eb38265a594bcc1bdf6dR2921? |
@Fishrock123 That's doable, however the |
@STRML Could be, maybe see if the whatwg tests pass or not without the url improvements? |
It appears that even without the overrides, a few are failing. Subtle things, like:
or
Without these changes (on
So it appears the behavior has changed subtly since #1561 was written. |
@STRML right. The important thing is that it works like it did before applying the patches though, so that's the point we need to test from. :) |
Yes. There are some differences. Should I enumerate them? |
@STRML Yes please. They may (probably) indicate differences we may need to fix. |
Behavior changes from
|
I think the best option here is to fix the remaining issues so all WHATWG tests pass (valueing spec conformity over speed) and then land this on the |
bbe2157
to
6ba195d
Compare
Rebased on newest |
Okay. If we're going for better compat with the WHATWG tests, I've gone through them. I'm just going to refer to them in the order they appear in the comment above:
|
I don't think it's generally a good idea to be consulting Chrome without consulting a quorum of other browsers. Chrome has no special status here. |
I'm just going from the published test results. I'll edit the comment and link to them. |
Right. So, for example, for 2, the spec matches 2 browsers, whereas the behavior in this patch matches 1 (Chrome). That's the kind of clarity I think is important. |
I've updated the table above to be more descriptive. Hopefully someone can take it from here. In summary, this parser is faster and more accurate than Node master but not perfect. In some tests, no browsers pass. |
Some breakage will be unavoidable here, so I'll label this as major. |
What needs to be done to get this in for v5? |
@STRML to recap, are the above 5 examples the only failing WHATWG tests? |
The 6 listed are the ones that do not match the previous behavior. The If I can find a better dump of the tests and their expected values I'll update. |
I don't think matching previous behaviour should be a concern if we aim for a |
That may take some work but I agree that this should be the goal. It appears, however, that there are no major implementations, anywhere, that pass all the tests. For reference, this appears to be the most up-to-date repository for the tests: https://github.com/w3c/web-platform-tests/tree/master/url Unfortunately the test data is in a non-standard format and needs to be parsed. Best this becomes a separate |
https://github.com/jsdom/whatwg-url should pass |
6ba195d
to
b6b57e8
Compare
b6b57e8
to
018659b
Compare
I've rebased this PR. There's one failing test I'm working on:
Benches look good. I've run them for comparison with mscdex's PR (#4892) which is more conservative but easier to merge.
|
@fansworld-claudio I agree that as part of a semver-major change that bug should be fixed, but I'd rather not put it in this particular PR so that we have a better hope of merging it. |
@rvagg Re: the reversion of these changes, is there still interest in getting it merged? |
I'm working through the WHATWG tests. We're failing a lot of them. We're better on about 10 of them with this PR than we were before, what we're missing some major functionality (like backtracking on I believe this is mergeable as a major but after it does, we should concentrate on attempting to achieve as near to 100% WHATWG compatibility as possible. I've marked most of the failures (starting to get tired, there are very many) with links to the spec and expected results. All of our tests are passing in this PR. |
Status @STRML? |
Still interested? |
Is it worth it? I think at this point, it'd be a pretty big rewrite. Are there still perf gains to be had? |
Still significant performance benefits, and the new parser is more compliant with the WHATWG tests than the current ones. We have a chance with this overhaul to become much more standards, and to be nearly an order of magnitude faster as well. Unfortunately I have a lot of work on my plate right now so it may be some time before I'm able to rebase this. |
Alright, let's leave this open. |
7da4fd4
to
c7066fb
Compare
c133999
to
83c7a88
Compare
Given the existence of the new WHATWG URL parser implmentation and the lack of forward progress on this, I'm closing. Can reopen if necessary. |
This is a rebase of #1650, which is a stripped version of #1561 that does not break any compat.
As @petkaantonov commented he's short on time, so I went ahead and rebased the PR so it can be merged.
Thanks @petkaantonov for your hard work, hoping this can make it into iojs soon.