Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dancastillo/string-comparison-benchmark
https://github.com/dancastillo/string-comparison-benchmark
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dancastillo/string-comparison-benchmark
- Owner: dancastillo
- Created: 2024-06-07T02:21:45.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T02:57:05.000Z (7 months ago)
- Last Synced: 2024-06-07T03:48:14.109Z (7 months ago)
- Language: JavaScript
- Size: 98.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# String Comparison Benchmark
String comparison benchmark for method lookup
---
## Requirements
You will only need [Node.js](https://github.com/nodejs/node) and [hyperfine](https://github.com/sharkdp/hyperfine) optional
### Installation
- #### Node installation
Follow instruction [here](https://nodejs.org/en/download/package-manager)
- #### hyperfine installation
```bash
$ brew install hyperfine
```## Usage
```bash
$ git clone https://github.com/dancastillo/string-comparison-benchmark
$ cd string-comparison-benchmark
```## Running tests
Run and print out console.time for each method
```bash
$ npm run compare:test
```Run with hyperfine
```bash
$ npm run compare:hyperfine
```## Results
Results with `npm run compare:test`
Winner: `set`
![results-1](./assets/compare-time.png)
Results with `npm run compare:hyperfine`
Winner: `switch`
![results-1](./assets/compare-hyperfine.png)