1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Add sequentialize to prevent parralel loading of cipher keys (#7)

* Add sequentialize to prevent parralel loading of cipher keys

Massively improves start up performance of extensions

* Add tests for sequentialize

* Fix sequentialize as it was caching calls for all instances together

* Add sequentialize to the functions that have internal caches

* Adding sequentialize to getOrgKeys makes big performance difference

* Update cipher.service.ts

* Update collection.service.ts

* Update folder.service.ts
This commit is contained in:
Fred Cox
2018-07-23 21:23:30 +03:00
committed by Kyle Spearrin
parent 3a34d3b174
commit 04014a8e78
4 changed files with 197 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import { StorageService } from '../abstractions/storage.service';
import { ConstantsService } from './constants.service';
import { sequentialize } from '../misc/sequentialize';
import { Utils } from '../misc/utils';
const Keys = {
@@ -164,6 +165,7 @@ export class CryptoService implements CryptoServiceAbstraction {
return this.privateKey;
}
@sequentialize()
async getOrgKeys(): Promise<Map<string, SymmetricCryptoKey>> {
if (this.orgKeys != null && this.orgKeys.size > 0) {
return this.orgKeys;