LRU Sizing (#4872)

This commit is contained in:
Jaco
2022-05-30 08:36:28 +03:00
committed by GitHub
parent 6192e60668
commit a208cc9bb5
3 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Assuming all 1.5MB responses, we apply a default allowing for 576MB
// Assuming all 1.5MB responses, we apply a default allowing for 192MB
// cache space (depending on the historic queries this would vary, metadata
// for Kusama/Polkadot/Substrate falls between 600-750K, 2x for estimate)
const DEFAULT_CAPACITY = 384;
const DEFAULT_CAPACITY = 128;
class LRUNode {
public readonly key: string;
+1 -1
View File
@@ -300,7 +300,7 @@ export class WsProvider implements ProviderInterface {
const [id, body] = this.#coder.encodeJson(method, params);
let resultPromise: Promise<T> | null = isCacheable
? this.#callCache.get(body) as Promise<T>
? this.#callCache.get(body)
: null;
if (!resultPromise) {