diff --git a/packages/tailwindcss/src/source-maps/line-table.bench.ts b/packages/tailwindcss/src/source-maps/line-table.bench.ts new file mode 100644 index 000000000..862e2d398 --- /dev/null +++ b/packages/tailwindcss/src/source-maps/line-table.bench.ts @@ -0,0 +1,13 @@ +import { readFileSync } from 'node:fs' +import { fileURLToPath } from 'node:url' + +import { bench } from 'vitest' +import { createLineTable } from './line-table' + +const currentFolder = fileURLToPath(new URL('..', import.meta.url)) +const cssFile = readFileSync(currentFolder + '../preflight.css', 'utf-8') +const table = createLineTable(cssFile) + +bench('line table lookups', () => { + for (let i = 0; i < cssFile.length; ++i) table.find(i) +})