mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:56:07 -04:00
Use sortedcontainers instead of blist
This commit drop-in replaces blist with SortedContainers. They are written in pure python so work with pypy, but perform as good as native implementations, at least in a couple benchmarks: http://www.grantjenks.com/docs/sortedcontainers/performance.html
This commit is contained in:
parent
a3599dda97
commit
9fbe70a7dc
3 changed files with 10 additions and 10 deletions
|
@ -16,7 +16,7 @@
|
|||
from synapse.util.caches import register_cache, CACHE_SIZE_FACTOR
|
||||
|
||||
|
||||
from blist import sorteddict
|
||||
from sortedcontainers import SortedDict
|
||||
import logging
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ class StreamChangeCache(object):
|
|||
def __init__(self, name, current_stream_pos, max_size=10000, prefilled_cache={}):
|
||||
self._max_size = int(max_size * CACHE_SIZE_FACTOR)
|
||||
self._entity_to_key = {}
|
||||
self._cache = sorteddict()
|
||||
self._cache = SortedDict()
|
||||
self._earliest_known_stream_pos = current_stream_pos
|
||||
self.name = name
|
||||
self.metrics = register_cache(self.name, self._cache)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue