我的问题类似于
我认为我的问题是由不同的问题引起的。
以下是Cygwin中极慢命令的示例:
time for i in {1..10} ; do bash -c "echo Hello" ; done
Hello
...
real 0m21.588s
user 0m0.458s
sys 0m0.989s
有什么事情导致这种情况......但它可能是什么?
我尝试过的事情:
C:\cygwin\bin
在CMD
中运行命令,例如C:\cygwin\bin\ls.exe
,他们仍然慢。然后我尝试运行此命令以更好地了解发生了什么:
strace -o bash.strace bash -c "echo hello"
从我所看到的,有一行占90%的时间:
(如果不清楚它是以1028210开头的行 - 我为上下文包含了其他行)
5 5 [main] bash 1088 open_shared: name shared.5, n 5, shared 0x60FB0000 (wanted 0x60FB0000), h 0x74C
208 213 [main] bash 1088 heap_init: heap base 0x530000, heap top 0x530000
118 331 [main] bash 1088 open_shared: name S-1-5-21-2025429265-1957994488-1801674531-1003.1, n 1, shared 0x60FC0000 (wanted 0x60FC0000), h 0x748
85 416 [main] bash 1088 user_info::create: opening user shared for 'S-1-5-21-2025429265-1957994488-1801674531-1003' at 0x60FC0000
83 499 [main] bash 1088 user_info::create: user shared version 6112AFB3
344 843 [main] bash 1088 dll_crt0_0: finished dll_crt0_0 initialization
283 1126 [main] bash 1088 _cygtls::remove: wait 0xFFFFFFFF
87 1213 [main] bash 1088 _cygtls::remove: removed 0x23CE64 element 0
104 1317 [main] bash 1088 _cygtls::remove: wait 0xFFFFFFFF
70 1387 [main] bash 1088 _cygtls::remove: removed 0x23CE64 element 0
102 1489 [main] bash 1088 _cygtls::remove: wait 0xFFFFFFFF
70 1559 [main] bash 1088 _cygtls::remove: removed 0x23CE64 element 0
110 1669 [main] bash 1088 _cygtls::remove: wait 0xFFFFFFFF
70 1739 [main] bash 1088 _cygtls::remove: removed 0x23CE64 element 0
781 2520 [main] bash 1088 _cygtls::remove: wait 0xFFFFFFFF
76 2596 [main] bash 1088 _cygtls::remove: removed 0x23CE64 element 0
278 2874 [sig] bash 1088 wait_sig: entering ReadFile loop, my_readsig 0x72C, my_sendsig 0x728
1028210 1031084 [main] bash 1088 mount_info::conv_to_posix_path: conv_to_posix_path (C:\cygwin\home\Adam, no-keep-rel, no-add-slash)
107 1031191 [main] bash 1088 normalize_win32_path: C:\cygwin\home\Adam = normalize_win32_path (C:\cygwin\home\Adam)
59 1031250 [main] bash 1088 mount_info::conv_to_posix_path: /home/Adam = conv_to_posix_path (C:\cygwin\home\Adam)
11535 1042785 [main] bash 1088 _cygwin_istext_for_stdio: fd 0: not open
69 1042854 [main] bash 1088 _cygwin_istext_for_stdio: fd 1: not open
62 1042916 [main] bash 1088 _cygwin_istext_for_stdio: fd 2: not open
360 1043276 [main] bash (1088) open_shared: name cygpid.1088, n 1088, shared 0x60FE0000 (wanted 0x60FE0000), h 0x678
65 1043341 [main] bash 1088 **********************************************
46 1043387 [main] bash 1088 Program name: C:\cygwin\bin\bash.exe (pid 1088, ppid 1)
46 1043433 [main] bash 1088 App version: 1007.7, api: 0.230
45 1043478 [main] bash 1088 DLL version: 1007.9, api: 0.237
46 1043524 [main] bash 1088 DLL build: 2011-03-29 10:10
51 1043575 [main] bash 1088 OS version: Windows NT-5.1
45 1043620 [main] bash 1088 Heap size: 402653184
45 1043665 [main] bash 1088 **********************************************
45 1043710 [main] bash 1088 pinfo::thisproc: myself->dwProcessId 1088
50 1043760 [main] bash 1088 time: 1321506515 = time (0)
862 1044622 [main] bash 1088 parse_options: glob (called func)
78 1044700 [main] bash 1088 parse_options: returning
45 1044745 [main] bash 1088 environ_init: GetEnvironmentStrings returned 0x10000
...
我真的不明白违规行可能提到的问题:
mount_info::conv_to_posix_path: conv_to_posix_path (C:\cygwin\home\Adam, no-keep-rel, no-add-slash)
如何进一步调试此问题?有没有人有任何想法?
答案 0 :(得分:3)
自从更新到最新的Cygwin(v2.769)以来,这不是一个问题。 (以前我用的是v2.738)
在2.769下,相同的命令可以提供更好的结果:
$ time for i in {1..10} ; do bash -c "echo Hello" ; done
Hello
...
real 0m0.641s
user 0m0.379s
sys 0m0.506s
Cygwin仍然比我想要的慢 - 我主要将它用于git和vim,而且这两者都比它们的本地对手慢得多。
但现在至少可以使用它了。
答案 1 :(得分:1)
这似乎是一个相同的场景:
http://cygwin.com/ml/cygwin/2011-08/msg00080.html
将您的帖子添加到Cygwin故障报告列表中可能没什么坏处。也许你也可以在Cygwin论坛上发帖。