Multiple replace test

Benchmark created on


Preparation HTML

<script>
  var sourceStr = 'Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit.  The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit. The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit.  The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit. The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit.  The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit. The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit.  The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark.  Transit officials in San Francisco reopened all downtown subway stations Monday evening after successively opening and closing them to stem the threat of spreading protests.  "All BART Stations are Now Open, Trains Running On Time," said a release from Bay Area Rapid Transit. The situation was fluid most of the evening, with officials trying to thwart demonstrators, closing and reopening the Civic Center and Montgomery stations, closing the Powell station, then at least partially reopening Powell to allow riders to isembark. aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Multiple .replace()
var result = sourceStr.replace(/aa/g, "--").replace(/bb/g, "++").replace(/cc/g, "**");
ready
One .replace()
var replaceLookup = {aa: "--", bb: "++", cc: "**"};
var result = sourceStr.replace(/aa|bb|cc/g, function(str, p1, p2, offset, s) {return(replaceLookup[str]);});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.