only run crypto worker on half of available threads

This commit is contained in:
Florian Dold 2017-12-12 23:06:13 +01:00
parent 5a8d880ebd
commit ddec9cf2fa
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -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
}