D4502: util: allow lrucachedict to track cost of entries

2018-09-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGee087f0d7db5: util: allow lrucachedict to track cost of entries (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D4502: util: allow lrucachedict to track cost of entries

2018-09-08 Thread lothiraldan (Boris Feld)
lothiraldan added inline comments. INLINE COMMENTS > indygreg wrote in util.py:1277 > Good catch! I'll send a revised patch. > > FWIW, cost accounting on this data structure opens up a lot of potential > around caching on revlogs. I have some alpha-quality commits to replace the > full

D4502: util: allow lrucachedict to track cost of entries

2018-09-07 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 10832. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4502?vs=10821=10832 REVISION DETAIL https://phab.mercurial-scm.org/D4502 AFFECTED FILES contrib/perf.py mercurial/util.py tests/test-lrucachedict.py

D4502: util: allow lrucachedict to track cost of entries

2018-09-07 Thread indygreg (Gregory Szorc)
indygreg planned changes to this revision. indygreg added inline comments. INLINE COMMENTS > lothiraldan wrote in util.py:1277 > I'm not sure this line is tested, I didnd't see a test where we replace an > entry with an associated cost Good catch! I'll send a revised patch. FWIW, cost

D4502: util: allow lrucachedict to track cost of entries

2018-09-07 Thread lothiraldan (Boris Feld)
lothiraldan added inline comments. INLINE COMMENTS > util.py:1277 > if node is not None: > +self.totalcost -= node.cost > node.value = v I'm not sure this line is tested, I didnd't see a test where we replace an entry with an associated cost REPOSITORY rHG

D4502: util: allow lrucachedict to track cost of entries

2018-09-06 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Currently, lrucachedict allows tracking of arbitrary items with the only limit being the total number of items in the cache. Caches can be a lot more useful