Skip to content

Instantly share code, notes, and snippets.

@nhooey
Created January 23, 2014 21:36
Show Gist options
  • Save nhooey/8587313 to your computer and use it in GitHub Desktop.
Save nhooey/8587313 to your computer and use it in GitHub Desktop.
GitGutter slow tab profile
FUNCTION sign#find_current_signs()
Called 95 times
Total time: 0.057338
Self time: 0.057338
count total (s) self (s)
95 0.001016 let gitgutter_signs = {} " <line_number>: {'id': <id>, 'name': <name>}
95 0.000441 let other_signs = []
95 0.000631 redir => signs
95 0.004760 silent execute "sign place file=" . a:file_name
95 0.000500 redir END
115 0.002870 for sign_line in filter(split(signs, '\n'), 'v:val =~# "="')
" Typical sign line: line=88 id=1234 name=GitGutterLineAdded
" We assume splitting is faster than a regexp.
20 0.000563 let components = split(sign_line)
20 0.000236 let name = split(components[2], '=')[1]
20 0.000144 if name !~# 'GitGutterDummy'
15 0.000162 let line_number = str2nr(split(components[0], '=')[1])
15 0.000076 if name =~# 'GitGutter'
15 0.000123 let id = str2nr(split(components[1], '=')[1])
15 0.000135 let gitgutter_signs[line_number] = {'id': id, 'name': name}
15 0.000023 else
call add(other_signs, line_number)
endif
15 0.000006 end
20 0.000016 endfor
95 0.022040 call setbufvar(a:file_name, 'gitgutter_gitgutter_signs', gitgutter_signs)
95 0.018747 call setbufvar(a:file_name, 'gitgutter_other_signs', other_signs)
FUNCTION diff#is_modified()
Called 5 times
Total time: 0.000041
Self time: 0.000041
count total (s) self (s)
5 0.000029 return a:from_count > 0 && a:to_count > 0 && a:from_count == a:to_count
FUNCTION <SNR>40_TabWinEnter()
Called 15 times
Total time: 0.000270
Self time: 0.000270
count total (s) self (s)
15 0.000131 if exists('t:tab_name')
2 0.000029 call setwinvar(winnr(), "tab_win_name", t:tab_name)
2 0.000005 endif
FUNCTION utility#escape()
Called 193 times
Total time: 0.009231
Self time: 0.009231
count total (s) self (s)
193 0.000682 if &shellxquote ==# '"'
return '"' . substitute(a:str, '"', '""', 'g') . '"'
else
193 0.000830 let esc = exists('+shellxescape') ? &shellxescape : '"&|<>()@^'
193 0.006280 return &shellquote . substitute(a:str, '['.esc.']', '&', 'g') . get({'(': ')', '"(': ')"'}, &shellquote, &shellquote)
endif
FUNCTION <SNR>56_BETabEnter()
Called 15 times
Total time: 0.000353
Self time: 0.000353
count total (s) self (s)
" Make s:tabSpace 1-based
15 0.000199 if empty(s:tabSpace) || len(s:tabSpace) < (tabpagenr() + 1)
call add(s:tabSpace, [-1])
endif
FUNCTION diff#process_hunks()
Called 95 times
Total time: 0.006482
Self time: 0.002955
count total (s) self (s)
95 0.003497 0.001254 call hunk#reset()
95 0.000349 let modified_lines = []
100 0.000389 for hunk in a:hunks
5 0.001349 0.000065 call extend(modified_lines, diff#process_hunk(hunk))
5 0.000004 endfor
95 0.000126 return modified_lines
FUNCTION diff#process_modified_and_added()
Called 5 times
Total time: 0.000433
Self time: 0.000433
count total (s) self (s)
5 0.000028 let offset = 0
10 0.000036 while offset < a:from_count
5 0.000026 let line_number = a:to_line + offset
5 0.000048 call add(a:modifications, [line_number, 'modified'])
5 0.000012 let offset += 1
5 0.000005 endwhile
15 0.000023 while offset < a:to_count
10 0.000030 let line_number = a:to_line + offset
10 0.000071 call add(a:modifications, [line_number, 'added'])
10 0.000023 let offset += 1
10 0.000009 endwhile
FUNCTION TabGuiCaptionLabel()
Called 120 times
Total time: 0.011139
Self time: 0.011139
count total (s) self (s)
120 0.000286 let caption = '['
120 0.000238 let tab_number = v:lnum
120 0.000446 let bufnrlist = tabpagebuflist(tab_number)
120 0.000543 let tab_name = gettabwinvar(tab_number, 1, 'tab_win_name')
120 0.000321 let caption .= tab_number
1005 0.001002 for bufnr in bufnrlist
885 0.002528 if getbufvar(bufnr, "&modified")
let caption .= '+'
break
endif
885 0.000437 endfor
120 0.000234 let caption .= '] '
120 0.000333 let winnr = tabpagewinnr(tab_number)
120 0.000491 let buf_name = bufname(bufnrlist[winnr - 1])
120 0.000197 if tab_name == ''
105 0.000410 let caption .= pathshorten(buf_name)
105 0.000084 else
15 0.000032 let caption .= tab_name
15 0.000009 endif
120 0.000126 return caption
FUNCTION utility#highlight_name_for_change()
Called 15 times
Total time: 0.000101
Self time: 0.000101
count total (s) self (s)
15 0.000032 if a:text ==# 'added'
10 0.000011 return 'GitGutterLineAdded'
elseif a:text ==# 'removed'
return 'GitGutterLineRemoved'
elseif a:text ==# 'modified'
5 0.000006 return 'GitGutterLineModified'
elseif a:text ==# 'modified_removed'
return 'GitGutterLineModifiedRemoved'
endif
FUNCTION utility#save_last_seen_change()
Called 95 times
Total time: 0.035545
Self time: 0.035545
count total (s) self (s)
95 0.035461 call setbufvar(a:file, 'gitgutter_last_tick', getbufvar(a:file, 'changedtick'))
FUNCTION <SNR>64_LocalBrowse()
Called 13 times
Total time: 0.000710
Self time: 0.000710
count total (s) self (s)
" unfortunate interaction -- debugging calls can't be used here;
" the BufEnter event causes triggering when attempts to write to
" the DBG buffer are made.
13 0.000075 if !exists("s:vimentered")
return
endif
" call Decho("s:LocalBrowse(dirname<".a:dirname.">){")
" echomsg "dirname<".a:dirname.">"
13 0.000071 if has("amiga")
" The check against '' is made for the Amiga, where the empty
" string is the current directory and not checking would break
" things such as the help command.
" call Decho("(LocalBrowse) dirname<".a:dirname."> (amiga)")
if a:dirname != '' && isdirectory(a:dirname)
sil! call netrw#LocalBrowseCheck(a:dirname)
endif
elseif isdirectory(a:dirname)
" echomsg "dirname<".dirname."> isdir"
" call Decho("(LocalBrowse) dirname<".a:dirname."> (not amiga)")
sil! call netrw#LocalBrowseCheck(a:dirname)
endif
" not a directory, ignore it
" call Decho("|return s:LocalBrowse }")
FUNCTION diff#parse_hunk()
Called 5 times
Total time: 0.000611
Self time: 0.000611
count total (s) self (s)
5 0.000401 let matches = matchlist(a:line, s:hunk_re)
5 0.000022 if len(matches) > 0
5 0.000031 let from_line = str2nr(matches[1])
5 0.000027 let from_count = (matches[2] == '') ? 1 : str2nr(matches[2])
5 0.000020 let to_line = str2nr(matches[3])
5 0.000023 let to_count = (matches[4] == '') ? 1 : str2nr(matches[4])
5 0.000040 return [from_line, from_count, to_line, to_count]
else
return []
end
FUNCTION sign#upsert_new_gitgutter_signs()
Called 95 times
Total time: 0.040320
Self time: 0.040219
count total (s) self (s)
95 0.018178 let other_signs = getbufvar(a:file_name, 'gitgutter_other_signs')
95 0.018084 let old_gitgutter_signs = getbufvar(a:file_name, 'gitgutter_gitgutter_signs')
110 0.000312 for line in a:modified_lines
15 0.000040 let line_number = line[0]
15 0.000036 if index(other_signs, line_number) == -1 " don't clobber others' signs
15 0.000235 0.000134 let name = utility#highlight_name_for_change(line[1])
15 0.000050 if !has_key(old_gitgutter_signs, line_number) " insert
let id = sign#next_sign_id()
execute "sign place" id "line=" . line_number "name=" . name "file=" . a:file_name
else " update if sign has changed
15 0.000044 let old_sign = old_gitgutter_signs[line_number]
15 0.000031 if old_sign.name !=# name
execute "sign place" old_sign.id "name=" . old_sign.name "file=" . a:file_name
end
15 0.000007 endif
15 0.000009 endif
15 0.000007 endfor
" At this point b:gitgutter_gitgutter_signs is out of date.
FUNCTION <SNR>21_updateBufTimes()
Called 13 times
Total time: 0.000224
Self time: 0.000224
count total (s) self (s)
13 0.000170 let s:bufTimes[bufnr('%')] = localtime()
FUNCTION <SNR>56_BEActivateBuffer()
Called 13 times
Total time: 0.004514
Self time: 0.002391
count total (s) self (s)
13 0.000097 let b = bufnr("%")
13 0.000100 let l = get(s:tabSpace, tabpagenr(), [])
13 0.000822 0.000156 if s:BEIgnoreBuffer(b) == 1
return
endif
13 0.000044 if !empty(l) && l[0] == '-1'
" The first time we add a tab Vim uses the current
" buffer as it's starting page, even though we are about
" to edit a new page (BufEnter triggers after), so
" remove the -1 entry indicating we have covered this case.
1 0.000003 let l = []
1 0.000018 let s:tabSpace[tabpagenr()] = l
1 0.000005 elseif empty(l) || index(l, b) == -1
" Add new buffer to this tab buffer list
4 0.000012 let l = add(l, b)
4 0.000026 let s:tabSpace[tabpagenr()] = l
4 0.000018 if g:bufExplorerOnlyOneTab == 1
" If a buffer can only be available in 1 tab page
" ensure this buffer is not present in any other tabs
4 0.000008 let tabidx = 1
36 0.000072 while tabidx < len(s:tabSpace)
32 0.000055 if tabidx != tabpagenr()
28 0.000176 let bufidx = index(s:tabSpace[tabidx], b)
28 0.000042 if bufidx != -1
1 0.000010 call remove(s:tabSpace[tabidx], bufidx)
1 0.000001 endif
28 0.000015 endif
32 0.000071 let tabidx = tabidx + 1
32 0.000032 endwhile
4 0.000003 endif
4 0.000002 endif
13 0.001565 0.000108 call s:BEMRUPush(b)
13 0.000100 if exists('s:raw_buffer_listing') && !empty(s:raw_buffer_listing)
" Check if the buffer exists, but was deleted previously
" Careful use of ' and " so we do not have to escape all the \'s
" Regex: ^\s*bu\>
" ^ - Starting at the beginning of the string
" \s* - optional whitespace
" b - Vim's buffer number
" u\> - the buffer must be unlisted
13 0.000426 let shortlist = filter(copy(s:raw_buffer_listing), "v:val.attributes =~ '".'^\s*'.b.'u\>'."'")
13 0.000033 if !empty(shortlist)
" If it is unlisted (ie deleted), but now we editing it again
" rebuild the buffer list.
let s:refreshBufferList = 1
endif
13 0.000009 endif
FUNCTION sign#update_signs()
Called 95 times
Total time: 0.121035
Self time: 0.003717
count total (s) self (s)
95 0.058225 0.000887 call sign#find_current_signs(a:file_name)
95 0.000756 let new_gitgutter_signs_line_numbers = map(copy(a:modified_lines), 'v:val[0]')
95 0.020691 0.001031 call sign#remove_obsolete_gitgutter_signs(a:file_name, new_gitgutter_signs_line_numbers)
95 0.041010 0.000690 call sign#upsert_new_gitgutter_signs(a:file_name, a:modified_lines)
FUNCTION <SNR>63_Highlight_Matching_Pair()
Called 30 times
Total time: 0.005820
Self time: 0.005820
count total (s) self (s)
" Remove any previous match.
30 0.000141 if exists('w:paren_hl_on') && w:paren_hl_on
2 0.000015 3match none
2 0.000006 let w:paren_hl_on = 0
2 0.000002 endif
" Avoid that we remove the popup menu.
" Return when there are no colors (looks like the cursor jumps).
30 0.000182 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
return
endif
" Get the character under the cursor and check if it's in 'matchpairs'.
30 0.000117 let c_lnum = line('.')
30 0.000090 let c_col = col('.')
30 0.000048 let before = 0
30 0.000173 let c = getline(c_lnum)[c_col - 1]
30 0.000846 let plist = split(&matchpairs, '.\zs[:,]')
30 0.000129 let i = index(plist, c)
30 0.000048 if i < 0
" not found, in Insert mode try character before the cursor
24 0.000100 if c_col > 1 && (mode() == 'i' || mode() == 'R')
let before = 1
let c = getline(c_lnum)[c_col - 2]
let i = index(plist, c)
endif
24 0.000025 if i < 0
" not found, nothing to do
24 0.000022 return
endif
endif
" Figure out the arguments for searchpairpos().
6 0.000011 if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
else
6 0.000014 let s_flags = 'nbW'
6 0.000013 let c2 = c
6 0.000023 let c = plist[i - 1]
6 0.000006 endif
6 0.000011 if c == '['
let c = '\['
let c2 = '\]'
endif
" Find the match. When it was just before the cursor move it there for a
" moment.
6 0.000008 if before > 0
let save_cursor = winsaveview()
call cursor(c_lnum, c_col - before)
endif
" When not in a string or comment ignore matches inside them.
" We match "escape" for special items, such as lispEscapeSpecial.
6 0.000036 let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
6 0.001224 execute 'if' s_skip '| let s_skip = 0 | endif'
" Limit the search to lines visible in the window.
6 0.000114 let stoplinebottom = line('w$')
6 0.000023 let stoplinetop = line('w0')
6 0.000009 if i % 2 == 0
let stopline = stoplinebottom
else
6 0.000012 let stopline = stoplinetop
6 0.000004 endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
6 0.000024 if mode() == 'i' || mode() == 'R'
let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
else
6 0.000033 let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
6 0.000003 endif
6 0.000007 try
6 0.000869 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
6 0.000014 catch /E118/
" Can't use the timeout, restrict the stopline a bit more to avoid taking
" a long time on closed folds and long lines.
" The "viewable" variables give a range in which we can scroll while
" keeping the cursor at the same position.
" adjustedScrolloff accounts for very large numbers of scrolloff.
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
if i % 2 == 0
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = min([bottom_viewable, byte2line(stopbyte)])
else
let stopline = min([bottom_viewable, c_lnum + 100])
endif
let stoplinebottom = stopline
else
if has("byte_offset") && has("syntax_items") && &smc > 0
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = max([top_viewable, byte2line(stopbyte)])
else
let stopline = max([top_viewable, c_lnum - 100])
endif
let stoplinetop = stopline
endif
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
endtry
6 0.000008 if before > 0
call winrestview(save_cursor)
endif
" If a match is found setup match highlighting.
6 0.000015 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
2 0.000063 exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
2 0.000006 let w:paren_hl_on = 1
2 0.000002 endif
FUNCTION utility#file()
Called 583 times
Total time: 0.002189
Self time: 0.002189
count total (s) self (s)
583 0.001677 return s:file
FUNCTION utility#is_tracked_by_git()
Called 98 times
Total time: 2.326547
Self time: 0.022847
count total (s) self (s)
98 0.007546 0.001980 let cmd = utility#escape('git ls-files --error-unmatch' . utility#discard_stdout_and_stderr() . ' ' . shellescape(utility#file()))
98 2.316588 0.018454 call system(utility#command_in_directory_of_file(cmd))
98 0.001429 return !v:shell_error
FUNCTION sign#remove_dummy_sign()
Called 90 times
Total time: 0.410781
Self time: 0.410377
count total (s) self (s)
90 0.000410 if exists('s:dummy_sign_id')
90 0.409931 0.409527 execute "sign unplace" s:dummy_sign_id "file=" . utility#file()
90 0.000271 endif
FUNCTION diff#is_modified_and_added()
Called 5 times
Total time: 0.000036
Self time: 0.000036
count total (s) self (s)
5 0.000017 return a:from_count > 0 && a:to_count > 0 && a:from_count < a:to_count
FUNCTION utility#set_file()
Called 102 times
Total time: 0.000705
Self time: 0.000705
count total (s) self (s)
102 0.000618 let s:file = a:file
FUNCTION diff#process_hunk()
Called 5 times
Total time: 0.001284
Self time: 0.000630
count total (s) self (s)
5 0.000020 let modifications = []
5 0.000017 let from_line = a:hunk[0]
5 0.000011 let from_count = a:hunk[1]
5 0.000012 let to_line = a:hunk[2]
5 0.000018 let to_count = a:hunk[3]
5 0.000086 0.000048 if diff#is_added(from_count, to_count)
call diff#process_added(modifications, from_count, to_count, to_line)
call hunk#increment_lines_added(to_count)
elseif diff#is_removed(from_count, to_count)
call diff#process_removed(modifications, from_count, to_count, to_line)
call hunk#increment_lines_removed(from_count)
elseif diff#is_modified(from_count, to_count)
call diff#process_modified(modifications, from_count, to_count, to_line)
call hunk#increment_lines_modified(to_count)
elseif diff#is_modified_and_added(from_count, to_count)
5 0.000489 0.000056 call diff#process_modified_and_added(modifications, from_count, to_count, to_line)
5 0.000082 0.000039 call hunk#increment_lines_added(to_count - from_count)
5 0.000068 0.000037 call hunk#increment_lines_modified(from_count)
5 0.000016 elseif diff#is_modified_and_removed(from_count, to_count)
call diff#process_modified_and_removed(modifications, from_count, to_count, to_line)
call hunk#increment_lines_modified(to_count)
call hunk#increment_lines_removed(from_count - to_count)
endif
5 0.000007 return modifications
FUNCTION utility#differences()
Called 95 times
Total time: 0.000417
Self time: 0.000417
count total (s) self (s)
95 0.000359 return len(a:hunks) != 0
FUNCTION hunk#reset()
Called 102 times
Total time: 0.002378
Self time: 0.002378
count total (s) self (s)
102 0.002033 let s:summary = [0, 0, 0] " TODO: is bling/airline expecting [-1, -1, -1]?
FUNCTION hunk#increment_lines_modified()
Called 5 times
Total time: 0.000031
Self time: 0.000031
count total (s) self (s)
5 0.000014 let s:summary[1] += a:count
FUNCTION diff#run_diff()
Called 95 times
Total time: 2.310603
Self time: 0.028162
count total (s) self (s)
95 0.000469 if a:realtime
let blob_name = ':./' . fnamemodify(utility#file(),':t')
let blob_file = tempname()
let cmd = 'git show ' . blob_name . ' > ' . blob_file . ' && diff -U0 ' . g:gitgutter_diff_args . ' ' . blob_file . ' - '
else
95 0.002039 0.001631 let cmd = 'git diff --no-ext-diff --no-color -U0 ' . g:gitgutter_diff_args . ' ' . shellescape(utility#file())
95 0.000097 endif
95 0.000243 if a:use_external_grep && s:grep_available
95 0.000628 let cmd .= s:grep_command
95 0.000076 endif
95 0.006868 0.000984 let cmd = utility#escape(cmd)
95 0.000174 if a:realtime
if &fileformat ==# "dos"
let eol = "\r\n"
elseif &fileformat ==# "mac"
let eol = "\r"
else
let eol = "\n"
endif
let buffer_contents = join(getline(1, '$'), eol) . eol
let diff = system(utility#command_in_directory_of_file(cmd), buffer_contents)
else
95 2.294596 0.018447 let diff = system(utility#command_in_directory_of_file(cmd))
95 0.000556 endif
95 0.000580 return diff
FUNCTION <SNR>56_BEIgnoreBuffer()
Called 26 times
Total time: 0.001160
Self time: 0.001160
count total (s) self (s)
" Check to see if this buffer should be ignore by BufExplorer.
" Skip temporary buffers with buftype set.
26 0.000198 if empty(getbufvar(a:buf, "&buftype") == 0)
return 1
endif
" Skip unlisted buffers.
26 0.000066 if buflisted(a:buf) == 0
return 1
endif
" Skip buffers with no name.
26 0.000096 if empty(bufname(a:buf)) == 1
return 1
endif
" Do not add the BufExplorer window to the list.
26 0.000130 if fnamemodify(bufname(a:buf), ":t") == s:name
call s:BEError("The buffer name was [".s:name."] so it was skipped.")
return 1
endif
26 0.000109 if index(s:MRU_Exclude_List, bufname(a:buf)) >= 0
return 1
end
26 0.000022 return 0
FUNCTION diff#parse_diff()
Called 95 times
Total time: 0.007637
Self time: 0.007026
count total (s) self (s)
95 0.001001 let hunks = []
100 0.003683 for line in split(a:diff, '\n')
5 0.000743 0.000132 let hunk_info = diff#parse_hunk(line)
5 0.000014 if len(hunk_info) == 4
5 0.000021 call add(hunks, hunk_info)
5 0.000004 endif
5 0.000005 endfor
95 0.000142 return hunks
FUNCTION <SNR>56_BEMRUPush()
Called 13 times
Total time: 0.001457
Self time: 0.000393
count total (s) self (s)
13 0.000619 0.000125 if s:BEIgnoreBuffer(a:buf) == 1
return
endif
" Remove the buffer number from the list if it already exists.
13 0.000658 0.000088 call s:BEMRUPop(a:buf)
" Add the buffer number to the head of the list.
13 0.000086 call insert(s:MRUList,a:buf)
FUNCTION diff#is_removed()
Called 5 times
Total time: 0.000032
Self time: 0.000032
count total (s) self (s)
5 0.000017 return a:from_count > 0 && a:to_count == 0
FUNCTION utility#is_active()
Called 102 times
Total time: 2.334765
Self time: 0.004748
count total (s) self (s)
102 2.334462 0.004445 return g:gitgutter_enabled && utility#exists_file() && utility#is_tracked_by_git()
FUNCTION sign#add_dummy_sign()
Called 5 times
Total time: 0.000359
Self time: 0.000341
count total (s) self (s)
5 0.000344 0.000326 execute "sign place" s:dummy_sign_id "line=" . 9999 "name=GitGutterDummy file=" . utility#file()
FUNCTION sign#remove_obsolete_gitgutter_signs()
Called 95 times
Total time: 0.019660
Self time: 0.019660
count total (s) self (s)
95 0.018150 let old_gitgutter_signs = getbufvar(a:file_name, 'gitgutter_gitgutter_signs')
110 0.000457 for line_number in keys(old_gitgutter_signs)
15 0.000059 if index(a:new_gitgutter_signs_line_numbers, str2nr(line_number)) == -1
execute "sign unplace" old_gitgutter_signs[line_number].id
endif
15 0.000009 endfor
FUNCTION utility#command_in_directory_of_file()
Called 193 times
Total time: 0.011010
Self time: 0.006192
count total (s) self (s)
193 0.007540 0.002722 let utility#cmd_in_dir = 'cd ' . utility#directory_of_file() . ' && ' . a:cmd
193 0.003256 return substitute(utility#cmd_in_dir, "'", '"', 'g')
FUNCTION hunk#increment_lines_added()
Called 5 times
Total time: 0.000043
Self time: 0.000043
count total (s) self (s)
5 0.000027 let s:summary[0] += a:count
FUNCTION utility#has_unsaved_changes()
Called 95 times
Total time: 0.026971
Self time: 0.026971
count total (s) self (s)
95 0.026435 return getbufvar(a:file, "&mod")
FUNCTION GitGutterAll()
Called 16 times
Total time: 5.287815
Self time: 0.011153
count total (s) self (s)
118 0.000928 for buffer_id in tabpagebuflist()
102 0.006060 let file = expand('#' . buffer_id . ':p')
102 0.000398 if !empty(file)
102 5.279433 0.002771 call GitGutter(file, 0)
102 0.000169 endif
102 0.000305 endfor
FUNCTION utility#directory_of_file()
Called 193 times
Total time: 0.004818
Self time: 0.003995
count total (s) self (s)
193 0.004686 0.003863 return shellescape(fnamemodify(utility#file(), ':h'))
FUNCTION utility#exists_file()
Called 102 times
Total time: 0.003470
Self time: 0.003145
count total (s) self (s)
102 0.003391 0.003066 return filereadable(utility#file())
FUNCTION fugitive#reload_status()
Called 1 time
Total time: 0.002696
Self time: 0.002696
count total (s) self (s)
1 0.000013 if exists('s:reloading_status')
return
endif
1 0.000002 try
1 0.000011 let s:reloading_status = 1
1 0.000006 let mytab = tabpagenr()
10 0.000032 for tab in [mytab] + range(1,tabpagenr('$'))
69 0.000163 for winnr in range(1,tabpagewinnr(tab,'$'))
60 0.000687 if getbufvar(tabpagebuflist(tab)[winnr-1],'fugitive_type') ==# 'index'
execute 'tabnext '.tab
if winnr != winnr()
execute winnr.'wincmd w'
let restorewinnr = 1
endif
try
if !&modified
call s:BufReadIndex()
endif
finally
if exists('restorewinnr')
wincmd p
endif
execute 'tabnext '.mytab
endtry
endif
60 0.000051 endfor
9 0.000013 endfor
1 0.000002 finally
1 0.000004 unlet! s:reloading_status
1 0.000001 endtry
FUNCTION utility#discard_stdout_and_stderr()
Called 98 times
Total time: 0.002008
Self time: 0.002008
count total (s) self (s)
98 0.000677 if !exists('utility#discard')
98 0.000368 if &shellredir ==? '>%s 2>&1'
98 0.000256 let utility#discard = ' > /dev/null 2>&1'
98 0.000087 else
let utility#discard = ' >& /dev/null'
endif
98 0.000053 endif
98 0.000153 return utility#discard
FUNCTION GitGutter()
Called 102 times
Total time: 5.276662
Self time: 0.021227
count total (s) self (s)
102 0.001425 0.000720 call utility#set_file(a:file)
102 2.336727 0.001962 if utility#is_active()
95 0.000640 if !a:realtime || utility#has_fresh_changes(a:file)
95 2.343776 0.006202 let diff = diff#run_diff(a:realtime || utility#has_unsaved_changes(a:file), 1)
95 0.010787 0.003150 let s:hunks = diff#parse_diff(diff)
95 0.007189 0.000707 let modified_lines = diff#process_hunks(s:hunks)
95 0.000181 if g:gitgutter_signs
95 0.000145 if g:gitgutter_sign_column_always
call sign#add_dummy_sign()
else
95 0.001072 0.000655 if utility#differences(s:hunks)
5 0.000400 0.000041 call sign#add_dummy_sign() " prevent flicker
5 0.000007 else
90 0.411543 0.000762 call sign#remove_dummy_sign()
90 0.000073 endif
95 0.000052 endif
95 0.123176 0.002141 call sign#update_signs(a:file, modified_lines)
95 0.000088 endif
95 0.036154 0.000609 call utility#save_last_seen_change(a:file)
95 0.000116 endif
95 0.000059 else
7 0.000230 0.000095 call hunk#reset()
7 0.000006 endif
FUNCTION <SNR>56_BEMRUPop()
Called 13 times
Total time: 0.000570
Self time: 0.000570
count total (s) self (s)
13 0.000507 call filter(s:MRUList, 'v:val != '.a:buf)
FUNCTION diff#is_added()
Called 5 times
Total time: 0.000038
Self time: 0.000038
count total (s) self (s)
5 0.000019 return a:from_count == 0 && a:to_count > 0
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
16 5.287815 0.011153 GitGutterAll()
102 5.276662 0.021227 GitGutter()
102 2.334765 0.004748 utility#is_active()
98 2.326547 0.022847 utility#is_tracked_by_git()
95 2.310603 0.028162 diff#run_diff()
90 0.410781 0.410377 sign#remove_dummy_sign()
95 0.121035 0.003717 sign#update_signs()
95 0.057338 sign#find_current_signs()
95 0.040320 0.040219 sign#upsert_new_gitgutter_signs()
95 0.035545 utility#save_last_seen_change()
95 0.026971 utility#has_unsaved_changes()
95 0.019660 sign#remove_obsolete_gitgutter_signs()
120 0.011139 TabGuiCaptionLabel()
193 0.011010 0.006192 utility#command_in_directory_of_file()
193 0.009231 utility#escape()
95 0.007637 0.007026 diff#parse_diff()
95 0.006482 0.002955 diff#process_hunks()
30 0.005820 <SNR>63_Highlight_Matching_Pair()
193 0.004818 0.003995 utility#directory_of_file()
13 0.004514 0.002391 <SNR>56_BEActivateBuffer()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
90 0.410781 0.410377 sign#remove_dummy_sign()
95 0.057338 sign#find_current_signs()
95 0.040320 0.040219 sign#upsert_new_gitgutter_signs()
95 0.035545 utility#save_last_seen_change()
95 2.310603 0.028162 diff#run_diff()
95 0.026971 utility#has_unsaved_changes()
98 2.326547 0.022847 utility#is_tracked_by_git()
102 5.276662 0.021227 GitGutter()
95 0.019660 sign#remove_obsolete_gitgutter_signs()
16 5.287815 0.011153 GitGutterAll()
120 0.011139 TabGuiCaptionLabel()
193 0.009231 utility#escape()
95 0.007637 0.007026 diff#parse_diff()
193 0.011010 0.006192 utility#command_in_directory_of_file()
30 0.005820 <SNR>63_Highlight_Matching_Pair()
102 2.334765 0.004748 utility#is_active()
193 0.004818 0.003995 utility#directory_of_file()
95 0.121035 0.003717 sign#update_signs()
102 0.003470 0.003145 utility#exists_file()
95 0.006482 0.002955 diff#process_hunks()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment