benchmarkEmbed static method

Future<BenchmarkResult> benchmarkEmbed(
  1. String text, {
  2. int iterations = 10,
})

Embedding generation benchmark (ONNX-powered)

Implementation

static Future<BenchmarkResult> benchmarkEmbed(
  String text, {
  int iterations = 10,
}) async {
  return benchmark(
    'Embed (${text.length} chars)',
    () async {
      await EmbeddingService.embed(text);
    },
    iterations: iterations,
    category: BenchmarkCategory.onnx,
  );
}