Don't iterate on the cache for every call to size
Merge pull request #266 from avishai-ish-shalom/issues/167

issue #167: Don't iterate on the cache for every call to size