Skip to content

Commit

Permalink
add benchmark for keywordset (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartveneman authored Aug 6, 2024
1 parent 713579f commit 3088ea1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 3088ea1

Please sign in to comment.