WebWorker calculates slow regexp matches significantly slower (3x) – firefox only

WebWorker calculates slow regexp matches significantly slower (3x) – firefox only

Asked on January 11, 2019 in Regex.
Add Comment


  • 1 Answer(s)

    function processRegexUnique(regex, string, result, done, interval) {
    var matchList = arguments[5]||[];
    … same as before …
    while ((m = regex.exec(string))) {
    … same as before …
    if (matchList.indexOf(path)==-1) {
    result(path);
    matchList.push(path);
    }
    if (interval>=0) {
    processRegex.working = setTimeout(processRegex, interval,
    regex, string, result,
    done, interval, matchList);
    … same as before …
    }
    }
    … same as before …
    }

    Answered on January 26, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.