BlogDocs

perf(parser): use memchr for lexing comments(#8193)

Merged
Merging
sno2:main
into
main
0%
IMPROVEMENTS
0
REGRESSIONS
0
UNTOUCHED
25
NEW
0
DROPPED
0
IGNORED
0

Benchmarks

formatter[large/dataset.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter::formatter[large/dataset.py]
0%
52.1 ms
52.1 ms
formatter[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter::formatter[numpy/ctypeslib.py]
0%
10 ms
10 ms
formatter[numpy/globals.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter::formatter[numpy/globals.py]
0%
1.1 ms
1.1 ms
formatter[pydantic/types.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter::formatter[pydantic/types.py]
0%
19.2 ms
19.2 ms
formatter[unicode/pypinyin.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter::formatter[unicode/pypinyin.py]
0%
3.4 ms
3.4 ms
lexer[large/dataset.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer::lexer[large/dataset.py]
0%
8.5 ms
8.5 ms
lexer[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer::lexer[numpy/ctypeslib.py]
+1%
1.8 ms
1.8 ms
lexer[numpy/globals.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer::lexer[numpy/globals.py]
+2%
224.7 µs
221 µs
lexer[pydantic/types.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer::lexer[pydantic/types.py]
+2%
3.8 ms
3.7 ms
lexer[unicode/pypinyin.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer::lexer[unicode/pypinyin.py]
+1%
559.1 µs
551.4 µs
linter/all-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules::linter/all-rules[large/dataset.py]
0%
167.8 ms
167.1 ms
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules::linter/all-rules[numpy/ctypeslib.py]
-1%
34.8 ms
35.3 ms
linter/all-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules::linter/all-rules[numpy/globals.py]
0%
4.1 ms
4.1 ms
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules::linter/all-rules[pydantic/types.py]
-1%
73.4 ms
73.8 ms
linter/all-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules::linter/all-rules[unicode/pypinyin.py]
0%
16.2 ms
16.1 ms
linter/default-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules::linter/default-rules[large/dataset.py]
0%
88.3 ms
88.4 ms
linter/default-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules::linter/default-rules[numpy/ctypeslib.py]
-3%
17 ms
17.5 ms
linter/default-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules::linter/default-rules[numpy/globals.py]
+2%
2 ms
2 ms
linter/default-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules::linter/default-rules[pydantic/types.py]
0%
36.1 ms
36.1 ms
linter/default-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules::linter/default-rules[unicode/pypinyin.py]
0%
6 ms
6 ms
parser[large/dataset.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser::parser[large/dataset.py]
0%
65.5 ms
65.4 ms
parser[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser::parser[numpy/ctypeslib.py]
0%
12 ms
11.9 ms
parser[numpy/globals.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser::parser[numpy/globals.py]
0%
1.3 ms
1.3 ms
parser[pydantic/types.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser::parser[pydantic/types.py]
0%
25.2 ms
25.2 ms
parser[unicode/pypinyin.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser::parser[unicode/pypinyin.py]
0%
4.1 ms
4.1 ms

Commits

Click on a commit to change the comparison range
base
main
6f31e9c
0%
always use memchr
5981046
7 months ago by sno2
0%
perf(parser): try using compact_str for comments This might improve performance here because we do not compare comments to values that often. Therefore, the memory locality might improve performance in certain cases as well.
0578954
7 months ago by sno2
0%
Revert "perf(parser): try using compact_str for comments" Using compact_str does not seem to be faster for us :(
0d3717f
7 months ago by sno2
ResourcesHomePricingDocsBlogGitHub
Copyright © 2024 CodSpeed Technology SAS. All rights reserved.