-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/AG-26623-4
- Loading branch information
Showing
52 changed files
with
1,711 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# CSS Tokenizer Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver]. | ||
|
||
## [0.0.1] - 2023-10-30 | ||
|
||
### Added | ||
|
||
- Initial release. | ||
|
||
[0.0.1]: https://github.com/AdguardTeam/tsurlfilter/releases/tag/css-tokenizer-v0.0.1 | ||
<!-- TODO: Link tag diff later --> | ||
<!-- [0.0.2]: https://github.com/AdguardTeam/tsurlfilter/compare/css-tokenizer-v0.0.1...v0.0.2 --> | ||
|
||
[keepachangelog]: https://keepachangelog.com/en/1.0.0/ | ||
[semver]: https://semver.org/spec/v2.0.0.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file ESLint configuration for the benchmark folder. | ||
*/ | ||
|
||
module.exports = { | ||
rules: { | ||
'import/no-extraneous-dependencies': 'off', | ||
'@typescript-eslint/no-loop-func': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,41 @@ | ||
# CSS Tokenizer benchmark | ||
|
||
This benchmark is used to compare the performance of the CSS Tokenizers. | ||
This benchmark serves as a tool for evaluating the performance of CSS Tokenizers. | ||
|
||
The benchmark results can be found in [`benchmark/RESULTS.md`][results]. | ||
|
||
## Usage | ||
|
||
Simply run the following command to run the benchmark: | ||
To run the benchmark, simply execute the following command: | ||
|
||
```sh | ||
yarn benchmark | ||
``` | ||
|
||
This will run the build for the library and then run the benchmark. | ||
This command will build the library and initiate the benchmark. The results will be displayed on the console and saved | ||
in [`benchmark/RESULTS.md`][results]. | ||
|
||
> [!NOTE] | ||
> Please be aware that the benchmark may take several minutes to complete. | ||
## Supported tokenizers | ||
|
||
You can find the list of supported tokenizers in [`config/tokenizers.ts`][tokenizers-config]. | ||
|
||
We exclusively support tokenizers that adhere to the [CSS Syntax specification][css-specs]. For example, PostCSS is not | ||
included in this benchmark because it utilizes a custom token set, making it difficult to perform a fair comparison with | ||
other tokenizers. | ||
|
||
## Adding a new tokenizer / resource | ||
|
||
To incorporate a new tokenizer or resource, follow these steps: | ||
|
||
1. Open the appropriate configuration file: | ||
- To add a new tokenizer, edit [`config/tokenizers.ts`][tokenizers-config]. | ||
- For adding a new resource, access [`config/resources.ts`][resources-config]. | ||
2. Create a new entry, ensuring that it follows the same format as existing entries in the respective file. | ||
|
||
[css-specs]: https://www.w3.org/TR/css-syntax-3/ | ||
[resources-config]: ./config/resources.ts | ||
[results]: ./RESULTS.md | ||
[tokenizers-config]: ./config/tokenizers.ts |
Oops, something went wrong.