Reduce the cache size

This commit is contained in:
Vishnu Mohandas 2020-06-12 22:23:23 +05:30
parent d5a896b284
commit 5639f3739a
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
import 'package:photos/models/photo.dart';
class ImageLruCache {
static LRUMap<int, File> _map = LRUMap(500);
static LRUMap<int, File> _map = LRUMap(25);
static File get(Photo photo) {
return _map.get(photo.hashCode);

View file

@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
import 'package:photos/models/photo.dart';
class ThumbnailLruCache {
static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(5000);
static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(1000);
static Uint8List get(Photo photo, int size) {
return _map.get(_ThumbnailCacheKey(photo, size));