%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/vacivi36/vittasync.vacivitta.com.br/vittasync/node/benchmark/blob/
Upload File :
Create Path :
Current File : //home2/vacivi36/vittasync.vacivitta.com.br/vittasync/node/benchmark/blob/resolveObjectURL.js

'use strict';
const common = require('../common.js');
const { Blob, resolveObjectURL } = require('node:buffer');
const assert = require('assert');

const bench = common.createBenchmark(main, {
  n: [50e3],
});

let _resolveObjectURL;

function main({ n }) {
  const blob = new Blob(['hello']);
  const id = URL.createObjectURL(blob);
  bench.start();
  for (let i = 0; i < n; ++i)
    _resolveObjectURL = resolveObjectURL(id);
  bench.end(n);

  // Avoid V8 deadcode (elimination)
  assert.ok(_resolveObjectURL);
}

Zerion Mini Shell 1.0