You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-77Lines changed: 61 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,37 +6,33 @@ Performance benchmarks comparing different npm versions of the [AlaSQL](https://
6
6
7
7
This project uses [Bun](https://bun.sh/) 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.
8
8
9
-
## Versions Tested
10
-
11
-
64 versions across all major releases (sorted by semver):
-`NEXT` - Latest code from the AlaSQL develop branch
40
36
41
37
## Test Cases
42
38
@@ -49,96 +45,89 @@ This project uses [Bun](https://bun.sh/) to benchmark various AlaSQL versions ac
49
45
50
46
## Prerequisites
51
47
52
-
-[Bun](https://bun.sh/) runtime (recommended) or Node.js 18+
53
-
- npm or bun package manager
48
+
-[Bun](https://bun.sh/) runtime
49
+
- Git (for submodule management)
50
+
- npm or yarn
54
51
55
52
## Installation
56
53
57
54
```bash
55
+
# Clone with submodules
56
+
git clone --recurse-submodules <repo-url>
57
+
cd historical-performance
58
+
58
59
# Install dependencies
59
-
npm install
60
-
# or
61
60
bun install
61
+
# or
62
+
yarn install
62
63
```
63
64
64
65
## Usage
65
66
66
-
### Run Full Benchmark
67
+
### Benchmark A - Custom Implementation
68
+
69
+
Custom benchmark with detailed console output, summary tables, and markdown results.
67
70
68
71
```bash
69
-
bun run benchmark
72
+
yarn bench-a
70
73
```
71
74
72
-
### Run with Custom Cycles
73
-
75
+
With custom cycles:
74
76
```bash
75
-
bun run benchmark.ts --cycles 10 # Run 10 cycles per test
76
-
bun run benchmark.ts --cycles 100 # Run 100 cycles per test
77
+
yarn bench-a --cycles 10
77
78
```
78
79
79
-
### Run Directly with Bun
80
+
### Benchmark B - Bun Native
81
+
82
+
Uses Bun's native `bench`, `group`, and `run` functions for performance measurement.
80
83
81
84
```bash
82
-
bun run benchmark.ts
83
-
bun run benchmark.ts --cycles 25
85
+
yarn bench-b
84
86
```
85
87
86
-
The benchmark automatically includes the AlaSQL NEXT version by cloning and building the latest code from the [AlaSQL GitHub repository](https://github.com/AlaSQL/alasql).
87
-
88
88
## How It Works
89
89
90
+
### Version Management
91
+
90
92
The project uses npm aliasing to install multiple AlaSQL versions:
91
93
92
94
```json
93
95
{
94
96
"devDependencies": {
95
97
"alasql-0.3.10": "npm:alasql@0.3.10",
96
-
"alasql-0.4.12": "npm:alasql@0.4.12",
97
98
"alasql-4.10.1": "npm:alasql@4.10.1"
98
-
// ... 64 versions total
99
99
}
100
100
}
101
101
```
102
102
103
-
Each version can then be imported separately:
103
+
### NEXT Version
104
104
105
-
```typescript
106
-
importalasql0310from"alasql-0.3.10";
107
-
importalasql0412from"alasql-0.4.12";
108
-
importalasql4101from"alasql-4.10.1";
109
-
// ... etc
110
-
```
105
+
The NEXT version is managed as a git submodule pointing to the AlaSQL develop branch. The `build-next.sh` script handles:
111
106
112
-
## Sample Output
107
+
1. Updating the submodule to latest
108
+
2. Installing dependencies
109
+
3. Building the distribution
113
110
114
-
The benchmark produces formatted output showing performance metrics for each version (actual results will vary based on your machine):
0 commit comments