Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imertz/bun-sqlite-benchmark
A high-performance benchmark tool built with Bun:sqlite, designed to measure and compare the speed of insert and select operations on large datasets.
https://github.com/imertz/bun-sqlite-benchmark
benchmark bun sqlite3
Last synced: about 1 month ago
JSON representation
A high-performance benchmark tool built with Bun:sqlite, designed to measure and compare the speed of insert and select operations on large datasets.
- Host: GitHub
- URL: https://github.com/imertz/bun-sqlite-benchmark
- Owner: imertz
- Created: 2024-08-14T19:42:40.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T15:23:27.000Z (6 months ago)
- Last Synced: 2024-10-31T03:06:04.475Z (3 months ago)
- Topics: benchmark, bun, sqlite3
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bun:sqlite Benchmark
This project is a performance benchmark for SQLite operations using Bun, a fast all-in-one JavaScript runtime. It measures the speed of insert and select operations, with and without an index, on a large number of records.
## Features
- Inserts and selects a large number of records (default: 1,000,000)
- Compares performance with and without an index on the email column
- Uses worker threads for parallel processing
- Provides detailed performance metrics## Prerequisites
- [Bun](https://bun.sh) v1.1.24 or later
## Installation
1. Clone this repository:
```bash
git clone https://github.com/yourusername/bun-sqlite-benchmark.git
cd bun-sqlite-benchmark
```## Usage
To run the benchmark:
```bash
bun run benchmark
```This will execute the benchmark and display the results in the console.
## Configuration
You can modify the following constants in `bun-sqlite-benchmark.js` to adjust the benchmark parameters:
- `NUM_RECORDS`: Number of records to insert (default: 1,000,000)
- `NUM_WORKERS`: Number of worker threads to use (default: number of CPU cores)
- `BATCH_SIZE`: Number of records to insert in a single transaction (default: 100)
- `LOG_INTERVAL`: Interval for logging progress (default: 100,000 records)
- `MAX_SELECT_TIME`: Maximum time for select operations (default: 10 seconds)## Results
The benchmark will output performance metrics for insert and select operations, both with and without an index on the email column. It will also calculate the speedup percentage for select operations when using an index.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is open source and available under the [MIT License](LICENSE).