##// END OF EJS Templates
bookmarks: cache reverse mapping (issue5868)...
bookmarks: cache reverse mapping (issue5868) I chose a simpler implementation. If the initial cost of building reverse mapping is significant, we'll have to move it under @propertycache. The nodemap could be a dict of sets, but I think keeping a sorted list is better since each node is likely to have zero/one bookmark. Micro-benchmark with 1001 bookmarks and 1001 revisions: $ for n in `seq 0 1000`; do touch $n; hg book book$n; hg ci -qAm$n; done $ hg bookmarks --time > /dev/null (orig) time: real 0.040 secs (user 0.050+0.000 sys 0.000+0.000) (new) time: real 0.040 secs (user 0.040+0.000 sys 0.010+0.000) $ hg log -T '{bookmarks}\n' --time > /dev/null (orig) time: real 0.160 secs (user 0.160+0.000 sys 0.000+0.000) (new) time: real 0.090 secs (user 0.100+0.000 sys 0.000+0.000)

File last commit:

r35674:c9eb92fb default
r37869:04ceb267 @26 default
Show More
showstack.py
22 lines | 596 B | text/x-python | PythonLexer
Matt Mackall
contrib: add showstack extension...
r26123 # showstack.py - extension to dump a Python stack trace on signal
#
# binds to both SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs)
Boris Feld
showstack: add an extension docstring...
r35674 """dump stack trace when receiving SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs)
"""
Matt Mackall
contrib: add showstack extension...
r26123
Pulkit Goyal
showstack: use absolute_import
r28522 from __future__ import absolute_import
import signal
import sys
import traceback
Matt Mackall
contrib: add showstack extension...
r26123
def sigshow(*args):
sys.stderr.write("\n")
traceback.print_stack(args[1], limit=10, file=sys.stderr)
sys.stderr.write("----\n")
def extsetup(ui):
signal.signal(signal.SIGQUIT, sigshow)
try:
signal.signal(signal.SIGINFO, sigshow)
except AttributeError:
pass