Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolcn committed Apr 22, 2020
1 parent fe8bdc6 commit c8e3e34
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cpf-wasm"
version = "0.1.1"
version = "0.2.3"
authors = ["Pedro Nascimento <[email protected]>"]
edition = "2018"

Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CPF-WASM
# cpf-wasm

Probably the fastest node cpf validation lib out there.
The fastest node cpf validation lib out there.
Written in rust, compiled to WASM

## Installation
Expand All @@ -25,7 +25,22 @@ isValid('11111111111')

## Benchmarks

coming soon
A synthetic load of validating 10 million cpfs was ran in order to benchmark our lib against the most popular cpf validation libs on npm.
The libs we benchmarked against were:
- [cpf](https://npmjs.com/package/cpf)
- [@fnando/cpf](https://npmjs.com/package/@fnando/cpf)
- [cpf-check](https://npmjs.com/package/cpf-check)

The results obtained show that `cpf-wasm` is at least 1.53 X faster than other libs performing the same task

| lib | time | ratio |
|:_____________|:__________:|:________:|
| **cpf-wasm** | **9.23s** | **1.00** |
| cpf | 19.02s | 2.06 |
| @fnando/cpf | 14.10s | 1.53 |
| cpf-check | 20.33s | 2.20 |

benchmark code can be found at the `benchmark` folder

## Was this really necessary?
Probably not
Expand Down

0 comments on commit c8e3e34

Please sign in to comment.