-
Notifications
You must be signed in to change notification settings - Fork 2
/
hug.vim
67 lines (53 loc) · 1.38 KB
/
hug.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
let s:root = expand('<sfile>:h')
function! s:NodeStart()
let script = s:root.'/bin/server.js'
call neovim_rpc#jobstart(['node', script], {})
endfunction
function! RequestA()
call neovim_rpc#rpcrequest(g:channel_id, 'test', 100)
endfunction
function! RequestB()
call neovim_rpc#rpcrequest(g:channel_id, 'test', 1024)
endfunction
function! RequestC()
call neovim_rpc#rpcrequest(g:channel_id, 'test', 10240)
endfunction
function! RequestD()
call neovim_rpc#rpcrequest(g:channel_id, 'test', 102400)
endfunction
function! RequestE()
call neovim_rpc#rpcrequest(g:channel_id, 'test', 1024000)
endfunction
function! s:on_stderr(channel, message)
echohl Error | echon a:message | echohl None
endfunction
execute 'set rtp+=$HOME/.vim/bundle/vim-hug-neovim-rpc'
let address = neovim_rpc#serveraddr()
let parts = split(address, ':')
let $NVIM_LISTEN_PORT = parts[1]
call timer_start(100, { -> s:NodeStart()})
function! s:Start()
profile start ~/result
let range = ['A', 'B', 'C', 'D', 'E']
for i in range
execute 'profile func Request'.i
endfor
for i in range
echom i
for j in range(1000)
call call('Request'.i, [])
endfor
endfor
echom 'done'
endfunction
augroup Test
autocmd!
"autocmd user ServerInit call s:Start()
augroup end
function! CreateData(count)
let res = ''
for i in range(a:count)
let res = res.'a'
endfor
return res
endfunction