vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vile] load of 1 and 100% CPU (ncursesw vs ncurses)


From: Wayne Cuddy
Subject: [vile] load of 1 and 100% CPU (ncursesw vs ncurses)
Date: Fri, 16 Sep 2016 15:48:46 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

When vile is linked against ncursesw, version 5.9 64-bit in this case, it
chews up the CPU when highlighting is enabled.

It's quite reproducible for me:

- start vile on any file which can be highlighted
- go into insert mode
- make any change to the file (simply moving the cursor does not
trigger the problem) but a single character change will

Leaving insert mode does not correct the problem.

It seems to be related to highlighter execution. Turning highlighting
off (set nohl) brings the load back down.

Using strace I can see that poll() is being executed with a timeout of
0. According to the man page this causes poll to return immediately so
that explains the load.

...
16254 12:31:50.257123 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257184 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257245 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257306 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257367 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257429 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.257490 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
...

In my case autocolor=5000. After turning off highlighting "set nohl"
the timeout value passed to poll matches autocolor and the system
behaves normally. See the timeout value for poll() at the bottom.

16254 12:31:50.877359 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877420 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877481 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877542 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877603 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877686 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877751 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.877813 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.878101 poll([{fd=0, events=POLLIN}], 1, 0) = 1 ([{fd=0, revents=P
OLLIN}])
16254 12:31:50.878177 read(0, "k", 1)   = 1
16254 12:31:50.878267 rt_sigaction(SIGALRM, {0x418480, [], SA_RESTORER|SA_RESTAR
T|SA_NODEFER, 0x7faa050cc9f0}, {0x418480, [], SA_RESTORER|SA_RESTART|SA_NODEFER,
 0x7faa050cc9f0}, 8) = 0
16254 12:31:50.878344 alarm(1)          = 0
16254 12:31:50.878407 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.878492 rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER|SA_RESTART
, 0x7faa050cc9f0}, {SIG_DFL, [], SA_RESTORER|SA_RESTART|SA_NODEFER, 0x7faa050cc9
f0}, 8) = 0
16254 12:31:50.878566 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.878635 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.878736 write(1, "\33[34B\33[37m\33[40m                 "..., 53)
= 53
16254 12:31:50.878971 rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER|SA_RESTART
|SA_NODEFER, 0x7faa050cc9f0}, NULL, 8) = 0
16254 12:31:50.879040 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.879135 rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER|SA_RESTART
, 0x7faa050cc9f0}, {SIG_DFL, [], SA_RESTORER|SA_RESTART|SA_NODEFER, 0x7faa050cc9
f0}, 8) = 0
16254 12:31:50.879207 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.879272 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.879340 write(1, "\33[34A", 5) = 5
16254 12:31:50.879482 rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER|SA_RESTART
|SA_NODEFER, 0x7faa050cc9f0}, NULL, 8) = 0
16254 12:31:50.879550 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.879615 write(1, "\33[?25l", 6) = 6
16254 12:31:50.879803 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.879874 write(1, "\33[34h\33[?25h", 11) = 11
16254 12:31:50.880009 rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER|SA_RESTART
, 0x7faa050cc9f0}, {SIG_DFL, [], SA_RESTORER|SA_RESTART|SA_NODEFER, 0x7faa050cc9
f0}, 8) = 0
16254 12:31:50.880083 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.880148 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.880225 write(1, "\33[61;71H\33[0;7m\17\33[37m\33[40m7\r\33[34A"..
., 44) = 44
16254 12:31:50.880383 rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER|SA_RESTART
|SA_NODEFER, 0x7faa050cc9f0}, NULL, 8) = 0
16254 12:31:50.880452 poll([{fd=0, events=POLLIN}], 1, 0) = 0 (Timeout)
16254 12:31:50.880519 poll([{fd=0, events=POLLIN}], 1, 5000) = ? ERESTART_RESTAR
TBLOCK (Interrupted by signal)
16254 12:31:51.878672 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
16254 12:31:51.878775 rt_sigreturn()    = -1 EINTR (Interrupted system call)
16254 12:31:51.878882 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:31:56.884572 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:01.890066 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:06.895488 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:11.900952 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:16.906469 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:21.912006 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:26.917504 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)
16254 12:32:31.922953 poll([{fd=0, events=POLLIN}], 1, 5000) = 0 (Timeout)

I don't need to link with ncursesw it's just something that I figured
should work since it's noted to be compatible.

Let me know if there's any other information I can provide.

Wayne



reply via email to

[Prev in Thread] Current Thread [Next in Thread]