Skip to content

Commit

Permalink
docs(benchmark): update benchmark doc
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Apr 16, 2024
1 parent 5b88f40 commit 77d23a9
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 40 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ Mutative is up to 6x faster than naive handcrafted reducer for updating immutabl

> Mutative passed all of Immer's test cases.
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.3 vs Immer v10.0.3]
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.4 vs Immer v10.0.4]

![Benchmark](benchmark.jpg)

```
Naive handcrafted reducer - No Freeze x 4,476 ops/sec ±0.38% (96 runs sampled)
Mutative - No Freeze x 6,058 ops/sec ±0.91% (90 runs sampled)
Immer - No Freeze x 5.80 ops/sec ±0.34% (19 runs sampled)
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
Mutative - Freeze x 971 ops/sec ±1.07% (98 runs sampled)
Immer - Freeze x 380 ops/sec ±0.61% (94 runs sampled)
Mutative - Freeze x 960 ops/sec ±1.42% (95 runs sampled)
Immer - Freeze x 378 ops/sec ±0.70% (93 runs sampled)
Mutative - Patches and No Freeze x 967 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and No Freeze x 5.83 ops/sec ±0.17% (19 runs sampled)
Mutative - Patches and No Freeze x 960 ops/sec ±1.32% (97 runs sampled)
Immer - Patches and No Freeze x 5.27 ops/sec ±0.69% (18 runs sampled)
Mutative - Patches and Freeze x 502 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and Freeze x 278 ops/sec ±0.73% (90 runs sampled)
Mutative - Patches and Freeze x 493 ops/sec ±1.40% (94 runs sampled)
Immer - Patches and Freeze x 275 ops/sec ±0.62% (89 runs sampled)
The fastest method is Mutative - No Freeze
```
Expand Down
Binary file modified benchmark-array.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark-class.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark-object.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified benchmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/blog/releases/1.0/img/benchmark-array.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/blog/releases/1.0/img/benchmark-object.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/blog/releases/1.0/img/benchmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions website/blog/releases/1.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ const state = create(baseState, (draft) => {

> Mutative passed all of Immer's test cases.
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.3 vs Immer v10.0.3]
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.4 vs Immer v10.0.4]

![Benchmark](img/benchmark.jpg)

```
Naive handcrafted reducer - No Freeze x 4,476 ops/sec ±0.38% (96 runs sampled)
Mutative - No Freeze x 6,058 ops/sec ±0.91% (90 runs sampled)
Immer - No Freeze x 5.80 ops/sec ±0.34% (19 runs sampled)
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
Mutative - Freeze x 971 ops/sec ±1.07% (98 runs sampled)
Immer - Freeze x 380 ops/sec ±0.61% (94 runs sampled)
Mutative - Freeze x 960 ops/sec ±1.42% (95 runs sampled)
Immer - Freeze x 378 ops/sec ±0.70% (93 runs sampled)
Mutative - Patches and No Freeze x 967 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and No Freeze x 5.83 ops/sec ±0.17% (19 runs sampled)
Mutative - Patches and No Freeze x 960 ops/sec ±1.32% (97 runs sampled)
Immer - Patches and No Freeze x 5.27 ops/sec ±0.69% (18 runs sampled)
Mutative - Patches and Freeze x 502 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and Freeze x 278 ops/sec ±0.73% (90 runs sampled)
Mutative - Patches and Freeze x 493 ops/sec ±1.40% (94 runs sampled)
Immer - Patches and Freeze x 275 ops/sec ±0.62% (89 runs sampled)
The fastest method is Mutative - No Freeze
```
Expand Down
20 changes: 10 additions & 10 deletions website/docs/extra-topics/comparison-with-immer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ Mutative has fewer bugs such as accidental draft escapes than Immer, [view detai

> Mutative passed all of Immer's test cases.
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.3 vs Immer v10.0.3]
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.4 vs Immer v10.0.4]

![Benchmark](img/benchmark.jpg)

```
Naive handcrafted reducer - No Freeze x 4,476 ops/sec ±0.38% (96 runs sampled)
Mutative - No Freeze x 6,058 ops/sec ±0.91% (90 runs sampled)
Immer - No Freeze x 5.80 ops/sec ±0.34% (19 runs sampled)
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
Mutative - Freeze x 971 ops/sec ±1.07% (98 runs sampled)
Immer - Freeze x 380 ops/sec ±0.61% (94 runs sampled)
Mutative - Freeze x 960 ops/sec ±1.42% (95 runs sampled)
Immer - Freeze x 378 ops/sec ±0.70% (93 runs sampled)
Mutative - Patches and No Freeze x 967 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and No Freeze x 5.83 ops/sec ±0.17% (19 runs sampled)
Mutative - Patches and No Freeze x 960 ops/sec ±1.32% (97 runs sampled)
Immer - Patches and No Freeze x 5.27 ops/sec ±0.69% (18 runs sampled)
Mutative - Patches and Freeze x 502 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and Freeze x 278 ops/sec ±0.73% (90 runs sampled)
Mutative - Patches and Freeze x 493 ops/sec ±1.40% (94 runs sampled)
Immer - Patches and Freeze x 275 ops/sec ±0.62% (89 runs sampled)
The fastest method is Mutative - No Freeze
```
Expand Down
Binary file modified website/docs/extra-topics/img/benchmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/getting-started/img/benchmark-array.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/getting-started/img/benchmark-object.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/getting-started/img/benchmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions website/docs/getting-started/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ const state = create(baseState, (draft) => {

> Mutative passed all of Immer's test cases.
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.3 vs Immer v10.0.3]
Measure(ops/sec) to update 50K arrays and 1K objects, bigger is better([view source](https://github.com/unadlib/mutative/blob/main/test/performance/benchmark.ts)). [Mutative v1.0.4 vs Immer v10.0.4]

![Benchmark](img/benchmark.jpg)

```
Naive handcrafted reducer - No Freeze x 4,476 ops/sec ±0.38% (96 runs sampled)
Mutative - No Freeze x 6,058 ops/sec ±0.91% (90 runs sampled)
Immer - No Freeze x 5.80 ops/sec ±0.34% (19 runs sampled)
Naive handcrafted reducer - No Freeze x 4,450 ops/sec ±0.36% (96 runs sampled)
Mutative - No Freeze x 6,137 ops/sec ±1.15% (89 runs sampled)
Immer - No Freeze x 5.27 ops/sec ±0.65% (18 runs sampled)
Mutative - Freeze x 971 ops/sec ±1.07% (98 runs sampled)
Immer - Freeze x 380 ops/sec ±0.61% (94 runs sampled)
Mutative - Freeze x 960 ops/sec ±1.42% (95 runs sampled)
Immer - Freeze x 378 ops/sec ±0.70% (93 runs sampled)
Mutative - Patches and No Freeze x 967 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and No Freeze x 5.83 ops/sec ±0.17% (19 runs sampled)
Mutative - Patches and No Freeze x 960 ops/sec ±1.32% (97 runs sampled)
Immer - Patches and No Freeze x 5.27 ops/sec ±0.69% (18 runs sampled)
Mutative - Patches and Freeze x 502 ops/sec ±0.94% (96 runs sampled)
Immer - Patches and Freeze x 278 ops/sec ±0.73% (90 runs sampled)
Mutative - Patches and Freeze x 493 ops/sec ±1.40% (94 runs sampled)
Immer - Patches and Freeze x 275 ops/sec ±0.62% (89 runs sampled)
The fastest method is Mutative - No Freeze
```
Expand Down

0 comments on commit 77d23a9

Please sign in to comment.