cache __len__ in memory storage