public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin command line takes a long time to start
@ 2010-07-22 17:27 John Oliver
  2010-07-22 17:44 ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 13+ messages in thread
From: John Oliver @ 2010-07-22 17:27 UTC (permalink / raw)
  To: cygwin

After opening the Cygwin shell, I get the black box and a blinking
underscore for ten or fifteen seconds before the prompt appears.  How
would I go about figuring out what the delay is all about?

-- 
***********************************************************************
* John Oliver                             http://www.john-oliver.net/ *
*                                                                     *
***********************************************************************

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-22 17:27 Cygwin command line takes a long time to start John Oliver
@ 2010-07-22 17:44 ` Larry Hall (Cygwin)
  2010-07-22 18:45   ` John Oliver
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Hall (Cygwin) @ 2010-07-22 17:44 UTC (permalink / raw)
  To: cygwin

On 7/22/2010 1:14 PM, John Oliver wrote:
> After opening the Cygwin shell, I get the black box and a blinking
> underscore for ten or fifteen seconds before the prompt appears.  How
> would I go about figuring out what the delay is all about?

Are you running bash?  Have you installed the bash-completion package?

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-22 17:44 ` Larry Hall (Cygwin)
@ 2010-07-22 18:45   ` John Oliver
  2010-07-22 21:04     ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 13+ messages in thread
From: John Oliver @ 2010-07-22 18:45 UTC (permalink / raw)
  To: cygwin

On Thu, Jul 22, 2010 at 01:30:37PM -0400, Larry Hall (Cygwin) wrote:
> On 7/22/2010 1:14 PM, John Oliver wrote:
> >After opening the Cygwin shell, I get the black box and a blinking
> >underscore for ten or fifteen seconds before the prompt appears.  How
> >would I go about figuring out what the delay is all about?
> 
> Are you running bash?  Have you installed the bash-completion package?

Yes, and no.

-- 
***********************************************************************
* John Oliver                             http://www.john-oliver.net/ *
*                                                                     *
***********************************************************************

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-22 18:45   ` John Oliver
@ 2010-07-22 21:04     ` Larry Hall (Cygwin)
  2010-07-23  2:04       ` David Antliff
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Hall (Cygwin) @ 2010-07-22 21:04 UTC (permalink / raw)
  To: cygwin

On 7/22/2010 2:43 PM, John Oliver wrote:
> On Thu, Jul 22, 2010 at 01:30:37PM -0400, Larry Hall (Cygwin) wrote:
>> On 7/22/2010 1:14 PM, John Oliver wrote:
>>> After opening the Cygwin shell, I get the black box and a blinking
>>> underscore for ten or fifteen seconds before the prompt appears.  How
>>> would I go about figuring out what the delay is all about?
>>
>> Are you running bash?  Have you installed the bash-completion package?
>
> Yes, and no.

OK then the easiest thing to do is add "set -x" to your ~/.bash_profile
and watch where the delay happens as the statements scroll by.  This
should help you pinpoint it, assuming it's something Cygwin is doing
and not something Windows (or your environment is doing before bash
and Cygwin even starts).

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-22 21:04     ` Larry Hall (Cygwin)
@ 2010-07-23  2:04       ` David Antliff
  2010-07-23  2:16         ` Larry Hall (Cygwin)
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: David Antliff @ 2010-07-23  2:04 UTC (permalink / raw)
  To: cygwin

On Fri, Jul 23, 2010 at 07:49, Larry Hall (Cygwin) wrote:
> OK then the easiest thing to do is add "set -x" to your ~/.bash_profile
> and watch where the delay happens as the statements scroll by.

Ah, that's useful - I also have a 10-second-or-so delay when mintty
starts. By using a bunch of 'echo' commands and that set -x (which of
course extends the time, but at least makes it clear if anything is
'hanging') it's clear to me that the majority of the delay (about 6
seconds) happens before .bash_profile executes.

I am loading bash_completion and it does take about 5 seconds, but
that's the last thing to run before the prompt appears, and the delay
is happening before that.

How would one go about debugging the bash or mintty startup before
.bash_profile is read?

-- David.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-23  2:04       ` David Antliff
@ 2010-07-23  2:16         ` Larry Hall (Cygwin)
  2010-07-23  5:44         ` Andy Koppe
  2010-07-25 23:26         ` Csaba Raduly
  2 siblings, 0 replies; 13+ messages in thread
From: Larry Hall (Cygwin) @ 2010-07-23  2:16 UTC (permalink / raw)
  To: cygwin

On 7/22/2010 9:53 PM, David Antliff wrote:
> On Fri, Jul 23, 2010 at 07:49, Larry Hall (Cygwin) wrote:
>> OK then the easiest thing to do is add "set -x" to your ~/.bash_profile
>> and watch where the delay happens as the statements scroll by.
>
> Ah, that's useful - I also have a 10-second-or-so delay when mintty
> starts. By using a bunch of 'echo' commands and that set -x (which of
> course extends the time, but at least makes it clear if anything is
> 'hanging') it's clear to me that the majority of the delay (about 6
> seconds) happens before .bash_profile executes.
>
> I am loading bash_completion and it does take about 5 seconds, but
> that's the last thing to run before the prompt appears, and the delay
> is happening before that.
>
> How would one go about debugging the bash or mintty startup before
> .bash_profile is read?

This suggests to me that there are "things" in your Windows environment
that are slowing things down (network directories in your PATH,
<http://cygwin.com/acronyms/#BLODA>, etc.)  I'd look to things like
that before jumping into bash more.  If that's really not it, you
can try running bash under strace and look for calls that are taking
very significant time.  That may lead you to something that's a problem
though I expect it will be external again.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-23  2:04       ` David Antliff
  2010-07-23  2:16         ` Larry Hall (Cygwin)
@ 2010-07-23  5:44         ` Andy Koppe
  2010-07-23 13:19           ` Nellis, Kenneth
  2010-07-25 23:26         ` Csaba Raduly
  2 siblings, 1 reply; 13+ messages in thread
From: Andy Koppe @ 2010-07-23  5:44 UTC (permalink / raw)
  To: cygwin

On 23 July 2010 02:53, David Antliff wrote:
>> OK then the easiest thing to do is add "set -x" to your ~/.bash_profile
>> and watch where the delay happens as the statements scroll by.
>
> Ah, that's useful - I also have a 10-second-or-so delay when mintty
> starts. By using a bunch of 'echo' commands and that set -x (which of
> course extends the time, but at least makes it clear if anything is
> 'hanging') it's clear to me that the majority of the delay (about 6
> seconds) happens before .bash_profile executes.

Try the same with /etc/profile as well, after first backing it up.
Scripts in /etc/profile.d might be involved too.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: Cygwin command line takes a long time to start
  2010-07-23  5:44         ` Andy Koppe
@ 2010-07-23 13:19           ` Nellis, Kenneth
  0 siblings, 0 replies; 13+ messages in thread
From: Nellis, Kenneth @ 2010-07-23 13:19 UTC (permalink / raw)
  To: cygwin

> From: Andy Koppe
> On 23 July 2010 02:53, David Antliff wrote:
> >> OK then the easiest thing to do is add "set -x" to your
> ~/.bash_profile
> >> and watch where the delay happens as the statements scroll by.
> >
> > Ah, that's useful - I also have a 10-second-or-so delay when mintty
> > starts. By using a bunch of 'echo' commands and that set -x (which of
> > course extends the time, but at least makes it clear if anything is
> > 'hanging') it's clear to me that the majority of the delay (about 6
> > seconds) happens before .bash_profile executes.
> 
> Try the same with /etc/profile as well, after first backing it up.
> Scripts in /etc/profile.d might be involved too.
> 
> Andy

Another idea is to start bash with --noprofile to eliminate all profile
processing. 
http://www.gnu.org/software/bash/manual/bashref.html#Invoking-Bash
--Ken Nellis

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-23  2:04       ` David Antliff
  2010-07-23  2:16         ` Larry Hall (Cygwin)
  2010-07-23  5:44         ` Andy Koppe
@ 2010-07-25 23:26         ` Csaba Raduly
  2010-07-26  9:35           ` David Antliff
  2 siblings, 1 reply; 13+ messages in thread
From: Csaba Raduly @ 2010-07-25 23:26 UTC (permalink / raw)
  To: cygwin

On Fri, Jul 23, 2010 at 3:53 AM, David Antliff  wrote:
> How would one go about debugging the bash or mintty startup before
> .bash_profile is read?

Duplicate your shortcut which launches bash and add -x to the bash
options (which should include -l a.k.a. --login)
e.g.
C:\cygwin17\bin\mintty.exe -h error /usr/bin/bash --login -x

If using cygwin.bat, add -x after
bash --login -i


-- 
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-25 23:26         ` Csaba Raduly
@ 2010-07-26  9:35           ` David Antliff
  2010-07-27 17:45             ` Andy Koppe
  0 siblings, 1 reply; 13+ messages in thread
From: David Antliff @ 2010-07-26  9:35 UTC (permalink / raw)
  To: cygwin

On Mon, Jul 26, 2010 at 08:12, Csaba Raduly wrote:
> On Fri, Jul 23, 2010 at 3:53 AM, David Antliff  wrote:
>> How would one go about debugging the bash or mintty startup before
>> .bash_profile is read?
>
> Duplicate your shortcut which launches bash and add -x to the bash
> options (which should include -l a.k.a. --login)

Thanks everyone - using these tips I was able to determine that
bash_completion was actually running twice - once by
/etc/profile.d/bash_completion.sh, and again by my own .bash_profile,
which was modifying the path prior to invoking it so that apps in my
~/bin were picked up. I don't actually have anything useful in there
any more so it's really just a bunch of old stuff I brought over from
my Linux config.

I've tidied it up now. I now get the bash prompt after about 5
seconds, rather than 10. Disabling bash_completion completely gives me
a prompt in less than 1 second, but I do quite like bash_completion so
I'll live with that.

-- David.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-26  9:35           ` David Antliff
@ 2010-07-27 17:45             ` Andy Koppe
  2010-07-27 19:04               ` Eric Blake
  0 siblings, 1 reply; 13+ messages in thread
From: Andy Koppe @ 2010-07-27 17:45 UTC (permalink / raw)
  To: cygwin

On 26 July 2010 00:26, David Antliff wrote:
> Thanks everyone - using these tips I was able to determine that
> bash_completion was actually running twice - once by
> /etc/profile.d/bash_completion.sh, and again by my own .bash_profile,
> which was modifying the path prior to invoking it so that apps in my
> ~/bin were picked up. I don't actually have anything useful in there
> any more so it's really just a bunch of old stuff I brought over from
> my Linux config.
>
> I've tidied it up now. I now get the bash prompt after about 5
> seconds, rather than 10. Disabling bash_completion completely gives me
> a prompt in less than 1 second, but I do quite like bash_completion so
> I'll live with that.

FWIW, zsh with fancy completion enabled starts in one to two seconds
for me. Not suggesting that switching shell is an easy fix though.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-27 17:45             ` Andy Koppe
@ 2010-07-27 19:04               ` Eric Blake
  2010-08-25  3:29                 ` Andrey Repin
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Blake @ 2010-07-27 19:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]

On 07/27/2010 11:42 AM, Andy Koppe wrote:
> On 26 July 2010 00:26, David Antliff wrote:
>> Thanks everyone - using these tips I was able to determine that
>> bash_completion was actually running twice - once by
>> /etc/profile.d/bash_completion.sh, and again by my own .bash_profile,
>> which was modifying the path prior to invoking it so that apps in my
>> ~/bin were picked up. I don't actually have anything useful in there
>> any more so it's really just a bunch of old stuff I brought over from
>> my Linux config.
>>
>> I've tidied it up now. I now get the bash prompt after about 5
>> seconds, rather than 10. Disabling bash_completion completely gives me
>> a prompt in less than 1 second, but I do quite like bash_completion so
>> I'll live with that.
> 
> FWIW, zsh with fancy completion enabled starts in one to two seconds
> for me. Not suggesting that switching shell is an easy fix though.

Furthermore, upstream bash-completion developers are working on speeding
things up, by doing lazy loading (rather than loading all
program-specific completion handlers into memory at startup, they
trivially assign a global loader completion handler to all programs,
which then reassigns and runs the real loader for a given program the
first time you do tab-completion on that program); but it may require
support from bash 4.1 (I really need to find more time to get my bash
4.1 port to cygwin completed and posted).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Cygwin command line takes a long time to start
  2010-07-27 19:04               ` Eric Blake
@ 2010-08-25  3:29                 ` Andrey Repin
  0 siblings, 0 replies; 13+ messages in thread
From: Andrey Repin @ 2010-08-25  3:29 UTC (permalink / raw)
  To: Eric Blake, cygwin

Greetings, Eric Blake!

>>> Disabling bash_completion completely gives me a prompt in less than 1
>>> second, but I do quite like bash_completion so I'll live with that.

I was hit by the same bus... prompt was coming up painfully slow.
Granted, I don't really use the cygwin prompt daily and could live without the
completion package for now.


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 25.08.2010, <5:02>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-08-25  1:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22 17:27 Cygwin command line takes a long time to start John Oliver
2010-07-22 17:44 ` Larry Hall (Cygwin)
2010-07-22 18:45   ` John Oliver
2010-07-22 21:04     ` Larry Hall (Cygwin)
2010-07-23  2:04       ` David Antliff
2010-07-23  2:16         ` Larry Hall (Cygwin)
2010-07-23  5:44         ` Andy Koppe
2010-07-23 13:19           ` Nellis, Kenneth
2010-07-25 23:26         ` Csaba Raduly
2010-07-26  9:35           ` David Antliff
2010-07-27 17:45             ` Andy Koppe
2010-07-27 19:04               ` Eric Blake
2010-08-25  3:29                 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).