{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/5728","repository_url":"https://api.github.com/repos/neovim/neovim","labels_url":"https://api.github.com/repos/neovim/neovim/issues/5728/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/5728/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/5728/events","html_url":"https://github.com/neovim/neovim/issues/5728","id":194045521,"number":5728,"title":"Autocmd for remote plugin on VimEnter is slow","user":{"login":"chemzqm","id":251450,"avatar_url":"https://avatars.githubusercontent.com/u/251450?v=3","gravatar_id":"","url":"https://api.github.com/users/chemzqm","html_url":"https://github.com/chemzqm","followers_url":"https://api.github.com/users/chemzqm/followers","following_url":"https://api.github.com/users/chemzqm/following{/other_user}","gists_url":"https://api.github.com/users/chemzqm/gists{/gist_id}","starred_url":"https://api.github.com/users/chemzqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemzqm/subscriptions","organizations_url":"https://api.github.com/users/chemzqm/orgs","repos_url":"https://api.github.com/users/chemzqm/repos","events_url":"https://api.github.com/users/chemzqm/events{/privacy}","received_events_url":"https://api.github.com/users/chemzqm/received_events","type":"User","site_admin":false},"labels":[{"id":101930601,"url":"https://api.github.com/repos/neovim/neovim/labels/performance","name":"performance","color":"c5def5","default":false},{"id":144672485,"url":"https://api.github.com/repos/neovim/neovim/labels/provider","name":"provider","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/neovim/neovim/milestones/11","html_url":"https://github.com/neovim/neovim/milestone/11","labels_url":"https://api.github.com/repos/neovim/neovim/milestones/11/labels","id":1183890,"number":11,"title":"0.3","description":"codename: \"red pill\"","creator":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"open_issues":177,"closed_issues":22,"state":"open","created_at":"2015-06-27T22:05:13Z","updated_at":"2016-12-14T03:08:16Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-12-07T13:09:46Z","updated_at":"2016-12-17T04:30:34Z","closed_at":null,"body":"- `nvim --version`: NVIM v0.2.0-44-g8089292 Build type: Release\r\n- Vim (version: ) behaves differently? No\r\n- Operating system/version: MacOS\r\n- Terminal name/version: iTerm2\r\n\r\n### Actual behaviour\r\n\r\nAutocmd registered from remote plugin could cost ~150ms on startup, even with `sync=False` flag. \r\n\r\n### Expected behaviour\r\n\r\nI thought is should be no more than 10ms when using `rpcnotify`\r\n\r\n### Steps to reproduce using `nvim -u NORC`\r\n\r\nCreate a simple remote plugin in `rplugin/python3/my.py`\r\n```\r\n    import neovim\r\n\r\n    @neovim.plugin\r\n    class Limit(object):\r\n        def __init__(self, vim):\r\n            self.vim = vim\r\n\r\n       @neovim.autocmd('VimEnter', pattern='*', sync=False)\r\n        def on_enter(self):\r\n            return\r\n\r\n```\r\n\r\nAdd this plugin to runtimepath \r\n\r\nRun `:UpdateRemotePlugin`\r\n\r\nuse command:\r\n```\r\nnvim --startuptime tmp.txt\r\n```\r\n\r\nThe time used by `VimEnter autocommands` would be increased more than 150ms.\r\n\r\nI tried with `sync=True`, and it even worse.\r\n\r\nSince I just want to start a server on VimEnter, I changed the code to use jobstart and normal VimEnter autocmd, the time of `VimEnter autocommands` increased no more than 10ms \r\n"},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/267742695","html_url":"https://github.com/neovim/neovim/issues/5728#issuecomment-267742695","issue_url":"https://api.github.com/repos/neovim/neovim/issues/5728","id":267742695,"user":{"login":"chemzqm","id":251450,"avatar_url":"https://avatars.githubusercontent.com/u/251450?v=3","gravatar_id":"","url":"https://api.github.com/users/chemzqm","html_url":"https://github.com/chemzqm","followers_url":"https://api.github.com/users/chemzqm/followers","following_url":"https://api.github.com/users/chemzqm/following{/other_user}","gists_url":"https://api.github.com/users/chemzqm/gists{/gist_id}","starred_url":"https://api.github.com/users/chemzqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemzqm/subscriptions","organizations_url":"https://api.github.com/users/chemzqm/orgs","repos_url":"https://api.github.com/users/chemzqm/repos","events_url":"https://api.github.com/users/chemzqm/events{/privacy}","received_events_url":"https://api.github.com/users/chemzqm/received_events","type":"User","site_admin":false},"created_at":"2016-12-17T04:30:34Z","updated_at":"2016-12-17T04:30:34Z","body":"@mhinz It only need `1ms` to start process, but it cost more than `150ms` to check if the process is running ok in `https://github.com/neovim/neovim/blob/master/runtime/autoload/provider/pythonx.vim#L35`\r\n\r\nI've profiled with:\r\n\r\n``` viml\r\n  let start = reltime()\r\n  try\r\n    let channel_id = jobstart(args, s:job_opts)\r\n    echo reltimestr(reltime(start))\r\n    if rpcrequest(channel_id, 'poll') ==# 'ok'\r\n      echo reltimestr(reltime(start))\r\n      return channel_id\r\n    endif\r\n```"}}
{"actor":{"display_login":"chemzqm"}}