How to use the slate-dev-benchmark.Suite function in slate-dev-benchmark

To help you get started, we’ve selected a few slate-dev-benchmark examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ianstormtaylor / slate / benchmark / slate-html-serializer / index.js View on Github external
categories.forEach(category => {
    const suite = new Suite(category, { minTries: 100, minTime: 1000 })
    const benchmarkDir = resolve(categoryDir, category)
    const benchmarks = readdirSync(benchmarkDir)
      .filter(b => b[0] !== '.' && !!~b.indexOf('.js'))
      .map(b => basename(b, extname(b)))

    benchmarks.forEach(benchmark => {
      if (include && !benchmark.match(include)) return
      const bench = new Bench(suite, benchmark)
      const dir = resolve(benchmarkDir, benchmark)
      const module = require(dir)
      const fn = module.default
      bench.input(() => module.input)

      bench.run(input => {
        fn(input)
        resetMemoization()
github ianstormtaylor / slate / benchmark / slate-plain-serializer / index.js View on Github external
categories.forEach(category => {
    const suite = new Suite(category, {
      minTries: 100,
      minTime: 1000,
    })
    const benchmarkDir = resolve(categoryDir, category)
    const benchmarks = readdirSync(benchmarkDir)
      .filter(b => b[0] !== '.' && !!~b.indexOf('.js'))
      .map(b => basename(b, extname(b)))

    benchmarks.forEach(benchmark => {
      if (include && !benchmark.match(include)) return
      const bench = new Bench(suite, benchmark)
      const dir = resolve(benchmarkDir, benchmark)
      const module = require(dir)
      const fn = module.default
      bench.input(() => module.input)
github ianstormtaylor / slate / benchmark / slate / index.js View on Github external
categories.forEach(category => {
    const suite = new Suite(category, { minTries: 100, minTime: 1000 })
    const benchmarkDir = resolve(categoryDir, category)
    const benchmarks = readdirSync(benchmarkDir)
      .filter(b => b[0] !== '.' && !!~b.indexOf('.js'))
      .map(b => basename(b, extname(b)))

    benchmarks.forEach(benchmark => {
      if (include && !benchmark.match(include)) return
      const bench = new Bench(suite, benchmark)
      const dir = resolve(benchmarkDir, benchmark)
      const module = require(dir)
      const fn = module.default
      bench.input(module.input)

      bench.run(input => {
        fn(input)
        resetMemoization()
github ianstormtaylor / slate / benchmark / slate-react / index.js View on Github external
categories.forEach(category => {
    const suite = new Suite(category, {
      minTries: 100,
      minTime: 1000,
    })
    const benchmarkDir = resolve(categoryDir, category)
    const benchmarks = readdirSync(benchmarkDir)
      .filter(b => b[0] !== '.' && !!~b.indexOf('.js'))
      .map(b => basename(b, extname(b)))

    benchmarks.forEach(benchmark => {
      if (include && !benchmark.match(include)) return
      const bench = new Bench(suite, benchmark)
      const dir = resolve(benchmarkDir, benchmark)
      const module = require(dir)
      const fn = module.default
      bench.input(module.input)

slate-dev-benchmark

INTERNAL: A development-only benchmark tool for Slate's core.

MIT
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis

Popular slate-dev-benchmark functions

Similar packages