File tree Expand file tree Collapse file tree 4 files changed +54
-72
lines changed Expand file tree Collapse file tree 4 files changed +54
-72
lines changed Original file line number Diff line number Diff line change @@ -237,17 +237,17 @@ Most of the time it achieves over a **10x** speed advantage compared to the next
237
237
238
238
Here is the performance comparison:
239
239
240
- | | Size | ` css_inline 0.14.1 ` | ` premailer 3.10.0 ` | ` toronado 0.1.0 ` | ` inlinestyler 0.2.5 ` | ` pynliner 0.8.0 ` |
240
+ | | Size | ` css_inline 0.15.0 ` | ` premailer 3.10.0 ` | ` toronado 0.1.0 ` | ` inlinestyler 0.2.5 ` | ` pynliner 0.8.0 ` |
241
241
| -------------| ---------| ---------------------| ------------------------| -------------------------| ------------------------| ------------------------|
242
- | Basic | 230 B | 6.54 µs | 127.62 µs (** 19.51x ** ) | 657.50 µs (** 100.52x ** ) | 1.02 ms (** 157.01x ** ) | 1.17ms (** 179.64x ** ) |
243
- | Realistic-1 | 8.58 KB | 134.54 µs | 1.40 ms (** 10.42x ** ) | 15.81 ms (** 117.54x ** ) | 26.37 ms (** 196.04x ** ) | 52.77 ms (** 392.29x ** ) |
244
- | Realistic-2 | 4.3 KB | 82.37 µs | 2 .78 ms (** 33.80x ** ) | ERROR | 17.71 ms (** 215.01x ** ) | ERROR |
245
- | GitHub page | 1.81 MB | 223.85 ms | 25.04 s (** 111.90x ** ) | ERROR | ERROR | ERROR |
242
+ | Basic | 230 B | 4.72 µs | 111.47 µs (** 23.57x ** ) | 614.57 µs (** 129.96x ** ) | 1.02 ms (** 216.10x ** ) | 1.15ms (** 258.45x ** ) |
243
+ | Realistic-1 | 8.58 KB | 86.67 µs | 1.23 ms (** 14.23x ** ) | 13.80 ms (** 159.28x ** ) | 26.37 ms (** 304.25x ** ) | 45.24 ms (** 522.05x ** ) |
244
+ | Realistic-2 | 4.3 KB | 59.55 µs | 1 .78 ms (** 29.91x ** ) | ERROR | 17.71 ms (** 297.39x ** ) | ERROR |
245
+ | GitHub page | 1.81 MB | 147.43 ms | 14.08 s (** 95.47x ** ) | ERROR | ERROR | ERROR |
246
246
247
247
The "Basic" case was obtained by benchmarking the example from the Usage section.
248
248
Note that the ` toronado ` , ` inlinestyler ` , and ` pynliner ` libraries both encountered errors when used to inline CSS in the last scenario.
249
249
250
- The benchmarking code is available in the ` benches/bench.py ` file. The benchmarks were conducted using the stable ` rustc 1.78 ` , Python ` 3.11.7 ` on M1 Max .
250
+ The benchmarking code is available in the ` benches/bench.py ` file. The benchmarks were conducted using the stable ` rustc 1.87 ` , Python ` 3.12.5 ` on Ryzen 9 9950X .
251
251
252
252
## Comparison with other libraries
253
253
Original file line number Diff line number Diff line change 1
- #
2
- # This file is autogenerated by pip-compile with Python 3.9
3
- # by the following command:
4
- #
5
- # pip-compile --resolver=backtracking requirements/bench.in
6
- #
7
- beautifulsoup4==4.12.2
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile bench.in
3
+ beautifulsoup4==4.13.4
8
4
# via pynliner
9
- cachetools==5.3.1
5
+ cachetools==6.1.0
10
6
# via premailer
11
- certifi==2024.7.4
7
+ certifi==2025.6.15
12
8
# via requests
13
- charset-normalizer==3.1.0
9
+ charset-normalizer==3.4.2
14
10
# via requests
15
- cssselect==1.2 .0
11
+ cssselect==1.3 .0
16
12
# via
17
13
# premailer
18
14
# toronado
19
- cssutils==2.7 .1
15
+ cssutils==2.11 .1
20
16
# via
21
17
# inlinestyler
22
18
# premailer
23
19
# pynliner
24
20
# toronado
25
- exceptiongroup==1.2.0
26
- # via pytest
27
- idna==3.7
21
+ idna==3.10
28
22
# via requests
29
- iniconfig==2.0 .0
23
+ iniconfig==2.1 .0
30
24
# via pytest
31
25
inlinestyler==0.2.5
32
26
# via -r bench.in
33
- lxml==4.9.2
27
+ lxml==5.4.0
34
28
# via
35
29
# inlinestyler
36
30
# premailer
37
31
# toronado
38
- packaging==23.1
32
+ more-itertools==10.7.0
33
+ # via cssutils
34
+ packaging==25.0
39
35
# via pytest
40
- pluggy==1.0 .0
36
+ pluggy==1.6 .0
41
37
# via pytest
42
38
premailer==3.10.0
43
39
# via -r bench.in
44
40
py-cpuinfo==9.0.0
45
41
# via pytest-benchmark
42
+ pygments==2.19.1
43
+ # via pytest
46
44
pynliner==0.8.0
47
45
# via -r bench.in
48
- pytest==7.3.2
46
+ pytest==8.4.0
49
47
# via pytest-benchmark
50
- pytest-benchmark==4.0 .0
48
+ pytest-benchmark==5.1 .0
51
49
# via -r bench.in
52
50
requests==2.32.4
53
51
# via
54
52
# inlinestyler
55
53
# premailer
56
- soupsieve==2.4.1
54
+ soupsieve==2.7
57
55
# via beautifulsoup4
58
- tomli==2.0.1
59
- # via pytest
60
56
toronado==0.1.0
61
57
# via -r bench.in
62
- urllib3==2.2.2
58
+ typing-extensions==4.14.0
59
+ # via beautifulsoup4
60
+ urllib3==2.4.0
63
61
# via requests
Original file line number Diff line number Diff line change 1
- #
2
- # This file is autogenerated by pip-compile with Python 3.9
3
- # by the following command:
4
- #
5
- # pip-compile --resolver=backtracking requirements/dev.in
6
- #
7
- cachetools==5.3.1
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile dev.in
3
+ cachetools==6.1.0
8
4
# via tox
9
- chardet==5.1 .0
5
+ chardet==5.2 .0
10
6
# via tox
11
7
colorama==0.4.6
12
8
# via tox
13
- distlib==0.3.6
9
+ distlib==0.3.9
14
10
# via virtualenv
15
- filelock==3.12.2
11
+ filelock==3.18.0
16
12
# via
17
13
# tox
18
14
# virtualenv
19
- packaging==23.1
15
+ packaging==25.0
20
16
# via
21
17
# pyproject-api
22
18
# tox
23
- platformdirs==3.5.3
19
+ platformdirs==4.3.8
24
20
# via
25
21
# tox
26
22
# virtualenv
27
- pluggy==1.0 .0
23
+ pluggy==1.6 .0
28
24
# via tox
29
- pyproject-api==1.5.2
25
+ pyproject-api==1.9.1
30
26
# via tox
31
- tomli==2.0.1
32
- # via
33
- # pyproject-api
34
- # tox
35
- tox==4.6.0
36
- # via -r requirements/dev.in
37
- virtualenv==20.23.0
27
+ tox==4.26.0
28
+ # via -r dev.in
29
+ virtualenv==20.31.2
38
30
# via tox
Original file line number Diff line number Diff line change 1
- #
2
- # This file is autogenerated by pip-compile with Python 3.9
3
- # by the following command:
4
- #
5
- # pip-compile --resolver=backtracking requirements/test.in
6
- #
7
- attrs==23.1.0
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile test.in
3
+ attrs==25.3.0
8
4
# via hypothesis
9
- exceptiongroup==1.1.1
10
- # via
11
- # hypothesis
12
- # pytest
13
- hypothesis==6.78.2
14
- # via -r requirements/test.in
15
- iniconfig==2.0.0
5
+ hypothesis==6.135.10
6
+ # via -r test.in
7
+ iniconfig==2.1.0
16
8
# via pytest
17
- packaging==23.1
9
+ packaging==25.0
18
10
# via pytest
19
- pluggy==1.0 .0
11
+ pluggy==1.6 .0
20
12
# via pytest
21
- pytest==7.3.2
22
- # via -r requirements/test.in
13
+ pygments==2.19.1
14
+ # via pytest
15
+ pytest==8.4.0
16
+ # via -r test.in
23
17
sortedcontainers==2.4.0
24
18
# via hypothesis
25
- tomli==2.0.1
26
- # via pytest
You can’t perform that action at this time.
0 commit comments