* Vim responds too slow on the latest snapshot of cygwin1.dll @ 2016-06-05 15:33 Takashi Yano 2016-06-06 8:43 ` Corinna Vinschen 0 siblings, 1 reply; 10+ messages in thread From: Takashi Yano @ 2016-06-05 15:33 UTC (permalink / raw) To: cygwin Hello, everyone. I tested the latest snapshot of cygwin1.dll, and noticed that vim editor respond too slow on it. When I open some file with vim, the text appears after a few seconds. ^F and ^B keys also update the screen very slowly. I tried to bisect the problem, and found that this problem occurs after : commit e5665d8c930485d5ac6d8913573e27b9e5043d92 Author: John Hood <cgull@glup.org> Date: Wed May 18 19:14:17 2016 -0400 Improve and simplify select(). * select.h: Eliminate redundant select_stuff::select_loop state. * select.cc (select): Eliminate redundant select_stuff::select_loop state. Eliminate redundant code for zero timeout. Do not return early on early timer return. (select_stuff::wait): Eliminate redundant select_stuff::select_loop state. I hope this problem will be fixed before release. -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-05 15:33 Vim responds too slow on the latest snapshot of cygwin1.dll Takashi Yano @ 2016-06-06 8:43 ` Corinna Vinschen 2016-06-06 11:06 ` Takashi Yano 0 siblings, 1 reply; 10+ messages in thread From: Corinna Vinschen @ 2016-06-06 8:43 UTC (permalink / raw) To: cygwin; +Cc: John Hood [-- Attachment #1: Type: text/plain, Size: 1613 bytes --] On Jun 6 00:33, Takashi Yano wrote: > Hello, everyone. > > I tested the latest snapshot of cygwin1.dll, and > noticed that vim editor respond too slow on it. > > When I open some file with vim, the text appears > after a few seconds. ^F and ^B keys also update > the screen very slowly. This is what is being discussed in the thread starting at https://cygwin.com/ml/cygwin/2016-05/msg00327.html Just as John I can't reproduce this. What OS version do you run this on, and is it 32, 32 under WOW64, or 64 bit? > I tried to bisect the problem, and found that this > problem occurs after : > > commit e5665d8c930485d5ac6d8913573e27b9e5043d92 > Author: John Hood <cgull@glup.org> > Date: Wed May 18 19:14:17 2016 -0400 > > Improve and simplify select(). > > * select.h: Eliminate redundant select_stuff::select_loop state. > * select.cc (select): Eliminate redundant > select_stuff::select_loop state. Eliminate redundant code for > zero timeout. Do not return early on early timer return. > (select_stuff::wait): Eliminate redundant > select_stuff::select_loop state. > > I hope this problem will be fixed before release. Me, too, especially since we're going to have to release 2.5.2 this week. If we don't have a solution I'll revert this patch for 2.5.2 and we can reapply and improve it for 2.6 then. Of course it would be nicer to have a fix :} Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 8:43 ` Corinna Vinschen @ 2016-06-06 11:06 ` Takashi Yano 2016-06-06 13:50 ` Chris Sutcliffe 0 siblings, 1 reply; 10+ messages in thread From: Takashi Yano @ 2016-06-06 11:06 UTC (permalink / raw) To: cygwin Hi Corinna, > Just as John I can't reproduce this. What OS version do you run this > on, and is it 32, 32 under WOW64, or 64 bit? OS: Windows 7 (64bit) Cygwin: Both 32bit and 64bit I have tested on two Win7 machines, and the problem occurs on both machines. Further, this problem occurs in Windows 7, but does not occur in Windows 10, as far as I tested. Can you possibly test on Win7 machine? On Mon, 6 Jun 2016 10:43:28 +0200 Corinna Vinschen wrote: > On Jun 6 00:33, Takashi Yano wrote: > > Hello, everyone. > > > > I tested the latest snapshot of cygwin1.dll, and > > noticed that vim editor respond too slow on it. > > > > When I open some file with vim, the text appears > > after a few seconds. ^F and ^B keys also update > > the screen very slowly. > > This is what is being discussed in the thread starting at > https://cygwin.com/ml/cygwin/2016-05/msg00327.html > > Just as John I can't reproduce this. What OS version do you run this > on, and is it 32, 32 under WOW64, or 64 bit? > > > I tried to bisect the problem, and found that this > > problem occurs after : > > > > commit e5665d8c930485d5ac6d8913573e27b9e5043d92 > > Author: John Hood <cgull@glup.org> > > Date: Wed May 18 19:14:17 2016 -0400 > > > > Improve and simplify select(). > > > > * select.h: Eliminate redundant select_stuff::select_loop state. > > * select.cc (select): Eliminate redundant > > select_stuff::select_loop state. Eliminate redundant code for > > zero timeout. Do not return early on early timer return. > > (select_stuff::wait): Eliminate redundant > > select_stuff::select_loop state. > > > > I hope this problem will be fixed before release. > > Me, too, especially since we're going to have to release 2.5.2 this week. > > If we don't have a solution I'll revert this patch for 2.5.2 and we can > reapply and improve it for 2.6 then. Of course it would be nicer to > have a fix :} > > > Thanks, > Corinna > > -- > Corinna Vinschen Please, send mails regarding Cygwin to > Cygwin Maintainer cygwin AT cygwin DOT com > Red Hat -- Takashi Yano <takashi.yano@nifty.ne.jp> -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 11:06 ` Takashi Yano @ 2016-06-06 13:50 ` Chris Sutcliffe 2016-06-06 14:52 ` Corinna Vinschen 0 siblings, 1 reply; 10+ messages in thread From: Chris Sutcliffe @ 2016-06-06 13:50 UTC (permalink / raw) To: The Cygwin Mailing List On 6 June 2016 at 07:05, Takashi Yano wrote: > >> Just as John I can't reproduce this. What OS version do you run this >> on, and is it 32, 32 under WOW64, or 64 bit? > > OS: Windows 7 (64bit) > Cygwin: Both 32bit and 64bit > > I have tested on two Win7 machines, and the problem > occurs on both machines. > > Further, this problem occurs in Windows 7, but does > not occur in Windows 10, as far as I tested. > > Can you possibly test on Win7 machine? I can confirm that I see this behaviour on 64bit Windows 7 running 64bit Cygwin using the newly released snapshot (06/06/16). If there is anything I can do to assist with debugging the issue please let me know. Thanks, Chris -- Chris Sutcliffe -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 13:50 ` Chris Sutcliffe @ 2016-06-06 14:52 ` Corinna Vinschen 2016-06-06 16:15 ` Chris Sutcliffe ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Corinna Vinschen @ 2016-06-06 14:52 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1370 bytes --] On Jun 6 09:50, Chris Sutcliffe wrote: > On 6 June 2016 at 07:05, Takashi Yano wrote: > > > >> Just as John I can't reproduce this. What OS version do you run this > >> on, and is it 32, 32 under WOW64, or 64 bit? > > > > OS: Windows 7 (64bit) > > Cygwin: Both 32bit and 64bit > > > > I have tested on two Win7 machines, and the problem > > occurs on both machines. > > > > Further, this problem occurs in Windows 7, but does > > not occur in Windows 10, as far as I tested. > > > > Can you possibly test on Win7 machine? > > I can confirm that I see this behaviour on 64bit Windows 7 running > 64bit Cygwin using the newly released snapshot (06/06/16). If there > is anything I can do to assist with debugging the issue please let me > know. Thanks for the offer. I could actually reproduce it on a W7 32 bit machine. I found the problem and fixed it. While I was at it, I improved the timer handling in select_stuff::wait a bit. What I'd *really* need now is people testing the latest snapshot on https://cygwin.com/snapshots/ ASAP and throw at it what they can think of. Is there still a regression compared to 2.5.1? If so, please report. Thanks to all of you, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 14:52 ` Corinna Vinschen @ 2016-06-06 16:15 ` Chris Sutcliffe 2016-06-07 12:38 ` Takashi Yano 2016-06-08 1:21 ` John Hood 2 siblings, 0 replies; 10+ messages in thread From: Chris Sutcliffe @ 2016-06-06 16:15 UTC (permalink / raw) To: The Cygwin Mailing List On 6 June 2016 at 10:52, Corinna Vinschen wrote: > What I'd *really* need now is people testing the latest snapshot on > https://cygwin.com/snapshots/ ASAP and throw at it what they can think > of. Is there still a regression compared to 2.5.1? If so, please > report. Testing the latest snapshot has shown that the issue is fixed. I'll give the test release a spin once it gets populated to the mirrors. Thanks! Chris -- Chris Sutcliffe -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 14:52 ` Corinna Vinschen 2016-06-06 16:15 ` Chris Sutcliffe @ 2016-06-07 12:38 ` Takashi Yano 2016-06-07 13:12 ` Corinna Vinschen 2016-06-08 1:21 ` John Hood 2 siblings, 1 reply; 10+ messages in thread From: Takashi Yano @ 2016-06-07 12:38 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 1398 bytes --] Hi Corinna, I have tested the latest (2016-06-06) snapshot. No problem is found. I evaluated the response of vim in several environments using a test case attached. This test case measures the time for (open a file + scroll up/down 100 times + quit) in vim. Results are as follows. The latest snapshot is the fastest! It's 13% faster than 2.5.1. You did it! Machine1: Windows 7 (64bit) + Cygwin 64bit cygwin 2.5.1 : 1.035133 second snapshot (2016-05-31): 58.479826 second snapshot (2016-06-06): 0.898675 second Machine1: Windows 7 (64bit) + Cygwin 32bit cygwin 2.5.1 : 1.242907 second snapshot (2016-05-31): 57.491763 second snapshot (2016-06-06): 0.911885 second Machine2: Windows 7 (64bit) + Cygwin 64bit cygwin 2.5.1 : 0.688432 second snapshot (2016-05-31): 462.305977 second snapshot (2016-06-06): 0.596733 second Machine2: Windows 7 (64bit) + Cygwin 32bit cygwin 2.5.1 : 0.761117 second snapshot (2016-05-31): 462.280320 second snapshot (2016-06-06): 0.660631 second Machine2: Windows 10 (64bit) + Cygwin 64bit cygwin 2.5.1 : 0.676545 second snapshot (2016-05-31): 0.599878 second snapshot (2016-06-06): 0.599495 second Machine2: Windows 10 (64bit) + Cygwin 32bit cygwin 2.5.1 : 0.784049 second snapshot (2016-05-31): 0.675585 second snapshot (2016-06-06): 0.675050 second -- Takashi Yano <takashi.yano@nifty.ne.jp> [-- Attachment #2: pty_vim.c --] [-- Type: text/x-csrc, Size: 3366 bytes --] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pty.h> #include <fcntl.h> #include <sys/wait.h> #include <sys/select.h> #include <sys/ioctl.h> #include <errno.h> #include <sys/time.h> #include <time.h> int master; void winsize_set(void) { struct winsize win; ioctl(fileno(stdin), TIOCGWINSZ, &win); ioctl(master, TIOCSWINSZ, &win); } void sig_handler(int sig) { switch (sig) { case SIGWINCH: winsize_set(); break; case SIGCHLD: { struct termios tt; tcgetattr(fileno(stdout), &tt); tt.c_oflag |= OPOST; tt.c_lflag |= ECHO|ICANON|ISIG; tt.c_iflag |= IXON; tcsetattr(fileno(stdout), TCSANOW, &tt); } /* printf("Child Terminated.\n"); */ break; } } int write_all(int fd, char *buf, int len) { int cnt = 0; char *p = buf; while (len > cnt) { int ret = write(fd, p+cnt, len-cnt); if (ret < 0) return ret; cnt += ret; } return cnt; } int automate_vim() { int pm, ps; pid_t pid; if (openpty(&pm, &ps, NULL, NULL, NULL) < 0) { perror("openpty()"); exit(-1); } master = pm; /* for signal handler */ { /* Disable echo */ struct termios tt; tcgetattr(ps, &tt); tt.c_lflag &= ~ECHO; tcsetattr(ps, TCSANOW, &tt); } pid = fork(); if (pid<0) { perror("fork()"); close(pm); exit(-1); } if (pid != 0) { /* Parent */ close(ps); { /* Setup STDIN and STDOUT */ struct termios tt; tcgetattr(fileno(stdout), &tt); tt.c_oflag &= ~OPOST; tcsetattr(fileno(stdout), TCSANOW, &tt); tcgetattr(fileno(stdin), &tt); tt.c_lflag &= ~(ECHO|ICANON|ISIG); tt.c_iflag &= ~IXON; tcsetattr(fileno(stdin), TCSANOW, &tt); } signal(SIGWINCH, sig_handler); signal(SIGCHLD, sig_handler); winsize_set(); { /* Send commands to vim */ int i; write(pm, "1G", 2); /* Goto first line */ for (i=0; i<100; i++) { write(pm, "\006\002", 2); /* Scroll up and down */ } write(pm, ":q!\n", 4); /* Quit */ } /* Process Input and Output */ for (;;) { fd_set rdfds; int nfd; int r; FD_ZERO(&rdfds); FD_SET(pm, &rdfds); FD_SET(fileno(stdin), &rdfds); nfd = ((pm > fileno(stdin))? pm : fileno(stdin) ) + 1; r = select(nfd, &rdfds, NULL, NULL, NULL); if (r<0 && errno == EINTR) { /* if ( waitpid(pid, NULL, WNOHANG) == pid) break; */ continue; } if (r<=0) { perror("select()"); close(pm); exit(-1); } if (r) { char buf[BUFSIZ]; int len; if (FD_ISSET(pm, &rdfds)) { len = read(pm, buf, BUFSIZ); if (len<=0) break; if (len > 0) { len = write_all(fileno(stdout), buf, len); if (len<=0) break; } } if (FD_ISSET(fileno(stdin), &rdfds)) { len = read(fileno(stdin), buf, BUFSIZ); if (len<=0) break; len = write_all(pm, buf, len); if (len<=0) break; } } } wait(NULL); close(pm); } else { /* Child */ close(pm); setsid(); ioctl(ps, TIOCSCTTY, 0); dup2(ps, fileno(stdin)); dup2(ps, fileno(stdout)); dup2(ps, fileno(stderr)); close(ps); execl("/usr/bin/vim", "vim", "pty_vim.c", NULL); perror("execl()"); exit(-1); } return 0; } int main() { struct timespec tv0, tv1; clock_gettime(CLOCK_MONOTONIC, &tv0); automate_vim(); clock_gettime(CLOCK_MONOTONIC, &tv1); printf("Total: %f second\n", (tv1.tv_sec - tv0.tv_sec) + (tv1.tv_nsec - tv0.tv_nsec)*1e-9); return 0; } [-- Attachment #3: Type: text/plain, Size: 218 bytes --] -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-07 12:38 ` Takashi Yano @ 2016-06-07 13:12 ` Corinna Vinschen 0 siblings, 0 replies; 10+ messages in thread From: Corinna Vinschen @ 2016-06-07 13:12 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 710 bytes --] On Jun 7 21:37, Takashi Yano wrote: > Hi Corinna, > > I have tested the latest (2016-06-06) snapshot. No problem is found. > > I evaluated the response of vim in several environments using a test > case attached. This test case measures the time for > (open a file + scroll up/down 100 times + quit) > in vim. > > Results are as follows. > > The latest snapshot is the fastest! It's 13% faster than 2.5.1. > > You did it! > [...] Thanks! I'd alsdo like to thank John Hood who did the groundwork for improving select(2). Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-06 14:52 ` Corinna Vinschen 2016-06-06 16:15 ` Chris Sutcliffe 2016-06-07 12:38 ` Takashi Yano @ 2016-06-08 1:21 ` John Hood 2016-06-08 9:00 ` Corinna Vinschen 2 siblings, 1 reply; 10+ messages in thread From: John Hood @ 2016-06-08 1:21 UTC (permalink / raw) To: cygwin It has taken way too long to get a usable Win7 VM set up, but I can confirm that the 2.5.2.0.1 snapshot works well on Win7 with my test programs and fixes the issues noted in Corinna's commits, and is somewhat faster than 2.5.1. The snapshot's issues with Win7 were also worse than others have reported, I saw select() locking up and not responding to either timeout or events. Definitely something that should not have reached a release. I'll apologize for the bugs, they're clearly regressions from what I had done. I think I introduced bugs when I reworked the commits to eliminate changes to cygwait.h, and didn't test sufficiently (I'd migrated both my Win7 machines to Win10). regards, --jh On 06/06/2016 10:52, Corinna Vinschen wrote: > On Jun 6 09:50, Chris Sutcliffe wrote: >> On 6 June 2016 at 07:05, Takashi Yano wrote: >>>> Just as John I can't reproduce this. What OS version do you run this >>>> on, and is it 32, 32 under WOW64, or 64 bit? >>> OS: Windows 7 (64bit) >>> Cygwin: Both 32bit and 64bit >>> >>> I have tested on two Win7 machines, and the problem >>> occurs on both machines. >>> >>> Further, this problem occurs in Windows 7, but does >>> not occur in Windows 10, as far as I tested. >>> >>> Can you possibly test on Win7 machine? >> I can confirm that I see this behaviour on 64bit Windows 7 running >> 64bit Cygwin using the newly released snapshot (06/06/16). If there >> is anything I can do to assist with debugging the issue please let me >> know. > Thanks for the offer. I could actually reproduce it on a W7 32 bit > machine. I found the problem and fixed it. While I was at it, I > improved the timer handling in select_stuff::wait a bit. > > What I'd *really* need now is people testing the latest snapshot on > https://cygwin.com/snapshots/ ASAP and throw at it what they can think > of. Is there still a regression compared to 2.5.1? If so, please > report. > > > Thanks to all of you, > Corinna > -- 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] 10+ messages in thread
* Re: Vim responds too slow on the latest snapshot of cygwin1.dll 2016-06-08 1:21 ` John Hood @ 2016-06-08 9:00 ` Corinna Vinschen 0 siblings, 0 replies; 10+ messages in thread From: Corinna Vinschen @ 2016-06-08 9:00 UTC (permalink / raw) To: cygwin [-- Attachment #1: Type: text/plain, Size: 973 bytes --] On Jun 7 21:21, John Hood wrote: > It has taken way too long to get a usable Win7 VM set up, but I can > confirm that the 2.5.2.0.1 snapshot works well on Win7 with my test > programs and fixes the issues noted in Corinna's commits, and is > somewhat faster than 2.5.1. The snapshot's issues with Win7 were also > worse than others have reported, I saw select() locking up and not > responding to either timeout or events. Definitely something that > should not have reached a release. Thanks for testing! > I'll apologize for the bugs, they're clearly regressions from what I had > done. I think I introduced bugs when I reworked the commits to > eliminate changes to cygwait.h, and didn't test sufficiently (I'd > migrated both my Win7 machines to Win10). No worries, shit happens :) Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-06-08 9:00 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-06-05 15:33 Vim responds too slow on the latest snapshot of cygwin1.dll Takashi Yano 2016-06-06 8:43 ` Corinna Vinschen 2016-06-06 11:06 ` Takashi Yano 2016-06-06 13:50 ` Chris Sutcliffe 2016-06-06 14:52 ` Corinna Vinschen 2016-06-06 16:15 ` Chris Sutcliffe 2016-06-07 12:38 ` Takashi Yano 2016-06-07 13:12 ` Corinna Vinschen 2016-06-08 1:21 ` John Hood 2016-06-08 9:00 ` Corinna Vinschen
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).