(lineDiffType: "none" | "word-alt")
| 8 | } |
| 9 | |
| 10 | function createPool(lineDiffType: "none" | "word-alt") { |
| 11 | const pool = new WorkerPoolManager( |
| 12 | { |
| 13 | workerFactory, |
| 14 | // poolSize defaults to 8. More workers = more parallelism but |
| 15 | // also more memory. Too many can actually slow things down. |
| 16 | // NOTE: 2 is probably better for OpenCode, as I think 8 might be |
| 17 | // a bit overkill, especially because Safari has a significantly slower |
| 18 | // boot up time for workers |
| 19 | poolSize: 2, |
| 20 | }, |
| 21 | { |
| 22 | theme: "OpenCode", |
| 23 | lineDiffType, |
| 24 | preferredHighlighter: "shiki-wasm", |
| 25 | }, |
| 26 | ) |
| 27 | |
| 28 | void pool.initialize() |
| 29 | return pool |
| 30 | } |
| 31 | |
| 32 | let unified: WorkerPoolManager | undefined |
| 33 | let split: WorkerPoolManager | undefined |
no test coverage detected