model::xenova/all-MiniLM-L6-v2
averaged 10 on each setup
| modelName | 11 char (ms) | 130k char (ms) |
| ------------------------------------- | ------------ | -------------- |
| 'Xenova/all-MiniLM-L6-v2-fp16-webgpu' | 23 | 63 |
| 'Xenova/all-MiniLM-L6-v2-fp32-webgpu' | 29 | 73 |
| 'Xenova/all-MiniLM-L6-v2-int8-webgpu' | 103 | 311 |
| 'Xenova/all-MiniLM-L6-v2-int8-wasm' | 4 | 350 |
| 'Xenova/all-MiniLM-L6-v2-fp32-wasm' | 6 | 429 |
| 'Xenova/all-MiniLM-L6-v2-q4f16-wasm' | 24 | 455 |
| 'Xenova/all-MiniLM-L6-v2-fp16-wasm' | 23 | 478 |
```js
(async (params = {}) => {
const { text = "hello world", runs = 10 } = params;
const models = await runtime.call('transformer.listModels');
const results = [];
for (const modelName of models) {
const times = [];
for (let i = 0; i < runs; i++) {
const start = performance.now();
await embedding.embedText({ text, modelName });
times.push(performance.now() - start);
}
const avgDuration = Math.round(times.reduce((sum, time) => sum + time, 0) / runs);
results.push({ modelName, avgDuration });
}
const sorted = results.sort((a, b) => a.avgDuration - b.avgDuration);
console.table(sorted);
return sorted;
})()
```