-
Notifications
You must be signed in to change notification settings - Fork 25
/
bench_examples.vim
54 lines (38 loc) · 1.35 KB
/
bench_examples.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
let l = []
e Cargo.lock
let id = jobstart('target/release/examples/bench_tokio', { 'rpc': v:true })
let start = reltime()
call rpcrequest(id, 'file')
let seconds = reltimestr(reltime(start))
call add(l, 'File Tokio: ' . seconds)
let start = reltime()
call rpcrequest(id, 'buffer')
let seconds = reltimestr(reltime(start))
call add(l, 'Buffer Tokio: ' . seconds)
let start = reltime()
call rpcrequest(id, 'api')
let seconds = reltimestr(reltime(start))
call add(l, 'API Tokio: ' . seconds)
let id = jobstart('target/release/examples/bench_async-std', { 'rpc': v:true })
let start = reltime()
call rpcrequest(id, 'file')
let seconds = reltimestr(reltime(start))
call add(l, 'File Async-Std: ' . seconds)
let start = reltime()
call rpcrequest(id, 'buffer')
let seconds = reltimestr(reltime(start))
call add(l, 'Buffer Async-Std: ' . seconds)
let start = reltime()
call rpcrequest(id, 'api')
let seconds = reltimestr(reltime(start))
call add(l, 'API Async-Std: ' . seconds)
let id = jobstart('target/release/examples/bench_sync', { 'rpc': v:true })
let g:started_file = reltime()
call rpcnotify(id, 'file')
call rpcnotify(id, 'buffer')
call rpcnotify(id, 'api')
sleep 20
call add(l, 'File Neovim-Lib: ' . g:finished_file)
call add(l, 'Buffer Neovim-Lib: ' . g:finished_buffer)
call add(l, 'API Neovim-Lib: ' . g:finished_api)
call nvim_buf_set_lines(0, 0, -1, v:false, l)