Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

Unnecessary(?) CPU usage in insert mode #543

Closed lheckemann closed 7 years ago

lheckemann commented 7 years ago

Problems summary

Entering insert mode causes nvim to start using CPU. strace reveals that it is repeatedly communicating with something else:

[...]
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 49)             = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 50)             = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(9, {}, 1024, 0)              = 0
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f6323bfee80, FUTEX_WAKE_PRIVATE, 1) = 1
[...]

Expected

No rise in CPU usage when entering insert mode.

Environment Information

Ubuntu


health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - SUCCESS: no issues found

## Performance
  - INFO: Build type: None
  - WARNING: Non-optimized build-type. Nvim will be slower.
    - SUGGESTIONS:
      - Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.
      - See https://github.com/neovim/neovim/wiki/FAQ

## Remote Plugins
  - SUCCESS: Up to date

## terminfo
  - INFO: key_backspace terminfo entry: key_backspace=\177,

health#provider#check
========================================================================
## Clipboard
  - WARNING: No clipboard tool found. Using the system clipboard won't work.
    - SUGGESTIONS:
      - See |clipboard|.

## Python 2 provider
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - INFO: Python2 version: 2.7.13
  - INFO: python2-neovim version: 0.1.13
  - SUCCESS: Latest python2-neovim is installed: 0.1.13

## Python 3 provider
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python3 version: 3.5.3
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider
  - ERROR: Missing Neovim RubyGem
    - SUGGESTIONS:
      - Install or upgrade the neovim RubyGem using `gem install neovim`.
  - INFO: Ruby Version: not found
  - INFO: Host Executable: not found
  - INFO: Host Version: not found

NixOS:

health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - WARNING: $NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+
    - SUGGESTIONS:
      - Use the 'guicursor' option to configure cursor shape. :help 'guicursor'
      - https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

## Performance
  - SUCCESS: Build type: Release

## Remote Plugins
  - WARNING: "deoplete-nvim" is not registered.
  - WARNING: Out of date
    - SUGGESTIONS:
      - Run `:UpdateRemotePlugins`

## tmux
  - SUCCESS: escape-time: 0ms
  - INFO: $TERM: screen-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - SUCCESS: Clipboard tool found: xsel

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/nix/store/nsby2l2d0d4wzsxi05bhmgdbmplmh5kj-neovim-0.2.0/bin/nvim-python"
  - INFO: Executable: /nix/store/nsby2l2d0d4wzsxi05bhmgdbmplmh5kj-neovim-0.2.0/bin/nvim-python
  - ERROR: Command error -1: python -c from neovim import VERSION as v; print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))
  - INFO: Python2 version: 2.7.13
  - INFO: nvim-python-neovim version: 0.1.13
  - SUCCESS: Latest nvim-python-neovim is installed: 0.1.13

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/nix/store/nsby2l2d0d4wzsxi05bhmgdbmplmh5kj-neovim-0.2.0/bin/nvim-python3"
  - INFO: Executable: /nix/store/nsby2l2d0d4wzsxi05bhmgdbmplmh5kj-neovim-0.2.0/bin/nvim-python3
  - ERROR: Command error -1: python -c from neovim import VERSION as v; print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))
  - INFO: Python3 version: 3.6.2
  - INFO: nvim-python3-neovim version: 0.1.13
  - SUCCESS: Latest nvim-python3-neovim is installed: 0.1.13

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - SUGGESTIONS:
      - Install Ruby and verify that `ruby` and `gem` commands work.

Provide a minimal init.vim with less than 50 lines (Required!)

Enabling deoplete is all that is required to reproduce this issue.

set runtimepath+=~/path/to/deoplete.nvim/
let g:deoplete#enable_at_startup = 1

The reproduce ways from neovim starting (Required!)

  1. Press I

Screen shot (if possible)

N/A

Upload the log file

nvim-log.txt

Shougo commented 7 years ago

OK. I will fix the issue.