This benchmark attempts to measure performance of adding a link to the span.
177346
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Span addLink(Data data) {
    data.span.addLink(
        Link.fromSpanContext(data.linkedSpan.getContext(), Link.Type.PARENT_LINKED_SPAN));
    return data.span;
  }
185490
def build_benchmark_plugin(name: str) -> LaserPlugin:
        
        from mythril.laser.ethereum.plugins.implementations.benchmark import (
            BenchmarkPlugin,
        )

        return BenchmarkPlugin(name)
895364
function createLink(link) {
        var $link = $('<a>').addClass(CSS_CLASS_PAGE_LINK),
            left = link.bbox[0],
            top = link.bbox[1],
            attr = {};

        if (browser.ie) {
            // @NOTE: IE doesn't allow override of ctrl+click on anchor tags,
            // but there is a workaround to add a child element (which triggers
            // the onclick event first)
            $('<span>')
                .appendTo($link)
                .on('click', handleClick);
        }

        $link.css({
            left: left + 'pt',
            top: top + 'pt',
            width: link.bbox[2] - left + 'pt',
            height: link.bbox[3] - top + 'pt'
        });

        if (link.uri) {
            if (/^http|^mailto/.test(link.uri)) {
                attr.href = encodeURI(link.uri);
                attr.target = '_blank';
                attr.rel = 'noreferrer'; // strip referrer for privacy
            } else {
                // don't embed this link... we don't trust the protocol
                return;
            }
        } else if (link.destination) {
            attr.href = '#page-' + link.destination.pagenum;
        }

        $link.attr(attr);
        $link.data('link', link);
        $link.appendTo($el);
    }
215867
def benchmark(N, gates):
    """"""
    qubits = list(range(0, N))
    ket = qf.zero_state(N)

    for n in range(0, N):
        ket = qf.H(n).run(ket)

    for _ in range(0, (gates-N)//3):
        qubit0, qubit1 = random.sample(qubits, 2)
        ket = qf.X(qubit0).run(ket)
        ket = qf.T(qubit1).run(ket)
        ket = qf.CNOT(qubit0, qubit1).run(ket)

    return ket.vec.tensor
1035242
@Override
    protected void doPerform() {
        if (isSourceDocumentRoot()) {
            getActions().contextClick().perform();
        } else {
            getActions().contextClick(getFirstElement()).perform();
        }
    }
572051
@Benchmark void codePointAtNoSurrogates(int reps) {
    final int length = Math.min(this.length, MIN_SURROGATE);
    StringBuilder sb = new StringBuilder();
    for (int j = 0; j < length; j++) {
      sb.appendCodePoint(j);
    }
    for (int i = 0; i < reps; i++) {
      for (int j = 0; j < 4; j++) {
        for (int k = 0; k < length - 1; k++) {
          if (sb.codePointAt(k) > MIN_SURROGATE)
            throw new Error();
        }
      }
    }
  }
132493
function benchmark(numPeers, numChoices) {
    var heap = new PeerHeap();
    var i;
    var peers = [];
    var heapEls = [];
    var newPeer;
    var el;

    for (i = 0; i < numPeers; i++) {
        newPeer = new Peer();
        el = heap.add(newPeer);
        heapEls.push(el);
        newPeer.el = el;
        peers.push(newPeer);
    }

    var start = Date.now();

    for (i = 0; i < numChoices; i++) {
        var choice = heap.choose(0);
        if (choice) {
            choice.randPending();

            peers[rand(0, peers.length - 1)].randPending();
            peers[rand(0, peers.length - 1)].randPending();
            peers[rand(0, peers.length - 1)].randPending();
            peers[rand(0, peers.length - 1)].randPending();
            peers[rand(0, peers.length - 1)].randPending();
            peers[rand(0, peers.length - 1)].randPending();

        } else {
            console.log('no choice!');
        }
    }

    var time = Date.now() - start;

    return time;
}
470886
function link(href, title, text) {

  var reLabelFirst = /^(.*?)\s*\?([^?\s]*)\?(\*?)(X?)(H?)$/;
  var reLabelAfter = /^\?([^?\s]*)\?(\*?)(X?)(H?)\s*(.*)$/;

  var m = text.match(reLabelFirst);
  if (m) return renderInput(m[1], m[2], m[3], m[4], m[5], href, title, true);

  m = text.match(reLabelAfter);
  if (m) return renderInput(m[5], m[1], m[2], m[3], m[4], href, title, false);

  return fallback.link.call(this, href, title, text);
}
964375
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Span addAnnotationWithAnnotation(Data data) {
    Span span = data.annotationSpanAnnotation;
    Annotation annotation =
        Annotation.fromDescriptionAndAttributes(ANNOTATION_DESCRIPTION, data.attributeMap);
    span.addAnnotation(annotation);
    return span;
  }
25721
function benchmarkSelect(numLeft, callback) {
  //connection.query('query from fake server fixture', function(err, result) {

  // comment if no pool:
  next();

  let rows = 0;
  const q = connection.query('query from fake server fixture');
  q.on('result', () => {
    rows++;
  });
  q.on('end', () => {
    if (numLeft > 1) benchmarkSelect(numLeft - 1, callback);
    else callback(rows);
  });
}
41861
def benchmark_data(self):
        
        return self.fetch[self.benchmark_type](
            self.benchmark_code,
            self.account.start_date,
            self.account.end_date
        )
333061
function link(token, meta) {
  var text = token.text;
  if(!meta.base || !meta.hash) return anchor(
    text, '#' + gfm(text) + (token.suffix || ''));
  var href = hash(token, base);
  return anchor(text, href);
}
861178
def report(measurements)
      width = measurements.max_by { |m| m.label.size }.label.size + 1
      puts "#{' ' * width}#{Benchmark::CAPTION}"
      measurements.each do |m|
        puts "#{m.label.to_s.ljust width} #{m}"
      end
    end
1197485
public void addLink(String linkName, Link link) {
		if (links == null) {
			links = new Links(new HashMap<String, Link>());
		}
		links.addLink(linkName, link);
	}
327586
function benchmark(fn, times, name){
	fn = fn.toString();
	var s = fn.indexOf('{')+1,
		e = fn.lastIndexOf('}');
	fn = fn.substring(s,e);

	return benchmarkString(fn, times, name);
}
751014
void writeSpan(Span span, int sizeOfSpan, Buffer result) {
    result.writeByte(SPAN.key);
    result.writeVarint(sizeOfSpan); // length prefix
    SPAN.writeValue(result, span);
  }
1123885
def benchmark(store, n=10000):
    
    x = UpdatableItem(store=store, count=0)
    for _ in xrange(n):
        x.count += 1