Faster startup by moving code out of commands.py?

Steve Borho steve at borho.org
Mon May 9 11:16:51 CDT 2011


On Mon, May 9, 2011 at 12:25 AM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
> On Sun, May 1, 2011 at 5:36 PM, Matt Mackall <mpm at selenic.com> wrote:
>>
>> On Sun, 2011-05-01 at 10:26 -0500, Steve Borho wrote:
>> > On Sun, May 1, 2011 at 9:49 AM, Peter Arrenbrecht
>> > <peter.arrenbrecht at gmail.com> wrote:
>> > > Just a wild idea we had at the sprint: Maybe we could speed up hg by
>> > > moving most of the code out of commands.py into separate files. Then
>> > > each command would only have to parse code that it actually needs. And
>> > > the command table could be filled with things that point to which file
>> > > to load and which function to call in it.
>> > >
>> > > Would also help with structuring the stuff in commands.py a bit.
>> >
>> > +1
>> >
>> > I've had similar thoughts in the past, breaking commands.py into commands/
>>
>> Let's see some timings.
>
> As a quick experiment I replaced all of the bodies in commands.py with
> pass. Doesn't pay off.

There's still a case to be made for not having a four thousand line source file

-- 
Steve Borho


More information about the Mercurial-devel mailing list