Skip to content

Commit

Permalink
docs: Update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Dec 4, 2023
1 parent 4e17cf6 commit 83a14ae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ fn main() -> Result<(), css_inline::InlineError> {

`css-inline` typically inlines HTML emails within hundreds of microseconds, though results may vary with input complexity.

Benchmarks for `css-inline==0.10.5`:
Benchmarks for `css-inline==0.11.1`:

- Basic: **6.40 µs**, 230 bytes
- Realistic-1: **140.19 µs**, 8.58 KB
- Realistic-2: **86.21 µs**, 4.3 KB
- GitHub page: **263.33 ms**, 1.81 MB
- Basic: **6.60 µs**, 230 bytes
- Realistic-1: **134.99 µs**, 8.58 KB
- Realistic-2: **93.56 µs**, 4.3 KB
- GitHub page: **329.99 ms**, 1.81 MB

These benchmarks, conducted using `rustc 1.71.1`, can be found in `css-inline/benches/inliner.rs`.
These benchmarks, conducted using `rustc 1.74.0`, can be found in `css-inline/benches/inliner.rs`.

## Bindings

Expand Down
12 changes: 6 additions & 6 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ Most of the time it achieves over a **10x** speed advantage compared to the next

Here is the performance comparison:

| | Size | `css_inline 0.10.4` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
| | Size | `css_inline 0.11.1` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
|-------------|---------|---------------------|-------------------------|-------------------------|-------------------------|-------------------------|
| Basic | 230 B | 6.58 µs | 130.45 µs (**19.82x**) | 671.87 µs (**102.06**) | 1.05 ms (**161.00**) | 1.23 ms (**187.51x**) |
| Realistic-1 | 8.58 KB | 146.20 µs | 1.42 ms (**9.71x**) | 16.56 ms (**113.29x**) | 27.45 ms (**187.78x**) | 51.85 ms (**354.66x**) |
| Realistic-2 | 4.3 KB | 87.91 µs | 2.71 ms (**30.90x**) | ERROR | 18.07 ms (**205.64x**) | ERROR |
| GitHub page | 1.81 MB | 262.74 ms | 25.38 s (**96.63x**) | ERROR | ERROR | ERROR |
| Basic | 230 B | 6.62 µs | 127.54 µs (**19.25x**) | 661.58 µs (**99.86**) | 1.04 ms (**157.91**) | 1.13 ms (**180.99x**) |
| Realistic-1 | 8.58 KB | 145.58 µs | 1.47 ms (**10.10x**) | 17.07 ms (**117.26x**) | 28.22 ms (**193.88x**) | 52.96 ms (**363.81x**) |
| Realistic-2 | 4.3 KB | 94.20 µs | 2.67 ms (**28.36x**) | ERROR | 17.95 ms (**190.59x**) | ERROR |
| GitHub page | 1.81 MB | 338.88 ms | 25.58 s (**75.49x**) | ERROR | ERROR | ERROR |

The above data was obtained from benchmarking the inlining of CSS in HTML, as described in the Usage section.
Note that the `toronado`, `inlinestyler` and `pynliner` libraries both encountered errors when used to inline CSS in the last scenario.

The benchmarking code is available in the `benches/bench.py` file. The benchmarks were conducted using the stable `rustc 1.71.1` on Python `3.11.4`.
The benchmarking code is available in the `benches/bench.py` file. The benchmarks were conducted using the stable `rustc 1.74` on Python `3.11.6`.

## Comparison with other libraries

Expand Down
10 changes: 5 additions & 5 deletions bindings/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ It consistently outperforms `premailer`, offering speed increases often exceedin

The table below provides a detailed comparison between `css_inline` and `premailer` when inlining CSS into an HTML document (like in the Usage section above):

| | Size | `css_inline 0.10.4` | `premailer 1.21.0 with Nokogiri 1.15.2` | Difference |
| | Size | `css_inline 0.11.1` | `premailer 1.21.0 with Nokogiri 1.15.2` | Difference |
|-------------------|---------|---------------------|------------------------------------------------|------------|
| Basic usage | 230 B | 8.05 µs | 419.75 µs | **52.13x** |
| Realistic email 1 | 8.58 KB | 164.22 µs | 9.75 ms | **59.40x** |
| Realistic email 2 | 4.3 KB | 106.95 µs | Error: Cannot parse 0 calc((100% - 500px) / 2) | - |
| Basic usage | 230 B | 8.23 µs | 415.18 µs | **50.93x** |
| Realistic email 1 | 8.58 KB | 162.69 µs | 10.12 ms | **62.21x** |
| Realistic email 2 | 4.3 KB | 116.01 µs | Error: Cannot parse 0 calc((100% - 500px) / 2) | - |
| GitHub Page | 1.81 MB | 308.11 ms | 3.08 s | **9.99x** |

Please refer to the `test/bench.rb` file to review the benchmark code.
The results displayed above were measured using stable `rustc 1.71.1` on Ruby `3.2.2`.
The results displayed above were measured using stable `rustc 1.74.0` on Ruby `3.2.2`.

## Ruby support

Expand Down

0 comments on commit 83a14ae

Please sign in to comment.