From aaea86066d6dc82f0baac99d7b7aeafe3f52b3d5 Mon Sep 17 00:00:00 2001 From: James Cameron Date: Sat, 6 Jan 2018 15:01:00 +1100 Subject: [PATCH] Icon - increase LRU cache sizes Some activities suffer from performance penalties once the number of icons backed by SVGs exceeds 50. Double the cache sizes. Tested on OLPC XO-1, the weakest known system on which Sugar is used. --- src/sugar3/graphics/icon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py index 71354e2a..06883728 100644 --- a/src/sugar3/graphics/icon.py +++ b/src/sugar3/graphics/icon.py @@ -113,7 +113,7 @@ _BADGE_SIZE = 0.45 class _SVGLoader(object): def __init__(self): - self._cache = LRU(50) + self._cache = LRU(100) def load(self, file_name, entities, cache): if file_name in self._cache: @@ -156,7 +156,7 @@ class _BadgeInfo(object): class _IconBuffer(object): - _surface_cache = LRU(50) + _surface_cache = LRU(100) _loader = _SVGLoader() def __init__(self):