Skip to content

Instantly share code, notes, and snippets.

@itchyny
Created December 4, 2014 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itchyny/41e20742f48242c36675 to your computer and use it in GitHub Desktop.
Save itchyny/41e20742f48242c36675 to your computer and use it in GitHub Desktop.
FUNCTION vimshell#terminal#get_col()
Called 1253 times
Total time: 40.185621
Self time: 24.927843
count total (s) self (s)
" is_virtual -> a:col : real col.
" not -> a:col : virtual col.
1253 0.006099 let col = 1
1253 0.005154 let real_col = 0
1253 0.006800 let current_line = a:line
1253 0.028982 if current_line !~ '\e\[[0-9;]*m'
" Optimized.
39 0.000349 for c in split(current_line[: a:col*3], '\zs')
32 0.000242 let real_col += len(c)
32 0.002532 0.000560 let col += vimshell#util#wcswidth(c)
32 0.000249 let check_col = a:is_virtual ? real_col : col
32 0.000219 if check_col > a:col
break
endif
32 0.000060 endfor
7 0.000015 else
1246 0.005868 let skip_cnt = 0
278210 1.705761 for c in split(current_line[real_col :], '\zs')
276972 0.966135 if skip_cnt > 0
11062 0.040836 let skip_cnt -= 1
11062 0.027832 continue
endif
265910 2.686175 if c == "\<ESC>" && current_line[real_col :] =~ '^\e\[[0-9;]*m'
" Skip.
1246 0.034594 let sequence = matchstr(current_line, '^\e\[[0-9;]*m', real_col)
1246 0.013527 let skip_cnt = len(sequence)-1
1246 0.014871 let real_col += len(sequence)+1
1246 0.003373 else
264664 1.959577 let real_col += len(c)
264664 19.286310 4.030504 let col += vimshell#util#wcswidth(c)
264664 0.787686 endif
265910 1.810924 let check_col = a:is_virtual ? real_col : col
265910 1.267548 if check_col > a:col
8 0.000021 break
endif
265902 0.636425 endfor
1246 0.002402 endif
1253 0.006852 return (a:is_virtual ? col : real_col)
FUNCTION <SNR>103_get_prelude()
Called 265784 times
Total time: 6.533715
Self time: 6.520970
count total (s) self (s)
265784 2.302940 if !exists('s:Prelude')
1 0.012824 0.000079 let s:Prelude = vimshell#util#get_vital().import('Prelude')
1 0.000003 endif
265784 1.002517 return s:Prelude
FUNCTION vimshell#util#wcswidth()
Called 265211 times
Total time: 15.296423
Self time: 6.333188
count total (s) self (s)
265211 14.964864 6.001629 return call(s:get_prelude().wcswidth, a:000)
FUNCTION <SNR>105_wcswidth()
Called 265211 times
Total time: 2.455119
Self time: 2.455119
count total (s) self (s)
265211 2.084049 return strwidth(a:str)
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
23 41.252821 0.004303 <SNR>129_check_output()
9 41.230408 0.000760 vimshell#parser#execute_continuation()
9 41.227776 0.001587 vimshell#interactive#execute_process_out()
9 41.212170 0.002440 vimshell#interactive#print_buffer()
8 41.191414 0.004746 vimshell#terminal#print()
8 40.534399 0.266752 <SNR>159_check_str()
1253 40.238063 0.052442 <SNR>159_get_col_current_line()
1253 40.185621 24.927843 vimshell#terminal#get_col()
782 33.398327 0.084586 <SNR>159_output_string()
515 33.313741 0.081231 <SNR>159_set_screen_string()
25 32.739302 0.008536 <SNR>129_check_all_output()
257 23.501484 0.178192 76()
744 23.429775 0.036852 <SNR>159_get_real_pos()
523 16.892186 0.047046 <SNR>159_get_virtual_col()
265211 15.296423 6.333188 vimshell#util#wcswidth()
16 8.523088 0.000532 vimshell#interactive#check_current_output()
265784 6.533715 6.520970 <SNR>103_get_prelude()
265211 2.455119 <SNR>105_wcswidth()
1 0.633479 0.001125 miv#command()
1 0.597214 0.001934 <SNR>102_call_vimshell()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
1253 40.185621 24.927843 vimshell#terminal#get_col()
265784 6.533715 6.520970 <SNR>103_get_prelude()
265211 15.296423 6.333188 vimshell#util#wcswidth()
265211 2.455119 <SNR>105_wcswidth()
8 40.534399 0.266752 <SNR>159_check_str()
14 0.239652 0.210537 <SNR>154_get_glob_files()
257 23.501484 0.178192 76()
8 0.307633 0.178179 <SNR>159_set_cursor()
45 0.162862 0.131704 vimproc#parser#parse_statements()
17 0.143049 0.129387 vimproc#parser#split_args()
33 0.089038 <SNR>121_parse_galias()
782 33.398327 0.084586 <SNR>159_output_string()
515 33.313741 0.081231 <SNR>159_set_screen_string()
14 0.319934 0.080282 vimshell#complete#helper#get_files()
5 0.074093 0.070712 <SNR>80_make_cache_current_buffer()
1253 40.238063 0.052442 <SNR>159_get_col_current_line()
523 16.892186 0.047046 <SNR>159_get_virtual_col()
58 0.049273 0.045118 vimshell#init#_internal_commands()
55 0.050173 0.042155 lightline#link()
4 0.315937 0.039142 vimshell#complete#helper#executables()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment