Skip to content

AlaSQL/historical-performance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlaSQL Historical Performance

Performance benchmarks comparing different npm versions of the AlaSQL library.

Overview

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.

Versions Tested

64 versions across all major releases (sorted by semver):

0.x Series

  • 0.3.10, 0.4.12, 0.5.10, 0.6.7, 0.7.1

1.x Series

  • 1.7.4, 1.7.5

2.x Series

  • 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.x Series

  • 3.0.0, 3.1.0, 3.1.1

4.x Series

  • 4.0.0, 4.0.2, 4.0.4, 4.0.5, 4.0.6
  • 4.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.11
  • 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.2.5, 4.2.6, 4.2.7
  • 4.3.0, 4.3.1, 4.3.2, 4.3.3
  • 4.4.0
  • 4.5.0, 4.5.1, 4.5.2
  • 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.6.4, 4.6.5, 4.6.6
  • 4.7.0, 4.8.0, 4.9.0
  • 4.10.0, 4.10.1

Test Cases

  1. Simple SELECT (100 rows) - Basic SELECT * query on a small dataset
  2. WHERE Filtering (1000 rows) - SELECT with WHERE clause filtering
  3. JOIN Operation (1000 users, 5000 orders) - INNER JOIN between two tables
  4. GROUP BY with Aggregations - GROUP BY with COUNT, SUM, and AVG functions
  5. Subquery Operation - SELECT with subquery for filtering
  6. Complex Query (ORDER BY, LIMIT) - Complex aggregation with ORDER BY and LIMIT on large dataset

Prerequisites

  • Bun runtime (recommended) or Node.js 18+
  • npm or bun package manager

Installation

# Install dependencies
npm install
# or
bun install

Usage

Run Full Benchmark

bun run benchmark

Run Quick Benchmark (fewer iterations)

bun run benchmark:quick

Run Directly with Bun

bun run benchmark.ts
bun run benchmark.ts --quick

How It Works

The 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';
// ... etc

Sample Output

The 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)

Adding New Versions

To add a new AlaSQL version to benchmark:

  1. Add it to package.json:

    "alasql-X.Y.Z": "npm:[email protected]"
  2. Import it in benchmark.ts:

    import alasqlXYZ from 'alasql-X.Y.Z';
  3. Add it to the versions array:

    { name: 'alasql-X.Y.Z', version: 'X.Y.Z', alasql: alasqlXYZ as AlaSQLInstance },
  4. Run npm install or bun install and then run the benchmark.

License

MIT

About

Historical performance for the AlaSQL lib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •