{
  "version": 3,
  "sources": ["../src/index.ts", "../src/bench.ts", "../src/format-utils.ts", "../src/stat-utils.ts", "../src/bench-loggers.ts"],
  "sourcesContent": ["// probe.gl, MIT license\n\nexport type {BenchProps, BenchTestCaseProps, LogEntry, LogFunction} from './bench';\n\nexport {Bench} from './bench';\n\nexport {\n  logResultsAsMarkdownTable,\n  logResultsAsTree,\n  logResultsAsTreeWithElapsed\n} from './bench-loggers';\n", "// probe.gl, MIT license\n\n/* eslint-disable no-console */\nimport {autobind, LocalStorage, getHiResTimestamp} from '@probe.gl/log';\nimport {formatSI} from './format-utils';\nimport {mean, cv} from './stat-utils';\nimport {logResultsAsMarkdownTable, logResultsAsTree} from './bench-loggers';\n\ndeclare global {\n  // eslint-disable-next-line no-var\n  var probe: {\n    priority?: number;\n    markdown?: boolean;\n  };\n}\n\nconst noop = () => {};\n\n/** Properties for benchmark suite */\nexport type BenchProps = {\n  /** Id of suite. @note Used as key for regression (storing/loading results in browser storage) */\n  id?: string;\n  /** Log object */\n  log?: LogFunction;\n  /** Minimum number of milliseconds to iterate each bench test */\n  time?: number;\n  /** milliseconds of idle time, or \"cooldown\" between tests */\n  delay?: number;\n  /** Increase if OK to let slow benchmarks take long time, potentially produces more stable results */\n  minIterations?: number;\n};\n\nexport type BenchTestFunction = <T>(testArgs?: T) => T | Promise<T>;\nexport type BenchInitFunction = () => unknown;\n\n/** Options for a specific test case */\nexport type BenchTestCaseProps = {\n  id?: string;\n  priority?: number;\n  message?: string;\n  initialize?: BenchInitFunction | null;\n  test?: BenchTestFunction | null;\n  async?: boolean;\n  once?: boolean;\n\n  /** Minimum number of milliseconds to iterate each bench test */\n  time?: number;\n  /** milliseconds of idle time, or \"cooldown\" between tests */\n  delay?: number;\n  /** Increase if OK to let slow benchmarks take long time, potentially produces more stable results */\n  minIterations?: number;\n  multiplier?: number;\n  unit?: string;\n  _throughput?: number;\n};\n\n/** One benchmark log entry */\nexport type LogEntry = GroupLogEntry | TestLogEntry | CompleteLogEntry;\n\nexport type GroupLogEntry = {\n  type: 'group';\n  id: string;\n  message: string;\n};\n\nexport type TestLogEntry = {\n  /** Type of benchmark log entry */\n  type: 'test';\n  id: string;\n  message: string;\n  itersPerSecond: string;\n  unit: string;\n  error: number;\n  time: number;\n};\n\nexport type CompleteLogEntry = {\n  type: 'complete';\n  time: number;\n  message: string;\n};\n\n/** Type for (custom) log functions */\nexport type LogFunction = (entry: LogEntry) => void;\n\ntype BenchTestCase = {\n  id: string;\n  priority: number;\n  message: string;\n  initialize: BenchInitFunction | null;\n  test: BenchTestFunction | null;\n  group: boolean;\n  async: boolean;\n  once: boolean;\n\n  /** Minimum number of milliseconds to iterate each bench test */\n  time: number;\n  /** milliseconds of idle time, or \"cooldown\" between tests */\n  delay: number;\n  /** Increase if OK to let slow benchmarks take long time, potentially produces more stable results */\n  minIterations: number;\n  multiplier: number;\n  unit: string;\n  _throughput: number;\n\n  context: any;\n};\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nconst DEFAULT_BENCH_OPTIONS: Required<BenchProps> = {\n  id: '',\n  log: undefined!,\n  time: 80,\n  delay: 5,\n  minIterations: 3\n};\n\nconst DEFAULT_BENCH_TEST_CASE: BenchTestCase = {\n  id: undefined!,\n  message: undefined!,\n  priority: 0,\n  group: false,\n  test: null,\n  initialize: null,\n  async: false,\n  once: false,\n  time: 0,\n  minIterations: 1,\n  multiplier: 1, // multiplier per test case\n  unit: '',\n  delay: 0,\n  _throughput: undefined!,\n  context: null\n};\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n\n/**\n * A benchmark suite.\n * Test cases can be added and then benchmarks can be run/\n */\nexport class Bench {\n  id: string;\n  props: Required<BenchProps>;\n  testCases: Record<string, BenchTestCase> = {};\n  results: Record<string, unknown> = {};\n  table: Record<string, any> = {};\n\n  constructor(props: BenchProps = {}) {\n    this.props = {...DEFAULT_BENCH_OPTIONS, ...props};\n    const {id, time, delay, minIterations} = this.props;\n\n    let log = this.props.log;\n    if (!log) {\n      const markdown = globalThis.probe && globalThis.probe.markdown;\n      log = markdown ? logResultsAsMarkdownTable : logResultsAsTree;\n    }\n\n    this.id = id;\n    this.props = {id, log, time, delay, minIterations};\n    autobind(this);\n    Object.seal(this);\n  }\n\n  /** Not yet implemented */\n  // eslint-disable-next-line\n  calibrate(id?: string, func1?: Function, func2?: Function, props?: {}): this {\n    return this;\n  }\n\n  /** Runs the test suite */\n  async run(): Promise<void> {\n    const timeStart = getHiResTimestamp();\n\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const {testCases, onBenchmarkComplete} = this;\n    // @ts-expect-error\n    await runTests({bench: this, testCases, onBenchmarkComplete});\n\n    const elapsed = (getHiResTimestamp() - timeStart) / 1000;\n    logEntry(this.props.log, null, {type: 'complete', time: elapsed, message: 'Complete'});\n    this.onSuiteComplete();\n  }\n\n  /** Adds a group to the test suite */\n  group(id: string): this {\n    if (this.testCases[id]) {\n      throw new Error('tests need unique id strings');\n    }\n    this.testCases[id] = {...DEFAULT_BENCH_TEST_CASE, id, group: true};\n    return this;\n  }\n\n  add(id: string, test: BenchTestFunction): this;\n  add(id: string, testCase: BenchTestCaseProps, test: BenchTestFunction): this;\n\n  add(\n    id: string,\n    testCase: BenchTestCaseProps | BenchTestFunction,\n    test?: BenchTestFunction\n  ): this {\n    if (test) {\n      this._addTestCase({...testCase, id, test});\n    } else {\n      this._addTestCase({id, test: testCase as BenchTestFunction});\n    }\n    return this;\n  }\n\n  // Mark test as async (returns promise)\n  addAsync(id: string, test: BenchTestFunction): this;\n  addAsync(id: string, testCase: BenchTestCaseProps, test: BenchTestFunction): this;\n\n  addAsync(\n    id: string,\n    testCase: BenchTestCaseProps | BenchTestFunction,\n    test?: BenchTestFunction\n  ): this {\n    if (test) {\n      this._addTestCase({...testCase, id, test, async: true});\n    } else {\n      this._addTestCase({id, test: testCase as BenchTestFunction, async: true});\n    }\n    return this;\n  }\n\n  onBenchmarkComplete(params: {\n    id: string;\n    time: number;\n    iterations: number;\n    itersPerSecond: number;\n  }): void {\n    const {id, time, iterations, itersPerSecond} = params;\n    // calculate iterations per second, save as numeric value\n    const current = Math.round(iterations / time);\n    // Format as human readable strings\n    this.table[id] = {\n      percent: '',\n      iterations: `${itersPerSecond}/s`,\n      current,\n      max: ''\n    };\n  }\n\n  onSuiteComplete(): void {\n    const localStorage = new LocalStorage<Record<string, any>>(this.id, {});\n    const saved = localStorage.getConfiguration();\n    const current = this.updateTable(this.table, saved);\n    localStorage.setConfiguration(current);\n    console.table(current);\n  }\n\n  updateTable(current: Record<string, any>, saved: Record<string, any>): Record<string, any> {\n    for (const id in this.table) {\n      if (saved[id] && saved[id].max !== undefined) {\n        current[id].max = Math.max(current[id].current, saved[id].max);\n        const delta = current[id].current / saved[id].max;\n        current[id].percent = `${Math.round(delta * 100 - 100)}%`;\n      } else {\n        current[id].max = current[id].current;\n      }\n    }\n    return current;\n  }\n\n  _addTestCase(testCaseProps: BenchTestCaseProps): void {\n    if (!testCaseProps.id || this.testCases[testCaseProps.id]) {\n      throw new Error('tests need unique id strings');\n    }\n\n    const testCase: BenchTestCase = {...DEFAULT_BENCH_TEST_CASE, ...this.props, ...testCaseProps};\n\n    this.testCases[testCaseProps.id] = testCase;\n  }\n}\n\n// Helper methods\n\n// Helper function to promisify setTimeout\nfunction addDelay(timeout: number): Promise<void> {\n  return new Promise((resolve) => {\n    setTimeout(() => resolve(), timeout);\n  });\n}\n\nfunction runCalibrationTests({testCases}: {testCases: Record<string, BenchTestCase>}): void {\n  // Beat JIT - run each test once\n  for (const testCase of Object.values(testCases)) {\n    if (!testCase.group) {\n      runBenchTestCaseIterations(testCase, 1);\n    }\n  }\n}\n\nfunction logEntry(logFunction: LogFunction, testCase: BenchTestCase | null, entry: LogEntry): void {\n  const priority = globalThis.probe.priority || 10;\n  if ((testCase?.priority || 0) <= priority) {\n    logFunction({...entry});\n  }\n}\n\n// Run a list of bench test case asynchronously (with short timeouts inbetween)\nasync function runTests({\n  bench,\n  testCases,\n  onBenchmarkComplete = noop\n}: {\n  bench: Bench;\n  testCases: BenchTestCase[];\n  onBenchmarkComplete?: Function;\n}) {\n  // Run default warm up and calibration testCases\n  // @ts-expect-error\n  runCalibrationTests({testCases, onBenchmarkComplete});\n\n  // Run the suite testCases\n  for (const testCase of Object.values(testCases)) {\n    if (testCase.group) {\n      logEntry(bench.props.log, testCase, {type: 'group', message: testCase.id, id: testCase.id});\n    } else {\n      await runTest({bench, testCase, onBenchmarkComplete});\n    }\n  }\n}\n\nasync function runTest({\n  bench,\n  testCase,\n  onBenchmarkComplete,\n  silent = false\n}: {\n  bench: Bench;\n  testCase: BenchTestCase;\n  onBenchmarkComplete?: Function;\n  silent?: boolean;\n}) {\n  // Inject a small delay between each testCase. System cools and DOM console updates...\n  if (testCase.delay) {\n    await addDelay(testCase.delay);\n  }\n\n  const result = await runBenchTestCaseAsync(testCase);\n\n  const {iterationsPerSecond, time, iterations, error} = result;\n\n  const itersPerSecond = formatSI(iterationsPerSecond);\n\n  if (!silent) {\n    logEntry(bench.props.log, testCase, {\n      type: 'test',\n      itersPerSecond,\n      time,\n      error,\n      message: `${testCase.id} ${itersPerSecond} ${testCase.unit}/s \u00B1${(error * 100).toFixed(2)}%`,\n      id: testCase.id,\n      unit: testCase.unit\n    });\n  }\n\n  if (onBenchmarkComplete) {\n    onBenchmarkComplete({\n      id: testCase.id,\n      time,\n      iterations,\n      iterationsPerSecond,\n      itersPerSecond\n    });\n  }\n}\n\n// Test runners\n\nasync function runBenchTestCaseAsync(testCase: BenchTestCase) {\n  const results: number[] = [];\n  let totalTime = 0;\n  let totalIterations = 0;\n\n  const minIterations: number = testCase.minIterations || 1;\n\n  for (let i = 0; i < minIterations; i++) {\n    let time;\n    let iterations;\n    // Runs \"testCase._throughput\" parallel testCase cases\n    if (testCase.async && testCase._throughput) {\n      ({time, iterations} = await runBenchTestCaseParallelIterationsAsync(\n        testCase,\n        testCase._throughput\n      ));\n    } else {\n      ({time, iterations} = await runBenchTestCaseForMinimumTimeAsync(\n        testCase,\n        testCase.time || 0\n      ));\n    }\n\n    // Test options can have `multiplier` to return a more semantic number\n    // (e.g. number of bytes, lines, points or pixels decoded per iteration)\n    iterations *= testCase.multiplier || 1;\n\n    const iterationsPerSecond = iterations / time;\n    results.push(iterationsPerSecond);\n    totalTime += time;\n    totalIterations += iterations;\n  }\n\n  return {\n    time: totalTime,\n    iterations: totalIterations,\n    iterationsPerSecond: mean(results),\n    error: cv(results)\n  };\n}\n\n// Run a test func for an increasing amount of iterations until time threshold exceeded\nasync function runBenchTestCaseForMinimumTimeAsync(\n  testCase: BenchTestCase,\n  minTime: number\n): Promise<{time: number; iterations: number}> {\n  let iterations = 1;\n  let elapsedMillis = 0;\n\n  // Run increasing amount of interations until we reach time threshold, default at least 100ms\n  while (elapsedMillis < minTime) {\n    let multiplier = 10;\n    if (elapsedMillis > 10) {\n      multiplier = ((testCase.time || 0) / elapsedMillis) * 1.25;\n    }\n    iterations *= multiplier;\n    const timeStart = getHiResTimestamp();\n    if (testCase.async) {\n      await runBenchTestCaseIterationsAsync(testCase, iterations);\n    } else {\n      runBenchTestCaseIterations(testCase, iterations);\n    }\n    elapsedMillis = getHiResTimestamp() - timeStart;\n  }\n\n  const time = elapsedMillis / 1000;\n\n  return {\n    time,\n    iterations\n  };\n}\n\n// Run a test func for a specific amount of parallel iterations\nasync function runBenchTestCaseParallelIterationsAsync(\n  testCase: BenchTestCase,\n  iterations: number\n): Promise<{time: number; iterations: number}> {\n  const testArgs = testCase.initialize && testCase.initialize();\n\n  const timeStart = getHiResTimestamp();\n\n  const promises: Promise<unknown>[] = [];\n\n  const {context, test} = testCase;\n  for (let i = 0; i < iterations; i++) {\n    promises.push(Promise.resolve(test?.call(context, testArgs)));\n  }\n\n  await Promise.all(promises);\n\n  const time = (getHiResTimestamp() - timeStart) / 1000;\n\n  return {\n    time,\n    iterations\n  };\n}\n\n// Run a test func for a specific amount of iterations\nasync function runBenchTestCaseIterationsAsync(\n  testCase: BenchTestCase,\n  iterations: number\n): Promise<void> {\n  const testArgs = testCase.initialize && testCase.initialize();\n  const {context, test} = testCase;\n  for (let i = 0; i < iterations; i++) {\n    await test?.call(context, testArgs);\n  }\n}\n\n// Sync tests\n\n// Run a test func for a specific amount of iterations\nfunction runBenchTestCaseIterations(testCase: BenchTestCase, iterations: number): void {\n  const testArgs = testCase.initialize && testCase.initialize();\n\n  // When running sync, avoid overhead of parameter passing if not needed\n  const {context, test} = testCase;\n  if (context && testArgs) {\n    for (let i = 0; i < iterations; i++) {\n      test?.call(context, testArgs);\n    }\n  } else {\n    for (let i = 0; i < iterations; i++) {\n      test?.call(context);\n    }\n  }\n}\n", "export function formatSI(number: number, precision: number = 3): string {\n  const {base, exponent} = splitIntoBaseAndExponent(number);\n  const multipleOf3 = Math.floor(exponent / 3);\n  const remaining = exponent - multipleOf3 * 3;\n  const digits = base * Math.pow(10, remaining);\n  return `${digits.toPrecision(precision)}${getSISuffix(multipleOf3)}`;\n}\n\nfunction getSISuffix(multipleOf3: number): string {\n  const SI_SUFFIXES: Record<string, string> = {\n    0: '',\n    1: 'K',\n    2: 'M',\n    3: 'G',\n    4: 'T',\n    5: 'P',\n    6: 'E',\n    '-1': 'm',\n    '-2': '\u00B5',\n    '-3': 'n'\n  };\n  const key = String(multipleOf3);\n  return key in SI_SUFFIXES ? SI_SUFFIXES[key] || '' : `e${multipleOf3 * 3}`;\n}\n\n// Breaks a number into a normalized base and an exponent\n// E.g. 5640 => {5.64, 1000}\nfunction splitIntoBaseAndExponent(number: number): {base: number; exponent: number} {\n  let base = number;\n  let exponent = 0;\n  if (number !== 0) {\n    while (base >= 10 || base <= -10) {\n      base /= 10;\n      exponent++;\n    }\n    while (base < 1 && base > -1) {\n      base *= 10;\n      exponent--;\n    }\n  }\n  return {base, exponent};\n}\n", "// probe.gl, MIT license\n\n/** mean */\nexport function mean(numbers: number[]): number {\n  return numbers.reduce((sum, x) => sum + x, 0) / numbers.length;\n}\n\n/** standard deviation */\nexport function std(numbers: number[], precalculatedMean?: number): number {\n  if (numbers.length <= 1) {\n    return 0;\n  }\n\n  const meanValue = precalculatedMean === undefined ? mean(numbers) : precalculatedMean;\n\n  return Math.sqrt(\n    numbers.reduce((d, x) => d + (x - meanValue) * (x - meanValue), 0) / (numbers.length - 1)\n  );\n}\n\n/** coefficient of variation */\nexport function cv(numbers: number[]): number {\n  const _mean = mean(numbers);\n  const _std = std(numbers, _mean);\n  return _std / _mean;\n}\n", "/* eslint-disable no-console */\nimport type {LogEntry} from './bench';\nimport {rightPad} from '@probe.gl/log';\n\nexport function logResultsAsMarkdownTable(logEntry: LogEntry): void {\n  const COL1 = 50;\n  const COL2 = 12;\n  switch (logEntry.type) {\n    case 'group':\n      console.log('');\n      console.log(`| ${rightPad(logEntry.id, COL1)} | iterations/s | error |`);\n      console.log(`| ${rightPad('---', COL1)} | ---          | --- |`);\n      break;\n    case 'test':\n      console.log(\n        `| ${rightPad(logEntry.id, COL1)} | ${rightPad(logEntry.itersPerSecond, COL2)} | \u00B1${(\n          logEntry.error * 100\n        ).toFixed(2)}% |`\n      );\n      break;\n    case 'complete':\n      console.log('');\n      console.log(`Completed benchmark in ${logEntry.time}s`);\n      break;\n    default:\n  }\n}\n\nexport function logResultsAsTree(logEntry: LogEntry): void {\n  switch (logEntry.type) {\n    case 'group':\n      console.log('');\n      console.log(`${logEntry.id}`);\n      break;\n    case 'test':\n      console.log(\n        `\u251C\u2500 ${logEntry.id}: ${logEntry.itersPerSecond} ${logEntry.unit}/s \u00B1${(\n          logEntry.error * 100\n        ).toFixed(2)}%`\n      );\n      break;\n    case 'complete':\n      console.log('');\n      console.log(`Completed benchmark in ${logEntry.time}s`);\n      break;\n    default:\n  }\n}\n\nexport function logResultsAsTreeWithElapsed(logEntry: LogEntry): void {\n  switch (logEntry.type) {\n    case 'test':\n      console.log(\n        `\u251C\u2500 ${logEntry.id}: ${logEntry.itersPerSecond} ${logEntry.unit}/s \u00B1${(\n          logEntry.error * 100\n        ).toFixed(2)}% (${logEntry.time.toFixed(2)}s elap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