autolinker stat singl

Benchmark created on


Preparation HTML

<script src="https://raw.githubusercontent.com/gregjacobs/Autolinker.js/56fe4a61ced0a2806017b458d75309f4feac250d/dist/Autolinker.min.js">

Setup

var autolinkSingleton = new Autolinker({
  stripPrefix: false,
  replaceFn(match) {
    switch (match.getType()) {
      case 'url': {
        const url = match.getUrl();
        return url;
      }
    }
    return true;
  },
});

var content = '<a href="www.google.com">Link Text</a>'

Test runner

Ready to run.

Testing in
TestOps/sec
Singleton
autolinkSingleton.link(content)
ready
Static
Autolinker.link(content, {
  stripPrefix: false,
  replaceFn(match) {
    switch (match.getType()) {
      case 'url': {
        const url = match.getUrl();
        return url;
      }
    }
    return true;
  },
})
ready

Revisions

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