Commit Graph

2 Commits

Author SHA1 Message Date
Jun Wu
3ed8d7b512 smartlog: add a simple ancestor cache
Summary:
`revlog.ancestor` is expensive on long changelog, but is only called a few
(about 30) times for smartlog usage. Therefore we could simply cache the
result in a key-value database.

This speeds up smartlog by about 200ms.

Test Plan: Added a new test

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: stash, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5135746

Signature: t1:5135746:1495783503:411260551fd29fda42c9fc809b56f8f77fb2eaf4
2017-05-26 09:03:58 -07:00
Jun Wu
c64d830714 traceprof: add a standalone script to trace other scripts
Summary:
Like other profilers in Mercurial, provide a standalone script to measure
performance of other scripts directly.

Test Plan: Run the new script to profile ipython and it works.

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5112547

Signature: t1:5112547:1495562125:0d15b48b3aa9e6ead43fbb8166dabf13b6273ef2
2017-05-23 11:49:20 -07:00