aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-12 23:06:13 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-12 23:06:13 +0100
commitddec9cf2faa774fd12a3b9cc0f1414198e52baa8 (patch)
treea1d7e56a7072973857001ce2db22c6439cfa092a /src
parent5a8d880ebd53d6436e78c9f242d20bfa3f50b8b8 (diff)
only run crypto worker on half of available threads
Diffstat (limited to 'src')
-rw-r--r--src/crypto/cryptoApi.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/crypto/cryptoApi.ts b/src/crypto/cryptoApi.ts
index 9a21d13a9..12b1c9708 100644
--- a/src/crypto/cryptoApi.ts
+++ b/src/crypto/cryptoApi.ts
@@ -203,6 +203,7 @@ export class CryptoApi {
// only works in the browser
// tslint:disable-next-line:no-string-literal
concurrency = (navigator as any)["hardwareConcurrency"];
+ concurrency = Math.max(1, Math.ceil(concurrency / 2));
} catch (e) {
// ignore
}