From ede8f43635c37a05b72f250632d0b236a2709ca9 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:52:12 +0000 Subject: [performance] temporarily cache account status counts to reduce no. account counts (#2620) * temporarily cache account status counts to reduce no. account counts * whoops, forgot to initAccountCounts() * use already fetched cache capacity value * make cache a ptr type * whoops, use count instead of just select * fix to correctly use the transaction * properly wrap that tx :innocent: * correctly wrap both tx types * outline retryOnBusy() to allow the fast path to be inlined * return err on context cancelled * remove unnecessary storage of context in stmt, fix Exec and Query interface implementations * shutup linter --- internal/cache/cache.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/cache/cache.go') diff --git a/internal/cache/cache.go b/internal/cache/cache.go index a278336ae..17fa03323 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -51,6 +51,7 @@ func (c *Caches) Init() { log.Infof(nil, "init: %p", c) c.initAccount() + c.initAccountCounts() c.initAccountNote() c.initApplication() c.initBlock() -- cgit v1.2.3