百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

css-selector-generator-benchmark

> 编程语言
开源

用于生成 CSS 选择器的各种 JavaScript 库的基准

188 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于生成 CSS 选择器的各种 JavaScript 库的基准

CSS Selector Generator Benchmark

This project has moved. It now lives in the css-selector-generator repository, under packages/css-selector-generator-benchmark.

**Run it at **

This repository is kept only so that existing links keep working. Its history was preserved in the move.

Benchmark to compare Javascript libraries for generating CSS selectors.

Overview

Tests each library against a complex HTML document and measures various performance and quality metrics.

Currently Tested Libraries

  • css-selector-generator - Configurable CSS selector generator (default settings)
  • css-selector-generator (custom options) - Same library with custom selectors: id, class, tag, nthchild
  • @medv/finder - Fast and efficient CSS selector generator
  • @cypress/unique-selector - Maintained by Cypress, returns unique CSS selector for DOM nodes

Metrics

The benchmark measures:

  • Total Elements: Number of elements tested
  • Selectors Generated: How many selectors were successfully created
  • Unique Selectors: How many selectors uniquely match only their target element
  • Total Time: Total time to generate all selectors
  • Average Time: Average time per selector
  • Fastest/Slowest Time: Performance range
  • Selector Length: Shortest, longest, and average selector length

Installation

bash
npm install

Usage

Development

bash
npm run dev

Build

bash
npm run build

Preview

bash
npm run preview

Test Document

The benchmark uses complex.html from the css-selector-generator test suite, which contains a realistic web application interface with nested elements, multiple classes, IDs, and various attribute combinations.

Adding New Libraries

To add a new library to the benchmark:

  1. Install the library: npm install
  2. Update src/utils/benchmark.ts to include the library
  3. Add the GitHub URL to src/components/BenchmarkTable.tsx

License

Unlicense

Bug Reports & Feature Requests

If you found any bugs or have feature requests, please file an issue at GitHub.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言