[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATH] * trampvar.el.in (tramp-repository-branch, tramp-repository-v
From: |
Lin Sun |
Subject: |
Re: [PATH] * trampvar.el.in (tramp-repository-branch, tramp-repository-version): Avoid to call git for initializing the variables |
Date: |
Sat, 27 Jul 2024 14:57:15 +0000 |
Hi Michael,
I tested your patch in my local, it works for me.
Thank you !
On Sat, Jul 27, 2024 at 8:25 AM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Lin Sun <sunlin7.mail@gmail.com> writes:
>
> > Hi,
>
> Hi Lin,
>
> > The tramp is extremely slow on windows, and I found that tramp in
> > emacs will call git 4 times on startup.
> >
> > In the emacs-release package, the `tramp-loaddefs.el` has the copy of
> > tramp-repository-branch, tramp-repository-version (these two variables
> > are marked as autoload), it will call git to initialize their values;
> > and when requiring the `trampvar.el`, these two variables will be
> > initialize with calling git again. That will call git 4 times.
> >
> > This patch tries to avoid these calls, improving the performance a lot.
>
> Thanks for the heads-up!
>
> > Please help review the patch. Thanks.
>
> Well, the patch computes the constants tramp-repository-branch and
> tramp-repository-version at compile time. The results might be wrong,
> when Tramp is not compiled but interpreted.
>
> I've applioed another change, that Tramp does not call git from
> tramp-loaddefs.el. This reduces the git calls to two times. Pushed to
> the repositories.
>
> Could you pls check, whether this makes a (sufficient) difference for you?
>
> > Lin
>
> Best regards, Michael.