【发布时间】:2011-11-17 05:41:32
【问题描述】:
我的问题类似于
- Why does Cygwin execute shell commands very slowly?
- Cygwin's bash became extremely slow after errors
我认为我的问题是由另一个问题引起的。
以下是 Cygwin 中速度极慢的命令示例:
time for i in {1..10} ; do bash -c "echo Hello" ; done
Hello
...
real 0m21.588s
user 0m0.458s
sys 0m0.989s
这是什么原因造成的……但会是什么?
我尝试过的事情:
- 禁用 Windows 防火墙和 Windows 安全要素。
- 我没有任何其他防病毒产品。
- 我尝试杀死不同的用户进程,看看它们中的任何一个是否会产生干扰 - 没有运气。
- 我没有连接到任何网络。
- 如果我通过 windows
CMD运行C:\cygwin\bin中的命令,例如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)
如何进一步调试此问题?有人有什么想法吗?
【问题讨论】:
标签: performance bash windows-xp cygwin