Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 30013574: Issue 7296 - Implement lightweight URL parsing (Closed)

Created:
Feb. 21, 2019, 11:20 a.m. by Manish Jethani
Modified:
Feb. 26, 2019, 5:30 a.m.
Reviewers:
hub
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

To test the performance: (function() { "use strict"; let {parseURL} = require("./lib/url"); let startTime = Date.now(); for (let i = 0; i < 10000000; i++) //new URL("https://example.com/foo/?bar=1#lambda"); parseURL("https://example.com/foo/?bar=1#lambda"); console.log(Date.now() - startTime); })(); This at least 10x as fast and even 25x or more for longer URLs.

Patch Set 1 #

Patch Set 2 : Add toString() #

Patch Set 3 : Add tests for IPv6 #

Patch Set 4 : Add more tests #

Total comments: 2

Patch Set 5 : Make protocol field required #

Patch Set 6 : Remove non-normalized URLs from tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+305 lines, -1 line) Patch
M lib/url.js View 1 2 3 4 1 chunk +78 lines, -0 lines 0 comments Download
M test/url.js View 1 2 3 4 5 1 chunk +227 lines, -1 line 0 comments Download

Messages

Total messages: 8
Manish Jethani
Feb. 21, 2019, 11:20 a.m. (2019-02-21 11:20:33 UTC) #1
Manish Jethani
Patch Set 1 This is a lightweight version of the URL object. I still need ...
Feb. 21, 2019, 11:24 a.m. (2019-02-21 11:24:37 UTC) #2
Manish Jethani
Patch Sets 2-4 The only question I have in my mind is whether the URL ...
Feb. 21, 2019, 3:29 p.m. (2019-02-21 15:29:17 UTC) #3
hub
https://codereview.adblockplus.org/30013574/diff/30013591/lib/url.js File lib/url.js (right): https://codereview.adblockplus.org/30013574/diff/30013591/lib/url.js#newcode115 lib/url.js:115: return match ? new URLInfo(url, match[1], match[2]) : new ...
Feb. 21, 2019, 4:24 p.m. (2019-02-21 16:24:08 UTC) #4
Manish Jethani
Patch Set 5: Make protocol field required https://codereview.adblockplus.org/30013574/diff/30013591/lib/url.js File lib/url.js (right): https://codereview.adblockplus.org/30013574/diff/30013591/lib/url.js#newcode115 lib/url.js:115: return match ...
Feb. 23, 2019, 7:32 a.m. (2019-02-23 07:32:06 UTC) #5
Manish Jethani
On 2019/02/21 15:29:17, Manish Jethani wrote: > The only question I have in my mind ...
Feb. 23, 2019, 8:11 a.m. (2019-02-23 08:11:06 UTC) #6
Manish Jethani
Patch Set 6: Remove non-normalized URLs from tests
Feb. 23, 2019, 8:27 a.m. (2019-02-23 08:27:29 UTC) #7
hub
Feb. 25, 2019, 8:01 p.m. (2019-02-25 20:01:17 UTC) #8
LGTM

Powered by Google App Engine
This is Rietveld