script runs slower and slower when rev number increases

View: New views
3 Messages — Rating Filter:   Alert me  

script runs slower and slower when rev number increases

by weijun.wang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All

I write a shell script to call 'hg cat -r n filename'. n is in a range  
from 0 to 110000 and I'm sure that filename in a newly added file for  
changeset n. Therefore, I guess no matter how big n is, the command  
should not waste a lot of time, since it always prints out the first  
version of that file. The actual thing is, when n goes bigger, the  
command becomes very very slow. I change n to the changeset hex number  
but it's even slower.

Maybe hg always go into the changeset history to cat a file? Is there  
a way I can speed up the process?

Thanks
Max

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: script runs slower and slower when rev number increases

by Benoit Boissinot-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 29, 2009 at 9:25 AM, Max (Weijun) Wang <Weijun.Wang@...> wrote:
> Hi All

Hi Max,

>
> I write a shell script to call 'hg cat -r n filename'. n is in a range
> from 0 to 110000 and I'm sure that filename in a newly added file for
> changeset n. Therefore, I guess no matter how big n is, the command
> should not waste a lot of time, since it always prints out the first
> version of that file. The actual thing is, when n goes bigger, the
> command becomes very very slow. I change n to the changeset hex number
> but it's even slower.

Two things:
- if you describe what your high-level goal is, we could probably help
you (and write a python extension for that maybe)
- is it possible for you to find where the time is spent (with hg --profile)?

>
> Maybe hg always go into the changeset history to cat a file?
It does since it has to follow the chain changelog -> manifest -> filelog

> Is there a way I can speed up the process?

Maybe hg debugdata directly on the filelog (in .hg/store/data/...).

regards,

Benoit
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: script runs slower and slower when rev number increases

by Dirkjan Ochtman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 29, 2009 at 11:50, Benoit Boissinot <bboissin@...> wrote:
> It does since it has to follow the chain changelog -> manifest -> filelog

Still, it shouldn't be O(revs), right?

And, there should be much quicker ways to get the first version of
every file in the repo, if that's what you want.

Cheers,

Dirkjan
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial