@@ -5,48 +5,16 @@ This project provides:
55- Language bindings for [ tree-sitter-highlight] ( https://crates.io/crates/tree-sitter-highlight ) .
66 - [ python] ( crates/py-tree-sitter-highlight )
77 - [ lua] ( crates/lua-tree-sitter-highlight )
8+ - [ nodejs] ( crates/js-tree-sitter-highlight ) : TODO
89- Some packages to use tree-sitter to highlight
910 - [ sphinx] ( https://github.com/sphinx-doc/sphinx ) :
1011 [ sphinxcontrib-tree-sitter] ( packages/sphinxcontrib-tree-sitter )
1112 - [ ldoc] ( https://github.com/lunarmodules/ldoc ) :
1213 [ texcat] ( https://texrocks.readthedocs.io/en/latest/topics/texcat.md.html )
13- - [ LaTeX ] ( https ://www.latex-project.org/ ) : also
14+ - [ pandoc ] ( http ://github.com/pandoc/pandoc ) :
1415 [ texcat] ( https://texrocks.readthedocs.io/en/latest/topics/texcat.md.html )
15- - [ pandoc ] ( http ://github.com/pandoc/pandoc ) : also
16+ - [ LaTeX ] ( https ://www.latex-project.org/ ) :
1617 [ texcat] ( https://texrocks.readthedocs.io/en/latest/topics/texcat.md.html )
18+ - [ hexo] ( https://github.com/hexojs/hexo ) : TODO
1719 - [ jekyll] ( https://github.com/jekyll/jekyll ) : TODO
1820 - [ typst] ( https://github.com/typst/typst ) : TODO
19-
20- ## Bench
21-
22- <!-- markdownlint-disable MD013 -->
23-
24- ``` bash
25- $ hyperfine -Nw10 ' python -m sphinxcontrib.tree_sitter pyproject.toml' ' texcat pyproject.toml' ' tree-sitter highlight pyproject.toml' ' pygmentize pyproject.toml' ' bat pyproject.toml'
26- Benchmark 1: python -m sphinxcontrib.tree_sitter pyproject.toml
27- Time (mean ± σ): 397.4 ms ± 64.9 ms [User: 338.5 ms, System: 50.8 ms]
28- Range (min … max): 335.9 ms … 503.8 ms 10 runs
29-
30- Benchmark 2: texcat pyproject.toml
31- Time (mean ± σ): 1.782 s ± 0.041 s [User: 1.174 s, System: 0.600 s]
32- Range (min … max): 1.746 s … 1.884 s 10 runs
33-
34- Benchmark 3: tree-sitter highlight pyproject.toml
35- Time (mean ± σ): 6.2 ms ± 0.4 ms [User: 2.7 ms, System: 3.1 ms]
36- Range (min … max): 5.5 ms … 8.3 ms 394 runs
37-
38- Benchmark 4: pygmentize pyproject.toml
39- Time (mean ± σ): 262.4 ms ± 2.6 ms [User: 236.6 ms, System: 23.0 ms]
40- Range (min … max): 258.9 ms … 268.5 ms 11 runs
41-
42- Benchmark 5: bat pyproject.toml
43- Time (mean ± σ): 12.6 ms ± 0.6 ms [User: 10.4 ms, System: 5.7 ms]
44- Range (min … max): 11.6 ms … 14.9 ms 223 runs
45-
46- Summary
47- tree-sitter highlight pyproject.toml ran
48- 2.04 ± 0.17 times faster than bat pyproject.toml
49- 42.38 ± 2.87 times faster than pygmentize pyproject.toml
50- 64.18 ± 11.32 times faster than python -m sphinxcontrib.tree_sitter pyproject.toml
51- 287.79 ± 20.36 times faster than texcat pyproject.toml
52- ```
0 commit comments