From 3088ea1bbec4e427e49cda9a29415fd545cf8a43 Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:42:32 +0200 Subject: [PATCH] add benchmark for keywordset (#418) --- benchmark/benchmark.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js index 44d896f..561f005 100644 --- a/benchmark/benchmark.js +++ b/benchmark/benchmark.js @@ -2,6 +2,7 @@ import { Bench } from "tinybench" import { withCodSpeed } from "@codspeed/tinybench-plugin" import * as fs from "fs" import { analyze } from '../src/index.js' +import { namedColors, systemColors, colorKeywords } from "../src/values/colors.js" let filelist = fs.readdirSync('./src/__fixtures__') let files = filelist @@ -259,6 +260,15 @@ bench.add('slice of nerdy.dev', () => { `) }) +bench.add('KeywordSet', () => { + namedColors.has('rebeccapurple') + namedColors.has('Highlight') + systemColors.has('Highlight') + systemColors.has('currentColor') + namedColors.has('not-a-color') + colorKeywords.has('currentColor') +}) + await bench.warmup() await bench.run()