The following test runner demonstrates the problem
const test = async (zeroes) => {
const start = Date.now();
const characterCount = Number('1' + [...Array(Number(zeroes))].map(() => '0').join(''))
autolinker.link(`<img src="${[...Array(characterCount)].join('a')}`)
console.log(`src of length ${characterCount} took ${Date.now() - start} ms`)
}
const testRunner = async degrees=> {
const zeroes = [...Array(degrees)].map((_, i) => i);
for (i in zeroes) {
await test(i)
}
}
testRunner(7)