mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
3ed8d7b512
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
21 lines
540 B
Python
Executable File
21 lines
540 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from __future__ import absolute_import, print_function
|
|
|
|
from hgext3rd import traceprof
|
|
from mercurial import ui
|
|
|
|
import os
|
|
import sys
|
|
|
|
if __name__ == '__main__':
|
|
sys.argv = sys.argv[1:]
|
|
if not sys.argv:
|
|
print("usage: traceprof.py <script> <arguments...>", file=sys.stderr)
|
|
sys.exit(2)
|
|
sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])))
|
|
u = ui.ui()
|
|
u.setconfig('traceprof', 'timethreshold', 0)
|
|
with traceprof.profile(u, sys.stderr):
|
|
execfile(sys.argv[0])
|