Skip to content

Commit 4801dde

Browse files
committed
Added benchmark results and absolute logo link
1 parent 481095c commit 4801dde

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div align="center">
22

3-
![Microdiff Logo](/Logo.svg)
3+
![Microdiff Logo](https://raw.githubusercontent.com/AsyncBanana/microdiff/master/Logo.svg)
44

55
Microdiff is a tiny (currently <1kb), fast, zero dependency object and array comparison library. It is significantly faster than most other deep comparison libraries, and has full TypeScript support.
66

77
![Minizipped Size (from Bundlephobia)](https://img.shields.io/bundlephobia/minzip/microdiff?style=flat-square) ![License](https://img.shields.io/npm/l/microdiff?style=flat-square) ![dependency Count](https://img.shields.io/badge/dependencies-0-green?style=flat-square)
88

99
</div>
1010

11-
## Get started
11+
# Get started
1212

1313
First, install Microdiff
1414

@@ -34,3 +34,14 @@ console.log(diff(obj1, obj2));
3434
```
3535

3636
There are three different types of changes. `CREATE`, `REMOVE`, and `CHANGE`. The `path` property gives a path to the property in the new object (or the old object in the case of `REMOVE`). Each element in the array is a key to the next property a level deeper until you get to the property changed. The `value` property exists in types `CREATE` and `CHANGE`, and it contains the value of the property added/changed.
37+
38+
# Benchmarks
39+
40+
```
41+
deep-diff: 23054ns - 206% slower
42+
deep-object-diff: 30809ns - 309% slower
43+
jsdiff: 112154ns - 1389% slower
44+
microdiff: 7530ns - Fastest
45+
```
46+
47+
These benchmarks are currently only for one small object, so they might not be accurate. I will be working on creating benchmarks with more varying types.

0 commit comments

Comments
 (0)