Commit Graph

4 Commits

Author SHA1 Message Date
Egon Elbre
5e954ad487 satellite/metainfo/metabase: optimize ConvertAliasesToPieces
old time/op    new time/op    delta
    7.56µs ± 5%    4.93µs ± 2%  -34.75%  (p=0.000 n=5+15)

  old alloc/op   new alloc/op   delta
    6.86kB ± 0%    3.85kB ± 0%  -43.87%  (p=0.000 n=5+18)

  old allocs/op  new allocs/op  delta
      19.0 ± 0%      17.0 ± 0%  -10.53%  (p=0.000 n=5+18)

Change-Id: Iedf24087766b3bd90934f2daa7ac186c3503a341
2021-03-10 08:39:23 +00:00
Egon Elbre
61f0fb67a9 satellite/metainfo/metabase: refresh alias cache only once
When there are concurrent refreshes to the cache and the entries are
missing, it could end up causing multiple database calls, even though
only one is needed.

Change-Id: I1ae7a124bbdd1570473cf3a032d375d2f25a8426
2021-02-17 10:00:04 +00:00
Egon Elbre
d0a7ab60ec satellite/metainfo/metabase: add NodeAliasCache
This implements a node alias cache that automatically refreshes
and adds new nodes when needed.

Change-Id: I4af121f7307b7b7ac4f87ad465f02d4eeb17d42f
2021-02-08 11:36:03 +02:00
Egon Elbre
0260966de4 satellite/metainfo/metabase: add NodeAliasMap
We need to keep an inmemory cache to avoid lookups into aliases table.
This adds the inmemory state of the cache.

Change-Id: Ief2b9bb19e10b46839b9208472dfc3035eb49af3
2021-02-08 10:28:22 +02:00