From 63fd87612ea5a9e158762d6e68c401c4331d2803 Mon Sep 17 00:00:00 2001 From: Marc Diaz Date: Fri, 13 Mar 2026 17:32:20 -0400 Subject: [PATCH] feat(gif-worker): increase amount of web workers based on hardwareconcurrecy --- src/lib/exporter/gifExporter.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/exporter/gifExporter.ts b/src/lib/exporter/gifExporter.ts index 983a377..36f5758 100644 --- a/src/lib/exporter/gifExporter.ts +++ b/src/lib/exporter/gifExporter.ts @@ -122,9 +122,10 @@ export class GifExporter { // Initialize GIF encoder // Loop: 0 = infinite loop, 1 = play once (no loop) const repeat = this.config.loop ? 0 : 1; - + const cores = navigator.hardwareConcurrency || 4; + const WORKER_COUNT = Math.max(1, Math.min(8, cores - 1)); this.gif = new GIF({ - workers: 4, + workers: WORKER_COUNT, quality: 10, width: this.config.width, height: this.config.height,