Performance benchmarks comparing different npm versions of the AlaSQL library.
This project uses Bun to benchmark various AlaSQL versions across a range of SQL operations, from simple queries to complex aggregations. It uses npm aliasing to install multiple versions of AlaSQL simultaneously.
64 versions across all major releases (sorted by semver):
0.3.10,0.4.12,0.5.10,0.6.7,0.7.1
1.7.4,1.7.5
2.1.4,2.1.6,2.1.7,2.1.8,2.2.1,2.2.5,2.3.0,2.5.0,2.5.1,2.5.3,2.5.4
3.0.0,3.1.0,3.1.1
4.0.0,4.0.2,4.0.4,4.0.5,4.0.64.1.0,4.1.1,4.1.2,4.1.3,4.1.4,4.1.5,4.1.7,4.1.8,4.1.9,4.1.10,4.1.114.2.1,4.2.2,4.2.3,4.2.4,4.2.5,4.2.6,4.2.74.3.0,4.3.1,4.3.2,4.3.34.4.04.5.0,4.5.1,4.5.24.6.0,4.6.1,4.6.2,4.6.3,4.6.4,4.6.5,4.6.64.7.0,4.8.0,4.9.04.10.0,4.10.1
- Simple SELECT (100 rows) - Basic
SELECT *query on a small dataset - WHERE Filtering (1000 rows) - SELECT with WHERE clause filtering
- JOIN Operation (1000 users, 5000 orders) - INNER JOIN between two tables
- GROUP BY with Aggregations - GROUP BY with COUNT, SUM, and AVG functions
- Subquery Operation - SELECT with subquery for filtering
- Complex Query (ORDER BY, LIMIT) - Complex aggregation with ORDER BY and LIMIT on large dataset
- Bun runtime (recommended) or Node.js 18+
- npm or bun package manager
# Install dependencies
npm install
# or
bun installbun run benchmarkbun run benchmark:quickbun run benchmark.ts
bun run benchmark.ts --quickThe project uses npm aliasing to install multiple AlaSQL versions:
{
"devDependencies": {
"alasql-0.3.10": "npm:[email protected]",
"alasql-0.4.12": "npm:[email protected]",
"alasql-4.10.1": "npm:[email protected]"
// ... 64 versions total
}
}Each version can then be imported separately:
import alasql0310 from 'alasql-0.3.10';
import alasql0412 from 'alasql-0.4.12';
import alasql4101 from 'alasql-4.10.1';
// ... etcThe benchmark produces formatted output showing performance metrics for each version (actual results will vary based on your machine):
╔══════════════════════════════════════════════════════════════════════════════╗
║ AlaSQL Historical Performance Benchmark ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Mode: Quick ║
║ Iterations per test: 10 ║
║ Versions: 0.3.10, 0.4.12, ... 4.10.0, 4.10.1 ║
╚══════════════════════════════════════════════════════════════════════════════╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Test: Simple SELECT (100 rows)
Basic SELECT * query on a small dataset of 100 rows
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ v0.3.10 │ 448.67µs │ 22.29K ops/s
✅ v0.4.12 │ 373.20µs │ 26.80K ops/s
...
✅ v4.10.1 │ 501.28µs │ 19.95K ops/s
🏆 Best: v0.4.12 (26.80K ops/s)
To add a new AlaSQL version to benchmark:
-
Add it to
package.json:"alasql-X.Y.Z": "npm:[email protected]"
-
Import it in
benchmark.ts:import alasqlXYZ from 'alasql-X.Y.Z';
-
Add it to the
versionsarray:{ name: 'alasql-X.Y.Z', version: 'X.Y.Z', alasql: alasqlXYZ as AlaSQLInstance },
-
Run
npm installorbun installand then run the benchmark.
MIT