Performance issue(may be) with popup list

23 views
Skip to first unread message

khekade...@gmail.com

unread,
Apr 5, 2013, 11:57:09 PM4/5/13
to xptem...@googlegroups.com
Hi,

First of all thanks for providing a wonderful plugin. I recently started using the plugin and I like it better than snipMate.

I wrote a xptemplate to complete domain parameter using Choose function. get_dox_domlist() function returns List of length 5000+.(which I don't think is big compared to the native tag completion done by vim editor). It works fine, only thing is during domain completion there is a bit lag in editor.

XPT movc " {dom}_MOVE_C_TO_C\(dest, src)
XSET domain=Choose(get_dox_domlist())
`domain^_MOVE_C_TO_C(`dest^, `src^);

I profiled the code and found this particular code is called many times. So, I like to know what is the purpose of that function and can this calls be contained?


FUNCTION  <SNR>36_UpdateIndex()
Called 11700 times
Total time:   2.082025
 Self time:   2.082025

count  total (s)   self (s)
11700              0.053379     let  [ i, len ] = [ 0, len(a:key) ]
110620              0.159947     while i < len
98920              0.350828         let prefix = a:key[ 0 : i - 1 ]
98920              0.247923         if !has_key( a:map, prefix )
53884              0.145004             let a:map[ prefix ] = 1
53884              0.053940         else
45036              0.099743             let a:map[ prefix ] += 1
45036              0.043579         endif
98920              0.158020         let i += 1
98920              0.107668     endwhile


FUNCTIONS SORTED ON TOTAL TIME
count  total (s)   self (s)  function
    1   2.680477   0.000340  XPTemplateStart()
    1   2.523418   0.000079  <SNR>39_Popup()
    1   2.523147   0.000028  <SNR>39_DoStart()
    1   2.523075   0.000146  <SNR>39_RenderSnippet()
    3   2.494211   0.000065  <SNR>39_GotoNextItem()
    3   2.494102   0.000651  <SNR>39_DoGotoNextItem()
    3   2.492836   0.000455  <SNR>39_InitItem()
    3   2.491718   0.000245  <SNR>39_ApplyDefaultValue()
    1   2.486469   0.000078  <SNR>39_ApplyDefaultValueToPH()
    1   2.486103   0.000040  <SNR>39_DefaultValuePumHandler()
    1   2.486063   0.000092  <SNR>39_DefaultValueShowPum()
    1   2.386619   0.000063  XPPopupNew()
    1   2.386515   0.008452  1()
    2   2.378091   0.296066  3()
11700   2.082025             <SNR>36_UpdateIndex()
    7   0.217379   0.213457  XPPprocess()
    2   0.204039   0.000769  <SNR>36_popup()
    2   0.197696             <SNR>36_filterCompleteList()
    1   0.156640   0.000243  XPTparseSnippets()
   10   0.156397   0.023179  DoParseSnippet()

Regards,
Sarath

khekade...@gmail.com

unread,
Apr 11, 2013, 11:25:25 PM4/11/13
to xptem...@googlegroups.com
anyone has idea?
Reply all
Reply to author
Forward
0 new messages