We replaced 'url-regex' with 'url-regex-safe' and noticed an unusually high CPU usage. When running the following example code on my machine, 'url-regex' consumes around 1.5% CPU while 'url-regex-safe' consumes 99%. Is this expected?
const urlRegex = require("url-regex");
const urlRegexSafe = require("url-regex-safe");
setInterval(()=> {
const s = "Test123 http://example.com test..."
s.match(urlRegex()); // Replace with urlRegexSafe for comparison
}, 10);
Hi,
We replaced 'url-regex' with 'url-regex-safe' and noticed an unusually high CPU usage. When running the following example code on my machine, 'url-regex' consumes around 1.5% CPU while 'url-regex-safe' consumes 99%. Is this expected?