Run all benchmarks and print report to the console.
18428
def main(fast=False):
    """"""
    print('Running benchmarks...\n')
    results = bench_run(fast=fast)
    bench_report(results)
62475
public static void main(String[] args) throws RunnerException {

    for (String benchmark : benchmarks.keySet()) {
      String[] parts = benchmark.split("-");
      Options opt = new OptionsBuilder()
          .include(ArrayListBenchmark.class.getSimpleName())

          // Warmup, and then run test iterations
          .warmupIterations(2).measurementIterations(5)

          // Each iteration call the test repeatedly for ~60 seconds
          .mode(Mode.AverageTime)
          .warmupTime(TimeValue.seconds(10))
          .measurementTime(TimeValue.seconds(60))

          // The size of the list
          .param("size", "80000000", "20000000", "5000000")
          .param("list", parts[0])
          .param("type", parts[1])

          .forks(1).jvmArgs("-Xmx16g")
          //.addProfiler(MemoryProfiler.class)
          //.addProfiler(StackProfiler.class)
          //.addProfiler(GCProfiler.class)

          .build();

      new Runner(opt).run();
    }
  }
1292143
public void runBenchmark() throws Exception {
        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Setup & Initialization");
        System.out.println(HORIZONTAL_RULE);

        // connect to one or more servers, loop until success
        connect(client, config.servers);

        for (long i = 0; i < config.tuples; i++) {
            ClientResponse response = client.callProcedure("Init", i, i);
            if (response.getStatus() != ClientResponse.SUCCESS) {
                System.exit(-1);
            }
        }

        System.out.print("\n\n" + HORIZONTAL_RULE);
        System.out.println(" Starting Benchmark");
        System.out.println(HORIZONTAL_RULE);

        System.out.println("\nWarming up...");
        final long warmupEndTime = System.currentTimeMillis() + (1000l * config.warmup);
        while (warmupEndTime > System.currentTimeMillis()) {
            increment();
        }

        // reset counters before the real benchmark starts post-warmup
        incrementCount.set(0);
        lastPeriod.set(0);
        failureCount.set(0);
        lastStatsReportTS = System.currentTimeMillis();

        // print periodic statistics to the console
        benchmarkStartTS = System.currentTimeMillis();
        TimerTask statsPrinting = new TimerTask() {
            @Override
            public void run() { printStatistics(); }
        };
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(statsPrinting,
                                  config.displayinterval * 1000,
                                  config.displayinterval * 1000);

        // Run the benchmark loop for the requested duration
        // The throughput may be throttled depending on client configuration
        System.out.println("\nRunning benchmark...");
        final long benchmarkEndTime = System.currentTimeMillis() + (1000l * config.duration);
        while (benchmarkEndTime > System.currentTimeMillis()) {
            increment();
        }

        // cancel periodic stats printing
        timer.cancel();
        // block until all outstanding txns return
        client.drain();
        // close down the client connections
        client.close();
    }
461969
def run(args):
    """"""

    repos = load_config(args.config, args.expand_env, args.force)

    jobs = max(args.jobs, 1)
    threads = []
    sem = threading.Semaphore(jobs)
    err_queue = Queue()

    for repo_dict in repos:
        if not err_queue.empty():
            break

        sem.acquire()
        r = Repo(**repo_dict)
        tname = os.path.basename(repo_dict['cwd'])

        if jobs > 1:
            t = threading.Thread(
                target=aggregate_repo, args=(r, args, sem, err_queue))
            t.daemon = True
            t.name = tname
            threads.append(t)
            t.start()
        else:
            with ThreadNameKeeper():
                threading.current_thread().name = tname
                aggregate_repo(r, args, sem, err_queue)

    for t in threads:
        t.join()

    if not err_queue.empty():
        while True:
            try:
                exc_type, exc_obj, exc_trace = err_queue.get_nowait()
            except EmptyQueue:
                break
            traceback.print_exception(exc_type, exc_obj, exc_trace)
        sys.exit(1)
544812
@Override
  public int run(String[] args) throws Exception {
    parseArgs(args);
    // Create results file
    FileWriter results = new FileWriter(resultsFile, true);
    // Run all benchmarks
    int failed = 0;
    for (Method method : NNLatencyBenchmark.class.getMethods()) {
      if (method.isAnnotationPresent(Benchmark.class)) {
        results.write(method.getName() + " : ");
        try {
          setUp();
          try {
            method.invoke(this, results);
          } finally {
            tearDown();
          }
        } catch (Throwable e) {
          failed++;
          LOG.error(method.getName() + " failed with: ", e);
        }
        results.write("\n");
      }
    }
    results.close();
    return -failed;
  }
218836
public void runBenchmark() throws Exception {
        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Setup & Initialization");
        System.out.println(HORIZONTAL_RULE);

        // connect to one or more servers, loop until success
        connect(config.servers);

        // preload keys if requested
        System.out.println();
        if (config.preload) {
            System.out.println("Preloading data store...");
            for(int i=0; i < config.poolsize; i++) {
                client.callProcedure(new NullCallback(),
                                     "STORE.upsert",
                                     String.format(processor.KeyFormat, i),
                                     processor.generateForStore().getStoreValue());
            }
            client.drain();
            System.out.println("Preloading complete.\n");
        }

        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Starting Benchmark");
        System.out.println(HORIZONTAL_RULE);

        // create/start the requested number of threads
        Thread[] kvThreads = new Thread[config.threads];
        for (int i = 0; i < config.threads; ++i) {
            kvThreads[i] = new Thread(new KVThread());
            kvThreads[i].start();
        }

        // Run the benchmark loop for the requested warmup time
        System.out.println("Warming up...");
        Thread.sleep(1000l * config.warmup);

        // signal to threads to end the warmup phase
        warmupComplete.set(true);

        // reset the stats after warmup
        fullStatsContext.fetchAndResetBaseline();
        periodicStatsContext.fetchAndResetBaseline();

        // print periodic statistics to the console
        benchmarkStartTS = System.currentTimeMillis();

        schedulePeriodicStats();

        // Run the benchmark loop for the requested warmup time
        System.out.println("\nRunning benchmark...");
        Thread.sleep(1000l * config.duration);

        // stop the threads
        benchmarkComplete.set(true);

        // cancel periodic stats printing
        timer.cancel();

        // block until all outstanding txns return
        client.drain();

        // join on the threads
        for (Thread t : kvThreads) {
            t.join();
        }

        // print the summary results
        printResults();

        // close down the client connections
        client.close();
    }
1281748
public void runBenchmark() throws Exception {
        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Setup & Initialization");
        System.out.println(HORIZONTAL_RULE);

        // connect to one or more servers, loop until success
        connect(config.servers);

        // initialize using synchronous call
        // Initialize the application
        System.out.println("\nPopulating Static Tables\n");
        final PreparedStatement initializeCS = client
                .prepareCall("{call Initialize(?,?)}");
        initializeCS.setInt(1, config.contestants);
        initializeCS.setString(2, CONTESTANT_NAMES_CSV);
        initializeCS.executeUpdate();

        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Starting Benchmark");
        System.out.println(HORIZONTAL_RULE);

        // create/start the requested number of threads
        Thread[] voterThreads = new Thread[config.threads];
        for (int i = 0; i < config.threads; ++i) {
            voterThreads[i] = new Thread(new VoterThread());
            voterThreads[i].start();
        }

        // Run the benchmark loop for the requested warmup time
        System.out.println("Warming up...");
        Thread.sleep(1000l * config.warmup);

        // signal to threads to end the warmup phase
        warmupComplete.set(true);

        // reset the stats after warmup
        fullStatsContext.fetchAndResetBaseline();
        periodicStatsContext.fetchAndResetBaseline();

        // print periodic statistics to the console
        benchmarkStartTS = System.currentTimeMillis();
        schedulePeriodicStats();

        // Run the benchmark loop for the requested warmup time
        System.out.println("\nRunning benchmark...");
        Thread.sleep(1000l * config.duration);

        // stop the threads
        benchmarkComplete.set(true);

        // cancel periodic stats printing
        timer.cancel();

        // block until all outstanding txns return
        // client.drain();

        // join on the threads
        for (Thread t : voterThreads) {
            t.join();
        }

        // print the summary results
        printResults();

        // close down the client connections
        client.close();
    }
1051926
def benchmark_process_and_backend(exe, backend):
    """"""
    env = dict(os.environ)
    env['GOLESS_BACKEND'] = backend
    args = [exe, '-m', 'benchmark']
    return get_benchproc_results(args, env=env)
1045281
def run(self):
        '''
        
        '''
        if self.opts['chunked']:
            ret = self.run_chunked()
        else:
            ret = self.run_oldstyle()

        salt.output.display_output(
                ret,
                self.opts.get('output', 'nested'),
                self.opts)
693779
def run(self, reporter=None):
        
        if not reporter: reporter = ConsoleReporter()
        benchmarks = sorted(self._find_benchmarks())
        reporter.write_titles(map(self._function_name_to_title, benchmarks))
        
        for value in self.input():
            results = []
            for b in benchmarks:
                
                method = getattr(self, b)
                arg_count = len(inspect.getargspec(method)[0])
                
                if arg_count == 2:
                    results.append(self._run_benchmark(method, value))
                elif arg_count == 1:
                    results.append(self._run_benchmark(method))
                    
            reporter.write_results(str(value), results)
487187
def bench(func):
    """"""
    sys.stdout.write("%44s   " % format_func(func))
    sys.stdout.flush()

    # figure out how many times we have to run the function to
    # get reliable timings.
    for i in xrange(3, 10):
        rounds = 1 << i
        t = timer()
        for _ in xrange(rounds):
            func()
        if timer() - t >= 0.2:
            break

    # now run the tests without gc TEST_RUNS times and use the median
    # value of these runs.
    def _run():
        gc.collect()
        gc.disable()
        try:
            t = timer()
            for _ in xrange(rounds):
                func()
            return (timer() - t) / rounds * 1000
        finally:
            gc.enable()

    delta = median(_run() for x in xrange(TEST_RUNS))
    sys.stdout.write("%.4f\n" % delta)
    sys.stdout.flush()

    return delta
603555
def main():
    """"""

    reporter = BugReporter()

    print("JSON report:")
    print(reporter.as_json())
    print()

    print("Markdown report:")
    print(reporter.as_markdown())

    print("SQL report:")
    print(reporter.as_sql())

    print("Choose the appropriate format (if you're submitting a Github Issue "
          "please chose the Markdown report) and paste it!")
263481
function runBenchmark(benchmark, environments) {
  let benchmarkName;
  const benches = environments.map(environment => {
    const module = require(path.join(environment.distPath, benchmark))
    benchmarkName = module.name;
    return new Benchmark(environment.revision, module.measure);
  });

  console.log('⏱️   ' + benchmarkName);
  for (let i = 0; i < benches.length; ++i) {
    benches[i].run({ async: false });
    process.stdout.write('  ' + cyan(i + 1) + ' tests completed.\u000D');
  }
  console.log('\n');

  beautifyBenchmark(benches);
  console.log('');
}
355180
def stdout_to_results(s):
    """"""
    results = s.strip().split('\n')
    return [BenchmarkResult(*r.split()) for r in results]
271394
public void run() throws Exception {
    if (config == null) {
      return;
    }

    SimpleRequest req = newRequest();

    List<ManagedChannel> channels = new ArrayList<>(config.channels);
    for (int i = 0; i < config.channels; i++) {
      channels.add(config.newChannel());
    }

    // Do a warmup first. It's the same as the actual benchmark, except that
    // we ignore the statistics.
    warmup(req, channels);

    long startTime = System.nanoTime();
    long endTime = startTime + TimeUnit.SECONDS.toNanos(config.duration);
    List<Histogram> histograms = doBenchmark(req, channels, endTime);
    long elapsedTime = System.nanoTime() - startTime;

    Histogram merged = merge(histograms);

    printStats(merged, elapsedTime);
    if (config.histogramFile != null) {
      saveHistogram(merged, config.histogramFile);
    }
    shutdown(channels);
  }
1061584
def print_benchmark(elapsed):
    
    print '%-7.2f %s' % (elapsed, 'seconds elapsed')
    keys = ['directories', 'files',
            'logical lines', 'physical lines']
    for key in keys:
        if key in options.counters:
            print '%-7d %s per second (%d total)' % (
                options.counters[key] / elapsed, key,
                options.counters[key])
464841
def run():
    
    # GLOBALS
    global cwd, files, logger_start, logger_benchmark, settings, _timeseries_data
    _timeseries_data = {}
    # files = {".lpd": [ {"full_path", "filename_ext", "filename_no_ext", "dir"} ], ".xls": [...], ".txt": [...]}
    settings = {"note_update": True, "note_validate": True, "verbose": True}
    cwd = os.getcwd()
    # logger created in whatever directory lipd is called from
    logger_start = create_logger("start")
    logger_benchmark = create_benchmark("benchmarks", "benchmark.log")
    files = {".txt": [], ".lpd": [], ".xls": []}

    return