bun-image-turbo 1.0.2-beta → 1.0.3

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.
Files changed (2) hide show
  1. package/README.md +50 -39
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -3,7 +3,11 @@
3
3
  High-performance image processing for Bun and Node.js, built with Rust and napi-rs.
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/bun-image-turbo.svg)](https://www.npmjs.com/package/bun-image-turbo)
6
+ [![Build & Publish](https://github.com/nexus-aissam/bun-image-turbo/actions/workflows/build.yml/badge.svg)](https://github.com/nexus-aissam/bun-image-turbo/actions/workflows/build.yml)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
9
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
10
+ [![Bun](https://img.shields.io/badge/Bun-1.0+-orange.svg)](https://bun.sh/)
7
11
 
8
12
  ## Features
9
13
 
@@ -20,50 +24,57 @@ High-performance image processing for Bun and Node.js, built with Rust and napi-
20
24
 
21
25
  Tested on Apple M1 Pro with Bun 1.3.3 (compared to sharp v0.34.5):
22
26
 
23
- ### Metadata Extraction
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** |
27
+ ### Performance Summary
29
28
 
30
- ### JPEG Resize (Real-world thumbnail generation)
31
- | Operation | bun-image-turbo | sharp | Speedup |
32
- |-----------|-----------------|-------|---------|
33
- | 1MB JPEG → 800px | 12.4ms | 20.0ms | **1.61x faster** |
34
- | 1MB JPEG → 400px | 9.9ms | 12.3ms | **1.24x faster** |
35
- | 1MB JPEG → 200px | 8.7ms | 10.5ms | **1.20x faster** |
36
- | 10MB JPEG → 800px | 96.9ms | 102.5ms | **1.06x faster** |
29
+ ```
30
+ ┌─────────────────────────────────────────────────────────────────────────────┐
31
+ │ bun-image-turbo vs sharp Performance │
32
+ ├─────────────────────────────────────────────────────────────────────────────┤
33
+ Metadata Extraction ████████████████████████████████████ 36x faster
34
+ Transform Pipeline ████████████████████ 3.4x faster
35
+ Concurrent (50 ops) ██████████████████████████ 4.5x faster
36
+ │ JPEG Encode ██████████████ 1.9x faster │
37
+ │ Thumbnail Resize ████████████ 1.9x faster │
38
+ │ Blurhash Generation ████████████████████ (4,283 ops/sec) N/A in sharp │
39
+ └─────────────────────────────────────────────────────────────────────────────┘
40
+ ```
37
41
 
38
- ### Format Conversion
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** |
42
+ ### Detailed Benchmarks (ops/sec - higher is better)
43
43
 
44
- ### Complex Transform Pipeline
45
- | Operation | bun-image-turbo | sharp | Speedup |
46
- |-----------|-----------------|-------|---------|
47
- | Resize + Grayscale | 11.9ms | 18.1ms | **1.53x faster** |
48
- | Resize + Rotate + Grayscale | 12.3ms | 19.3ms | **1.57x faster** |
44
+ | Operation | bun-image-turbo | sharp | Winner |
45
+ |-----------|---------------:|------:|:------:|
46
+ | **Metadata Extraction** | 350,000 ops/sec | 9,600 ops/sec | **36x faster** |
47
+ | **Transform Pipeline** | 454 ops/sec | 134 ops/sec | **3.4x faster** |
48
+ | **JPEG Encode** | 553 ops/sec | 287 ops/sec | **1.9x faster** |
49
+ | **Thumbnail (200px)** | 386 ops/sec | 201 ops/sec | **1.9x faster** |
50
+ | **PNG Encode** | 235 ops/sec | 221 ops/sec | **1.06x faster** |
51
+ | **Blurhash** | 4,283 ops/sec | N/A | - |
49
52
 
50
53
  ### Concurrent Operations (High Load)
51
- | Concurrency | bun-image-turbo | sharp | Speedup |
52
- |-------------|-----------------|-------|---------|
53
- | 10 parallel | 16ms | 30ms | **1.85x faster** |
54
- | 25 parallel | 42ms | 82ms | **1.96x faster** |
55
- | 50 parallel | 67ms | 156ms | **2.33x faster** |
56
- | 100 parallel | 129ms | 303ms | **2.34x faster** |
57
-
58
- **Key Strengths:**
59
- - **950x faster** metadata extraction (header-only parsing)
60
- - **2.3x faster** under concurrent load
61
- - **1.6x faster** for thumbnail generation
62
- - **1.5x faster** for transform pipelines
63
- - Built-in **blurhash** generation
64
- - Uses **TurboJPEG** (libjpeg-turbo) with SIMD acceleration
65
-
66
- > Run benchmarks yourself: `bun run benchmarks/final_comparison.ts`
54
+
55
+ | Concurrency | bun-image-turbo | sharp | Throughput |
56
+ |------------:|----------------:|------:|:----------:|
57
+ | 50 parallel | 30ms total | 137ms total | **4.5x faster** |
58
+ | **Ops/sec** | **1,653 ops/sec** | 364 ops/sec | - |
59
+
60
+ ### Real-World File Tests
61
+
62
+ | Operation | bun-image-turbo | sharp | Speedup |
63
+ |-----------|---------------:|------:|:-------:|
64
+ | 1MB JPEG Metadata | 0.003ms | 0.10ms | **36x faster** |
65
+ | 1MB JPEG Transform | 25.3ms | 30.5ms | **1.2x faster** |
66
+ | 10MB JPEG Metadata | 0.003ms | 0.10ms | **37x faster** |
67
+
68
+ ### Key Strengths
69
+
70
+ - **36x faster** metadata extraction (header-only parsing)
71
+ - **4.5x faster** under concurrent load (server workloads)
72
+ - **3.4x faster** transform pipelines (resize + rotate + grayscale)
73
+ - **1.9x faster** JPEG encoding with TurboJPEG (libjpeg-turbo SIMD)
74
+ - Built-in **Blurhash** generation (4,283 ops/sec)
75
+ - Zero-copy buffer handling with Rust
76
+
77
+ > Run benchmarks yourself: `bun run bench`
67
78
 
68
79
  ## Installation
69
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-image-turbo",
3
- "version": "1.0.2-beta",
3
+ "version": "1.0.3",
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-beta",
93
- "bun-image-turbo-darwin-x64": "1.0.2-beta",
94
- "bun-image-turbo-linux-arm64-gnu": "1.0.2-beta",
95
- "bun-image-turbo-linux-x64-gnu": "1.0.2-beta",
96
- "bun-image-turbo-linux-x64-musl": "1.0.2-beta",
97
- "bun-image-turbo-win32-arm64-msvc": "1.0.2-beta",
98
- "bun-image-turbo-win32-x64-msvc": "1.0.2-beta"
92
+ "bun-image-turbo-darwin-arm64": "1.0.3",
93
+ "bun-image-turbo-darwin-x64": "1.0.3",
94
+ "bun-image-turbo-linux-arm64-gnu": "1.0.3",
95
+ "bun-image-turbo-linux-x64-gnu": "1.0.3",
96
+ "bun-image-turbo-linux-x64-musl": "1.0.3",
97
+ "bun-image-turbo-win32-arm64-msvc": "1.0.3",
98
+ "bun-image-turbo-win32-x64-msvc": "1.0.3"
99
99
  }
100
100
  }