changeset 613:5374955ec5b1

Demand-load most modules in the commands and ui modules. # HG changeset patch # User Bryan O'Sullivan <bos@serpentine.com> # Node ID 059c6e42fc4221816e26a72bef8cf780891989ca # Parent d2994b5298fb20f87dc1d4747635b280db3c0526 Demand-load most modules in the commands and ui modules. This improves response times for a number of simple commands, as the Python interpreter doesn't end up loading modules that it never uses. There's less benefit to demand-loading in other modules.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 04 Jul 2005 12:16:27 -0800
parents 9cd745437269
children 6bff574d639f
files mercurial/commands.py mercurial/ui.py
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Jul 04 12:15:44 2005 -0800
+++ b/mercurial/commands.py	Mon Jul 04 12:16:27 2005 -0800
@@ -5,11 +5,11 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import os, re, sys, signal
-import fancyopts, ui, hg, util
 from demandload import *
-demandload(globals(), "mdiff time hgweb traceback random signal")
-demandload(globals(), "socket errno version")
+demandload(globals(), "os re sys signal")
+demandload(globals(), "fancyopts ui hg util")
+demandload(globals(), "hgweb mdiff random signal time traceback")
+demandload(globals(), "errno socket version")
 
 class UnknownCommand(Exception): pass
 
--- a/mercurial/ui.py	Mon Jul 04 12:15:44 2005 -0800
+++ b/mercurial/ui.py	Mon Jul 04 12:16:27 2005 -0800
@@ -5,7 +5,9 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import os, sys, re, ConfigParser, util
+import os, ConfigParser
+from demandload import *
+demandload(globals(), "re socket sys util")
 
 class ui:
     def __init__(self, verbose=False, debug=False, quiet=False,