DescriptionTo 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 #MessagesTotal messages: 8
|