Skip to content

Commit 556a4d9

Browse files
committed
chore: hide max docs and mark experimental
1 parent abf2a3c commit 556a4d9

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

README.md

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const { bee } = require('bee-threads')
2727
// Run any function in a separate thread - promise style
2828
const result = await bee(x => x * 2)(21) // 42
2929

30-
// Non-blocking CPU-intensive operations
31-
const hash = await bee(pwd => require('crypto').pbkdf2Sync(pwd, 'salt', 100000, 64, 'sha512').toString('hex'))('password123')
32-
3330
// Run with Promise.all
3431
const [a, b, c] = await Promise.all([bee(x => x * 2)(21), bee(x => x + 1)(41), bee(() => 'hello')()])
3532
```
@@ -286,32 +283,6 @@ const { data, stats } = await beeThreads.turbo(arr).mapWithStats(x => x * x)
286283
console.log(stats.speedupRatio) // "7.2x"
287284
```
288285

289-
---
290-
291-
## ⚡ Max Mode - One Task uses All Available Threads
292-
293-
Uses **ALL threads including main thread** for maximum throughput. Same API as turbo, but ~15% faster.
294-
295-
```js
296-
// Same API as turbo
297-
const squares = await beeThreads.max(numbers).map(x => x * x)
298-
const evens = await beeThreads.max(numbers).filter(x => x % 2 === 0)
299-
const sum = await beeThreads.max(numbers).reduce((a, b) => a + b, 0)
300-
```
301-
302-
**Key difference:** Main thread processes data (blocking) while coordinating workers.
303-
304-
| Feature | `turbo()` | `max()` |
305-
|---------|-----------|---------|
306-
| Main thread blocked | No | Yes |
307-
| Throughput | Good | Best (~15% faster) |
308-
| Use in HTTP servers | Yes | Depends |
309-
| Use in CLI/batch jobs | Yes | Best choice |
310-
311-
> **Auto-fallback:** Arrays < 10K items use single-worker mode.
312-
313-
---
314-
315286
## Request Coalescing
316287

317288
Prevents duplicate simultaneous calls from running multiple times. When the same function with identical arguments is called while a previous call is in-flight, subsequent calls share the same Promise.
@@ -468,10 +439,9 @@ const stream = beeThreads
468439
- **Large array processing** (turbo mode)
469440
- **Matrix operations** (turbo mode)
470441
- **Numerical simulations** (turbo mode)
471-
- **Batch processing servers** (max mode) - Dedicated processing servers
472-
- **Data pipelines** (max mode) - ETL, data transformation
473-
- **Video/image encoding services** (max mode) - Maximum throughput
474-
- **Scientific computing** (max mode) - CPU-intensive analysis
442+
- Data pipelines
443+
- Video/image encoding services
444+
- Scientific computing
475445

476446
---
477447

@@ -484,7 +454,6 @@ const stream = beeThreads
484454
- **Worker affinity** - Same function → same worker (V8 JIT)
485455
- **Request coalescing** - Deduplicates identical calls
486456
- **Turbo mode** - Parallel array processing (workers only)
487-
- **Max mode** - Maximum throughput (workers + main thread)
488457
- **Full TypeScript** - Complete type definitions
489458

490459
---

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ export const beeThreads = {
433433
},
434434

435435
/**
436+
* @experimental
436437
* Creates a MaxExecutor for maximum throughput parallel processing.
437438
*
438439
* MAX MODE uses ALL CPU cores including the main thread for processing.

src/turbo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ export interface MaxOptions extends TurboOptions {
872872
}
873873

874874
/**
875+
* @experimental
875876
* Creates a TurboExecutor that includes the main thread in processing.
876877
* Uses ALL available CPU cores including the main thread.
877878
*

0 commit comments

Comments
 (0)