view mercurial/templates/map-cmdline.phases @ 23497:5817f71c2336

obsstore: disable garbage collection during initialization (issue4456) Python garbage collection is triggered by container creation. So code that creates a lot of tuples tends to trigger GC a lot. We disable the gc during obsolescence marker parsing and associated initialization. This provides an interesting speedup (25%). Load marker function on my 58758 markers repo: before: 0.468247 seconds after: 0.344362 seconds The benefit is a bit less visible overall. With python2.6 on my system I see: after: 0.60 before: 0.53 The difference is probably explained by the delaying of a costly GC. (but there is still a win). Marking involved tuples, lists and dicts as ignorable by the garbage collector should give us more benefit. But this is another adventure. Thanks goes to Siddharth Agarwal for the lead.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 26 Nov 2014 16:58:31 -0800
parents 66bf251ee672
children e810c7da1cae
line wrap: on
line source

# Base templates. Due to name clashes with existing keywords, we have
# to replace some keywords with 'lkeyword', for 'labelled keyword'
changeset = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{summary}\n'
changeset_quiet = '{node}'
changeset_verbose = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'

# File templates
lfiles = '{if(files,
               label("ui.note log.files",
                     "files:       {files}\n"))}'

lfile_mods = '{if(file_mods,
                  label("ui.debug log.files",
                        "files:       {file_mods}\n"))}'

lfile_adds = '{if(file_adds,
                  label("ui.debug log.files",
                        "files+:      {file_adds}\n"))}'

lfile_dels = '{if(file_dels,
                  label("ui.debug log.files",
                        "files-:      {file_dels}\n"))}'

lfile_copies_switch = '{if(file_copies_switch,
                           label("ui.note log.copies",
                                 "copies:     {file_copies_switch
                                               % ' {name} ({source})'}\n"))}'

# General templates
cset = '{label("log.changeset changeset.{phase}",
               "changeset:   {rev}:{node|short}")}\n'

lphase = '{label("log.phase",
                 "phase:       {phase}")}\n'

fullcset = '{label("log.changeset changeset.{phase}",
                   "changeset:   {rev}:{node}")}\n'

parent = '{label("log.parent changeset.{phase}",
                  "parent:      {rev}:{node|formatnode}")}\n'

node = '{label("log.node",
                "{rev}:{node|short}")}\n'

manifest = '{label("ui.debug log.manifest",
                   "manifest:    {rev}:{node}")}\n'

branch = '{label("log.branch",
                 "branch:      {branch}")}\n'

tag = '{label("log.tag",
              "tag:         {tag}")}\n'

bookmark = '{label("log.bookmark",
                   "bookmark:    {bookmark}")}\n'

user = '{label("log.user",
               "user:        {author}")}\n'

summary = '{label("log.summary",
                  "summary:     {desc|firstline}")}\n'

ldate = '{label("log.date",
                "date:        {date|date}")}\n'

extra = '{label("ui.debug log.extra",
                "extra:       {key}={value|stringescape}")}\n'

description = '{label("ui.note log.description",
                       "description:")}
               {label("ui.note log.description",
                       "{desc|strip}")}\n\n'