bun-image-turbo 1.0.2-beta → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -39
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -20,50 +20,57 @@ High-performance image processing for Bun and Node.js, built with Rust and napi-
|
|
|
20
20
|
|
|
21
21
|
Tested on Apple M1 Pro with Bun 1.3.3 (compared to sharp v0.34.5):
|
|
22
22
|
|
|
23
|
-
###
|
|
24
|
-
| Operation | bun-image-turbo | sharp | Speedup |
|
|
25
|
-
|-----------|-----------------|-------|---------|
|
|
26
|
-
| 1MB JPEG Metadata | 0.003ms | 0.1ms | **38x faster** |
|
|
27
|
-
| 10MB JPEG Metadata | 0.003ms | 0.1ms | **37x faster** |
|
|
28
|
-
| 10MB WebP Metadata | 0.003ms | 3.0ms | **950x faster** |
|
|
23
|
+
### Performance Summary
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
```
|
|
26
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
27
|
+
│ bun-image-turbo vs sharp Performance │
|
|
28
|
+
├─────────────────────────────────────────────────────────────────────────────┤
|
|
29
|
+
│ Metadata Extraction ████████████████████████████████████ 36x faster │
|
|
30
|
+
│ Transform Pipeline ████████████████████ 3.4x faster │
|
|
31
|
+
│ Concurrent (50 ops) ██████████████████████████ 4.5x faster │
|
|
32
|
+
│ JPEG Encode ██████████████ 1.9x faster │
|
|
33
|
+
│ Thumbnail Resize ████████████ 1.9x faster │
|
|
34
|
+
│ Blurhash Generation ████████████████████ (4,283 ops/sec) N/A in sharp │
|
|
35
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
36
|
+
```
|
|
37
37
|
|
|
38
|
-
###
|
|
39
|
-
| Operation | bun-image-turbo | sharp | Speedup |
|
|
40
|
-
|-----------|-----------------|-------|---------|
|
|
41
|
-
| 1MB JPEG → WebP | 37.1ms | 45.8ms | **1.23x faster** |
|
|
42
|
-
| 10MB JPEG → WebP | 114.9ms | 119.3ms | **1.04x faster** |
|
|
38
|
+
### Detailed Benchmarks (ops/sec - higher is better)
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
|
40
|
+
| Operation | bun-image-turbo | sharp | Winner |
|
|
41
|
+
|-----------|---------------:|------:|:------:|
|
|
42
|
+
| **Metadata Extraction** | 350,000 ops/sec | 9,600 ops/sec | **36x faster** |
|
|
43
|
+
| **Transform Pipeline** | 454 ops/sec | 134 ops/sec | **3.4x faster** |
|
|
44
|
+
| **JPEG Encode** | 553 ops/sec | 287 ops/sec | **1.9x faster** |
|
|
45
|
+
| **Thumbnail (200px)** | 386 ops/sec | 201 ops/sec | **1.9x faster** |
|
|
46
|
+
| **PNG Encode** | 235 ops/sec | 221 ops/sec | **1.06x faster** |
|
|
47
|
+
| **Blurhash** | 4,283 ops/sec | N/A | - |
|
|
49
48
|
|
|
50
49
|
### Concurrent Operations (High Load)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
|
|
51
|
+
| Concurrency | bun-image-turbo | sharp | Throughput |
|
|
52
|
+
|------------:|----------------:|------:|:----------:|
|
|
53
|
+
| 50 parallel | 30ms total | 137ms total | **4.5x faster** |
|
|
54
|
+
| **Ops/sec** | **1,653 ops/sec** | 364 ops/sec | - |
|
|
55
|
+
|
|
56
|
+
### Real-World File Tests
|
|
57
|
+
|
|
58
|
+
| Operation | bun-image-turbo | sharp | Speedup |
|
|
59
|
+
|-----------|---------------:|------:|:-------:|
|
|
60
|
+
| 1MB JPEG Metadata | 0.003ms | 0.10ms | **36x faster** |
|
|
61
|
+
| 1MB JPEG Transform | 25.3ms | 30.5ms | **1.2x faster** |
|
|
62
|
+
| 10MB JPEG Metadata | 0.003ms | 0.10ms | **37x faster** |
|
|
63
|
+
|
|
64
|
+
### Key Strengths
|
|
65
|
+
|
|
66
|
+
- **36x faster** metadata extraction (header-only parsing)
|
|
67
|
+
- **4.5x faster** under concurrent load (server workloads)
|
|
68
|
+
- **3.4x faster** transform pipelines (resize + rotate + grayscale)
|
|
69
|
+
- **1.9x faster** JPEG encoding with TurboJPEG (libjpeg-turbo SIMD)
|
|
70
|
+
- Built-in **Blurhash** generation (4,283 ops/sec)
|
|
71
|
+
- Zero-copy buffer handling with Rust
|
|
72
|
+
|
|
73
|
+
> Run benchmarks yourself: `bun run bench`
|
|
67
74
|
|
|
68
75
|
## Installation
|
|
69
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-image-turbo",
|
|
3
|
-
"version": "1.0.2
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "High-performance image processing for Bun and Node.js - resize, convert, compress with WebP, AVIF, PNG, JPEG support",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"typescript": "^5.9.0"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"bun-image-turbo-darwin-arm64": "1.0.2
|
|
93
|
-
"bun-image-turbo-darwin-x64": "1.0.2
|
|
94
|
-
"bun-image-turbo-linux-arm64-gnu": "1.0.2
|
|
95
|
-
"bun-image-turbo-linux-x64-gnu": "1.0.2
|
|
96
|
-
"bun-image-turbo-linux-x64-musl": "1.0.2
|
|
97
|
-
"bun-image-turbo-win32-arm64-msvc": "1.0.2
|
|
98
|
-
"bun-image-turbo-win32-x64-msvc": "1.0.2
|
|
92
|
+
"bun-image-turbo-darwin-arm64": "1.0.2",
|
|
93
|
+
"bun-image-turbo-darwin-x64": "1.0.2",
|
|
94
|
+
"bun-image-turbo-linux-arm64-gnu": "1.0.2",
|
|
95
|
+
"bun-image-turbo-linux-x64-gnu": "1.0.2",
|
|
96
|
+
"bun-image-turbo-linux-x64-musl": "1.0.2",
|
|
97
|
+
"bun-image-turbo-win32-arm64-msvc": "1.0.2",
|
|
98
|
+
"bun-image-turbo-win32-x64-msvc": "1.0.2"
|
|
99
99
|
}
|
|
100
100
|
}
|