Skip to content

Commit

Permalink
docs: update benchmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
  • Loading branch information
Stranger6667 committed Apr 1, 2024
1 parent b912ab5 commit 47e1ae6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ Caching is disabled by default.

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

Benchmarks for `css-inline==0.13.0`:
Benchmarks for `css-inline==0.14.0`:

- Basic: **6.29 µs**, 230 bytes
- Realistic-1: **127.72 µs**, 8.58 KB
- Realistic-2: **82.74 µs**, 4.3 KB
- GitHub page: **227.76 ms**, 1.81 MB
- Basic: **6.72 µs**, 230 bytes
- Realistic-1: **132.59 µs**, 8.58 KB
- Realistic-2: **86.01 µs**, 4.3 KB
- GitHub page: **228.97 ms**, 1.81 MB

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

## Command Line Interface

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

Here is the performance comparison:

| | Size | `css-inline 0.13.0` | `css-inline-wasm 0.13.0` | `juice 10.0.0` | `inline-css 4.0.2` |
|-------------|---------|---------------------|--------------------------|----------------------|----------------------|
| Basic | 230 B | 15.34 µs | 19.99 µs (**1.30x**) | 56.70 µs (**3.69x**) | 67.95 µs (**4.42x**) |
| Realistic-1 | 8.58 KB | 333.22 µs | 434.59 µs (**1.30x**) | 1.07 ms (**3.23x**) | 1.24 ms (**3.73x**) |
| Realistic-2 | 4.3 KB | 195.80 µs | 261.09 µs (**1.33x**) | 0.99 ms (**5.10x**) | 0.76 ms (**3.90x**) |
| | Size | `css-inline 0.14.0` | `css-inline-wasm 0.13.0` | `juice 10.0.0` | `inline-css 4.0.2` |
|-------------|---------|---------------------|--------------------------|-----------------------|----------------------|
| Basic | 230 B | 16.82 µs | 20.92 µs (**1.24x**) | 57.00 µs (**3.38x**) | 68.43 µs (**4.06x**) |
| Realistic-1 | 8.58 KB | 351.74 µs | 452.28 µs (**1.28x**) | 859.10 µs (**2.44x**) | 1.04 ms (**2.98x**) |
| Realistic-2 | 4.3 KB | 203.25 µs | 269.54 µs (**1.32x**) | 1.02 ms (**5.04x**) | 861.32 µs (**4.23x**) |

The "Basic" case was obtained from benchmarking the example from the Usage section.

The benchmarking code is available in the `benches/bench.ts` file. The benchmarks were conducted using the stable `rustc 1.75.0` on Node.js `v21.1.0`.
The benchmarking code is available in the `benches/bench.ts` file. The benchmarks were conducted using the stable `rustc 1.77.1` on Node.js `v21.1.0`.

## License

Expand Down
14 changes: 7 additions & 7 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,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.13.0` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
|-------------|---------|---------------------|------------------------|------------------------|------------------------|------------------------|
| Basic | 230 B | 6.54 µs | 126.95 µs (**19.41x**) | 653.12 µs (**99.85x**) | 1.02 ms (**157.14x**) | 1.17ms (**179.91x**) |
| Realistic-1 | 8.58 KB | 133.87 µs | 1.41 ms (**10.60x**) | 15.85 ms (**118.39x**) | 26.48 ms (**197.86x**) | 51.56 ms (**385.18x**) |
| Realistic-2 | 4.3 KB | 85.41 µs | 2.65 ms (**31.09x**) | ERROR | 17.68 ms (**207.07x**) | ERROR |
| GitHub page | 1.81 MB | 229.02 ms | 24.73 s (**108.02x**) | ERROR | ERROR | ERROR |
| | Size | `css_inline 0.14.0` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
|-------------|---------|---------------------|------------------------|-------------------------|------------------------|------------------------|
| Basic | 230 B | 6.79 µs | 130.25 µs (**19.18x**) | 683.04 µs (**100.58x**) | 1.06 ms (**157.10x**) | 1.21ms (**178.61x**) |
| Realistic-1 | 8.58 KB | 135.37 µs | 1.40 ms (**10.38x**) | 16.29 ms (**120.37x**) | 26.64 ms (**196.82x**) | 52.36 ms (**386.85x**) |
| Realistic-2 | 4.3 KB | 85.41 µs | 2.70 ms (**31.70x**) | ERROR | 17.57 ms (**205.73x**) | ERROR |
| GitHub page | 1.81 MB | 230.63 ms | 24.32 s (**105.45x**) | ERROR | ERROR | ERROR |

The "Basic" case was obtained from benchmarking the example from 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.75.0` on Python `3.11.7`.
The benchmarking code is available in the `benches/bench.py` file. The benchmarks were conducted using the stable `rustc 1.77.1` on Python `3.11.7`.

## 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 @@ -210,15 +210,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.13.0` | `premailer 1.21.0 with Nokogiri 1.15.2` | Difference |
| | Size | `css_inline 0.14.0` | `premailer 1.21.0 with Nokogiri 1.15.2` | Difference |
|-------------------|---------|---------------------|------------------------------------------------|------------|
| Basic usage | 230 B | 7.79 µs | 417.56 µs | **53.57x** |
| Realistic email 1 | 8.58 KB | 149.56 µs | 9.73 ms | **65.07x** |
| Realistic email 2 | 4.3 KB | 93.19 µs | Error: Cannot parse 0 calc((100% - 500px) / 2) | - |
| Basic usage | 230 B | 8.82 µs | 417.84 µs | **47.37x** |
| Realistic email 1 | 8.58 KB | 160.37 µs | 10.15 ms | **63.32x** |
| Realistic email 2 | 4.3 KB | 102.88 µs | Error: Cannot parse 0 calc((100% - 500px) / 2) | - |
| GitHub Page | 1.81 MB | 237.03 ms | 3.02 s | **12.78x** |

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

## Further reading

Expand Down

0 comments on commit 47e1ae6

Please sign in to comment.