home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1129 < prev    next >
Encoding:
Internet Message Format  |  2013-06-05  |  20.9 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1129
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1129
  11. Problem:    Can't see what pattern in syntax highlighting is slow.
  12. Solution:   Add the ":syntime" command.
  13. Files:        src/structs.h, src/syntax.c, src/ex_cmds.h, src/ex_docmd.c,
  14.         src/proto/syntax.pro, src/ex_cmds2.c, src/proto/ex_cmds2.pro,
  15.         runtime/doc/syntax.txt
  16.  
  17.  
  18. *** ../vim-7.3.1128/src/structs.h    2013-05-19 19:16:25.000000000 +0200
  19. --- src/structs.h    2013-06-06 12:24:08.000000000 +0200
  20. ***************
  21. *** 1206,1211 ****
  22. --- 1206,1223 ----
  23.   typedef struct qf_info_S qf_info_T;
  24.   #endif
  25.   
  26. + #ifdef FEAT_RELTIME
  27. + /*
  28. +  * Used for :syntime: timing of executing a syntax pattern.
  29. +  */
  30. + typedef struct {
  31. +     proftime_T    total;        /* total time used */
  32. +     proftime_T    slowest;    /* time of slowest call */
  33. +     long    count;        /* nr of times used */
  34. +     long    match;        /* nr of times matched */
  35. + } syn_time_T;
  36. + #endif
  37.   /*
  38.    * These are items normally related to a buffer.  But when using ":ownsyntax"
  39.    * a window may have its own instance.
  40. ***************
  41. *** 1230,1235 ****
  42. --- 1242,1250 ----
  43.       long    b_syn_sync_linebreaks;    /* offset for multi-line pattern */
  44.       char_u    *b_syn_linecont_pat;    /* line continuation pattern */
  45.       regprog_T    *b_syn_linecont_prog;    /* line continuation program */
  46. + #ifdef FEAT_RELTIME
  47. +     syn_time_T  b_syn_linecont_time;
  48. + #endif
  49.       int        b_syn_linecont_ic;    /* ignore-case flag for above */
  50.       int        b_syn_topgrp;        /* for ":syntax include" */
  51.   # ifdef FEAT_CONCEAL
  52. *** ../vim-7.3.1128/src/syntax.c    2013-05-06 04:21:35.000000000 +0200
  53. --- src/syntax.c    2013-06-06 12:37:55.000000000 +0200
  54. ***************
  55. *** 153,158 ****
  56. --- 153,161 ----
  57.       short     sp_syn_match_id;    /* highlight group ID of pattern */
  58.       char_u    *sp_pattern;        /* regexp to match, pattern */
  59.       regprog_T    *sp_prog;        /* regexp to match, program */
  60. + #ifdef FEAT_RELTIME
  61. +     syn_time_T     sp_time;
  62. + #endif
  63.       int         sp_ic;            /* ignore-case flag for sp_prog */
  64.       short     sp_off_flags;        /* see below */
  65.       int         sp_offsets[SPO_COUNT];    /* offsets */
  66. ***************
  67. *** 269,274 ****
  68. --- 272,279 ----
  69.    */
  70.   static int keepend_level = -1;
  71.   
  72. + static char msg_no_items[] = N_("No Syntax items defined for this buffer");
  73.   /*
  74.    * For the current state we need to remember more than just the idx.
  75.    * When si_m_endpos.lnum is 0, the items other than si_idx are unknown.
  76. ***************
  77. *** 395,400 ****
  78. --- 400,420 ----
  79.   static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained));
  80.   static int push_current_state __ARGS((int idx));
  81.   static void pop_current_state __ARGS((void));
  82. + #ifdef FEAT_RELTIME
  83. + static void syn_clear_time __ARGS((syn_time_T *tt));
  84. + static void syntime_clear __ARGS((void));
  85. + #ifdef __BORLANDC__
  86. + static int _RTLENTRYF syn_compare_syntime __ARGS((const void *v1, const void *v2));
  87. + #else
  88. + static int syn_compare_syntime __ARGS((const void *v1, const void *v2));
  89. + #endif
  90. + static void syntime_report __ARGS((void));
  91. + static int syn_time_on = FALSE;
  92. + # define IF_SYN_TIME(p) (p)
  93. + #else
  94. + # define IF_SYN_TIME(p) NULL
  95. + typedef int syn_time_T;
  96. + #endif
  97.   
  98.   static void syn_stack_apply_changes_block __ARGS((synblock_T *block, buf_T *buf));
  99.   static void find_endpos __ARGS((int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_endpos, long *flagsp, lpos_T *end_endpos, int *end_idx, reg_extmatch_T *start_ext));
  100. ***************
  101. *** 406,412 ****
  102.   static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
  103.   static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
  104.   static char_u *syn_getcurline __ARGS((void));
  105. ! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col));
  106.   static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp));
  107.   static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
  108.   static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing));
  109. --- 426,432 ----
  110.   static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
  111.   static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
  112.   static char_u *syn_getcurline __ARGS((void));
  113. ! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T *st));
  114.   static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp));
  115.   static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
  116.   static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing));
  117. ***************
  118. *** 977,983 ****
  119.       {
  120.       regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
  121.       regmatch.regprog = syn_block->b_syn_linecont_prog;
  122. !     return syn_regexec(®match, lnum, (colnr_T)0);
  123.       }
  124.       return FALSE;
  125.   }
  126. --- 997,1004 ----
  127.       {
  128.       regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
  129.       regmatch.regprog = syn_block->b_syn_linecont_prog;
  130. !     return syn_regexec(®match, lnum, (colnr_T)0,
  131. !                 IF_SYN_TIME(&syn_block->b_syn_linecont_time));
  132.       }
  133.       return FALSE;
  134.   }
  135. ***************
  136. *** 2068,2075 ****
  137.   
  138.                   regmatch.rmm_ic = spp->sp_ic;
  139.                   regmatch.regprog = spp->sp_prog;
  140. !                 if (!syn_regexec(®match, current_lnum,
  141. !                                  (colnr_T)lc_col))
  142.                   {
  143.                   /* no match in this line, try another one */
  144.                   spp->sp_startcol = MAXCOL;
  145. --- 2089,2098 ----
  146.   
  147.                   regmatch.rmm_ic = spp->sp_ic;
  148.                   regmatch.regprog = spp->sp_prog;
  149. !                 if (!syn_regexec(®match,
  150. !                          current_lnum,
  151. !                          (colnr_T)lc_col,
  152. !                              IF_SYN_TIME(&spp->sp_time)))
  153.                   {
  154.                   /* no match in this line, try another one */
  155.                   spp->sp_startcol = MAXCOL;
  156. ***************
  157. *** 2950,2956 ****
  158.   
  159.           regmatch.rmm_ic = spp->sp_ic;
  160.           regmatch.regprog = spp->sp_prog;
  161. !         if (syn_regexec(®match, startpos->lnum, lc_col))
  162.           {
  163.           if (best_idx == -1 || regmatch.startpos[0].col
  164.                             < best_regmatch.startpos[0].col)
  165. --- 2973,2980 ----
  166.   
  167.           regmatch.rmm_ic = spp->sp_ic;
  168.           regmatch.regprog = spp->sp_prog;
  169. !         if (syn_regexec(®match, startpos->lnum, lc_col,
  170. !                           IF_SYN_TIME(&spp->sp_time)))
  171.           {
  172.           if (best_idx == -1 || regmatch.startpos[0].col
  173.                             < best_regmatch.startpos[0].col)
  174. ***************
  175. *** 2981,2987 ****
  176.           lc_col = 0;
  177.           regmatch.rmm_ic = spp_skip->sp_ic;
  178.           regmatch.regprog = spp_skip->sp_prog;
  179. !         if (syn_regexec(®match, startpos->lnum, lc_col)
  180.               && regmatch.startpos[0].col
  181.                            <= best_regmatch.startpos[0].col)
  182.           {
  183. --- 3005,3012 ----
  184.           lc_col = 0;
  185.           regmatch.rmm_ic = spp_skip->sp_ic;
  186.           regmatch.regprog = spp_skip->sp_prog;
  187. !         if (syn_regexec(®match, startpos->lnum, lc_col,
  188. !                           IF_SYN_TIME(&spp_skip->sp_time))
  189.               && regmatch.startpos[0].col
  190.                            <= best_regmatch.startpos[0].col)
  191.           {
  192. ***************
  193. *** 3229,3241 ****
  194.    * Returns TRUE when there is a match.
  195.    */
  196.       static int
  197. ! syn_regexec(rmp, lnum, col)
  198.       regmmatch_T    *rmp;
  199.       linenr_T    lnum;
  200.       colnr_T    col;
  201.   {
  202.       rmp->rmm_maxcol = syn_buf->b_p_smc;
  203. !     if (vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL) > 0)
  204.       {
  205.       rmp->startpos[0].lnum += lnum;
  206.       rmp->endpos[0].lnum += lnum;
  207. --- 3254,3290 ----
  208.    * Returns TRUE when there is a match.
  209.    */
  210.       static int
  211. ! syn_regexec(rmp, lnum, col, st)
  212.       regmmatch_T    *rmp;
  213.       linenr_T    lnum;
  214.       colnr_T    col;
  215. +     syn_time_T  *st;
  216.   {
  217. +     int r;
  218. + #ifdef FEAT_RELTIME
  219. +     proftime_T    pt;
  220. +     if (syn_time_on)
  221. +     profile_start(&pt);
  222. + #endif
  223.       rmp->rmm_maxcol = syn_buf->b_p_smc;
  224. !     r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL);
  225. ! #ifdef FEAT_RELTIME
  226. !     if (syn_time_on)
  227. !     {
  228. !     profile_end(&pt);
  229. !     profile_add(&st->total, &pt);
  230. !     if (profile_cmp(&pt, &st->slowest) < 0)
  231. !         st->slowest = pt;
  232. !     ++st->count;
  233. !     if (r > 0)
  234. !         ++st->match;
  235. !     }
  236. ! #endif
  237. !     if (r > 0)
  238.       {
  239.       rmp->startpos[0].lnum += lnum;
  240.       rmp->endpos[0].lnum += lnum;
  241. ***************
  242. *** 3769,3775 ****
  243.   
  244.       if (!syntax_present(curwin))
  245.       {
  246. !     MSG(_("No Syntax items defined for this buffer"));
  247.       return;
  248.       }
  249.   
  250. --- 3818,3824 ----
  251.   
  252.       if (!syntax_present(curwin))
  253.       {
  254. !     MSG(_(msg_no_items));
  255.       return;
  256.       }
  257.   
  258. ***************
  259. *** 5609,5614 ****
  260. --- 5658,5666 ----
  261.       if (ci->sp_prog == NULL)
  262.       return NULL;
  263.       ci->sp_ic = curwin->w_s->b_syn_ic;
  264. + #ifdef FEAT_RELTIME
  265. +     syn_clear_time(&ci->sp_time);
  266. + #endif
  267.   
  268.       /*
  269.        * Check for a match, highlight or region offset.
  270. ***************
  271. *** 5783,5790 ****
  272.           cpo_save = p_cpo;
  273.           p_cpo = (char_u *)"";
  274.           curwin->w_s->b_syn_linecont_prog =
  275. !                 vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC);
  276.           p_cpo = cpo_save;
  277.   
  278.           if (curwin->w_s->b_syn_linecont_prog == NULL)
  279.           {
  280. --- 5835,5845 ----
  281.           cpo_save = p_cpo;
  282.           p_cpo = (char_u *)"";
  283.           curwin->w_s->b_syn_linecont_prog =
  284. !                vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC);
  285.           p_cpo = cpo_save;
  286. + #ifdef FEAT_RELTIME
  287. +         syn_clear_time(&curwin->w_s->b_syn_linecont_time);
  288. + #endif
  289.   
  290.           if (curwin->w_s->b_syn_linecont_prog == NULL)
  291.           {
  292. ***************
  293. *** 6471,6476 ****
  294. --- 6526,6704 ----
  295.   }
  296.   #endif
  297.   
  298. + #ifdef FEAT_RELTIME
  299. + /*
  300. +  * ":syntime".
  301. +  */
  302. +     void
  303. + ex_syntime(eap)
  304. +     exarg_T    *eap;
  305. + {
  306. +     if (STRCMP(eap->arg, "on") == 0)
  307. +     syn_time_on = TRUE;
  308. +     else if (STRCMP(eap->arg, "off") == 0)
  309. +     syn_time_on = FALSE;
  310. +     else if (STRCMP(eap->arg, "clear") == 0)
  311. +     syntime_clear();
  312. +     else if (STRCMP(eap->arg, "report") == 0)
  313. +     syntime_report();
  314. +     else
  315. +     EMSG2(_(e_invarg2), eap->arg);
  316. + }
  317. +     static void
  318. + syn_clear_time(st)
  319. +     syn_time_T *st;
  320. + {
  321. +     profile_zero(&st->total);
  322. +     profile_zero(&st->slowest);
  323. +     st->count = 0;
  324. +     st->match = 0;
  325. + }
  326. + /*
  327. +  * Clear the syntax timing for the current buffer.
  328. +  */
  329. +     static void
  330. + syntime_clear()
  331. + {
  332. +     int        idx;
  333. +     synpat_T    *spp;
  334. +     if (!syntax_present(curwin))
  335. +     {
  336. +     MSG(_(msg_no_items));
  337. +     return;
  338. +     }
  339. +     for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx)
  340. +     {
  341. +     spp = &(SYN_ITEMS(curwin->w_s)[idx]);
  342. +     syn_clear_time(&spp->sp_time);
  343. +     }
  344. + }
  345. + typedef struct
  346. + {
  347. +     proftime_T    total;
  348. +     int        count;
  349. +     int        match;
  350. +     proftime_T    slowest;
  351. +     proftime_T    average;
  352. +     int        id;
  353. +     char_u    *pattern;
  354. + } time_entry_T;
  355. +     static int
  356. + #ifdef __BORLANDC__
  357. + _RTLENTRYF
  358. + #endif
  359. + syn_compare_syntime(v1, v2)
  360. +     const void    *v1;
  361. +     const void    *v2;
  362. + {
  363. +     const time_entry_T    *s1 = v1;
  364. +     const time_entry_T    *s2 = v2;
  365. +     return profile_cmp(&s1->total, &s2->total);
  366. + }
  367. + /*
  368. +  * Clear the syntax timing for the current buffer.
  369. +  */
  370. +     static void
  371. + syntime_report()
  372. + {
  373. +     int        idx;
  374. +     synpat_T    *spp;
  375. +     proftime_T    tm;
  376. +     int        len;
  377. +     proftime_T    total_total;
  378. +     int        total_count = 0;
  379. +     garray_T    ga;
  380. +     time_entry_T *p;
  381. +     if (!syntax_present(curwin))
  382. +     {
  383. +     MSG(_(msg_no_items));
  384. +     return;
  385. +     }
  386. +     ga_init2(&ga, sizeof(time_entry_T), 50);
  387. +     profile_zero(&total_total);
  388. +     for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx)
  389. +     {
  390. +     spp = &(SYN_ITEMS(curwin->w_s)[idx]);
  391. +     if (spp->sp_time.count > 0)
  392. +     {
  393. +         ga_grow(&ga, 1);
  394. +         p = ((time_entry_T *)ga.ga_data) + ga.ga_len;
  395. +         p->total = spp->sp_time.total;
  396. +         profile_add(&total_total, &spp->sp_time.total);
  397. +         p->count = spp->sp_time.count;
  398. +         p->match = spp->sp_time.match;
  399. +         total_count += spp->sp_time.count;
  400. +         p->slowest = spp->sp_time.slowest;
  401. + # ifdef FEAT_FLOAT
  402. +         profile_divide(&spp->sp_time.total, spp->sp_time.count, &tm);
  403. +         p->average = tm;
  404. + # endif
  405. +         p->id = spp->sp_syn.id;
  406. +         p->pattern = spp->sp_pattern;
  407. +         ++ga.ga_len;
  408. +     }
  409. +     }
  410. +     /* sort on total time */
  411. +     qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T), syn_compare_syntime);
  412. +     MSG_PUTS_TITLE(_("  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN"));
  413. +     MSG_PUTS("\n");
  414. +     for (idx = 0; idx < ga.ga_len && !got_int; ++idx)
  415. +     {
  416. +     spp = &(SYN_ITEMS(curwin->w_s)[idx]);
  417. +     p = ((time_entry_T *)ga.ga_data) + idx;
  418. +     MSG_PUTS(profile_msg(&p->total));
  419. +     MSG_PUTS(" "); /* make sure there is always a separating space */
  420. +     msg_advance(13);
  421. +     msg_outnum(p->count);
  422. +     MSG_PUTS(" ");
  423. +     msg_advance(20);
  424. +     msg_outnum(p->match);
  425. +     MSG_PUTS(" ");
  426. +     msg_advance(26);
  427. +     MSG_PUTS(profile_msg(&p->slowest));
  428. +     MSG_PUTS(" ");
  429. +     msg_advance(38);
  430. + # ifdef FEAT_FLOAT
  431. +     MSG_PUTS(profile_msg(&p->average));
  432. +     MSG_PUTS(" ");
  433. + # endif
  434. +     msg_advance(50);
  435. +     msg_outtrans(HL_TABLE()[p->id - 1].sg_name);
  436. +     MSG_PUTS(" ");
  437. +     msg_advance(69);
  438. +     if (Columns < 80)
  439. +         len = 20; /* will wrap anyway */
  440. +     else
  441. +         len = Columns - 70;
  442. +     if (len > (int)STRLEN(p->pattern))
  443. +         len = (int)STRLEN(p->pattern);
  444. +     msg_outtrans_len(p->pattern, len);
  445. +     MSG_PUTS("\n");
  446. +     }
  447. +     if (!got_int)
  448. +     {
  449. +     MSG_PUTS("\n");
  450. +     MSG_PUTS(profile_msg(&total_total));
  451. +     msg_advance(13);
  452. +     msg_outnum(total_count);
  453. +     MSG_PUTS("\n");
  454. +     }
  455. + }
  456. + #endif
  457.   #endif /* FEAT_SYN_HL */
  458.   
  459.   /**************************************
  460. *** ../vim-7.3.1128/src/ex_cmds.h    2013-05-17 16:39:59.000000000 +0200
  461. --- src/ex_cmds.h    2013-06-05 22:20:35.000000000 +0200
  462. ***************
  463. *** 925,930 ****
  464. --- 925,932 ----
  465.               TRLBAR|CMDWIN),
  466.   EX(CMD_syntax,        "syntax",    ex_syntax,
  467.               EXTRA|NOTRLCOM|CMDWIN),
  468. + EX(CMD_syntime,        "syntime",    ex_syntime,
  469. +             WORD1|TRLBAR|CMDWIN),
  470.   EX(CMD_syncbind,    "syncbind",    ex_syncbind,
  471.               TRLBAR),
  472.   EX(CMD_t,        "t",        ex_copymove,
  473. *** ../vim-7.3.1128/src/ex_docmd.c    2013-06-02 19:22:05.000000000 +0200
  474. --- src/ex_docmd.c    2013-06-05 22:21:30.000000000 +0200
  475. ***************
  476. *** 242,247 ****
  477. --- 242,250 ----
  478.   # define ex_syntax        ex_ni
  479.   # define ex_ownsyntax        ex_ni
  480.   #endif
  481. + #if !defined(FEAT_SYN_HL) || !defined(FEAT_RELTIME)
  482. + # define ex_syntime        ex_ni
  483. + #endif
  484.   #ifndef FEAT_SPELL
  485.   # define ex_spell        ex_ni
  486.   # define ex_mkspell        ex_ni
  487. *** ../vim-7.3.1128/src/proto/syntax.pro    2010-08-15 21:57:28.000000000 +0200
  488. --- src/proto/syntax.pro    2013-06-05 22:59:09.000000000 +0200
  489. ***************
  490. *** 19,24 ****
  491. --- 19,25 ----
  492.   int syn_get_sub_char __ARGS((void));
  493.   int syn_get_stack_item __ARGS((int i));
  494.   int syn_get_foldlevel __ARGS((win_T *wp, long lnum));
  495. + void ex_syntime __ARGS((exarg_T *eap));
  496.   void init_highlight __ARGS((int both, int reset));
  497.   int load_colors __ARGS((char_u *name));
  498.   void do_highlight __ARGS((char_u *line, int forceit, int init));
  499. *** ../vim-7.3.1128/src/ex_cmds2.c    2013-05-06 04:50:26.000000000 +0200
  500. --- src/ex_cmds2.c    2013-06-06 12:14:52.000000000 +0200
  501. ***************
  502. *** 958,963 ****
  503. --- 958,993 ----
  504.   
  505.   # endif  /* FEAT_PROFILE || FEAT_RELTIME */
  506.   
  507. + #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
  508. + # if defined(HAVE_MATH_H)
  509. + #  include <math.h>
  510. + # endif
  511. + /*
  512. +  * Divide the time "tm" by "count" and store in "tm2".
  513. +  */
  514. +     void
  515. + profile_divide(tm, count, tm2)
  516. +     proftime_T  *tm;
  517. +     proftime_T  *tm2;
  518. +     int        count;
  519. + {
  520. +     if (count == 0)
  521. +     profile_zero(tm2);
  522. +     else
  523. +     {
  524. + # ifdef WIN3264
  525. +     tm2->QuadPart = tm->QuadPart / count;
  526. + # else
  527. +     double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
  528. +     tm2->tv_sec = floor(usec / 1000000.0);
  529. +     tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0));
  530. + # endif
  531. +     }
  532. + }
  533. + #endif
  534.   # if defined(FEAT_PROFILE) || defined(PROTO)
  535.   /*
  536.    * Functions for profiling.
  537. ***************
  538. *** 1050,1056 ****
  539.    */
  540.       int
  541.   profile_cmp(tm1, tm2)
  542. !     proftime_T *tm1, *tm2;
  543.   {
  544.   # ifdef WIN3264
  545.       return (int)(tm2->QuadPart - tm1->QuadPart);
  546. --- 1080,1086 ----
  547.    */
  548.       int
  549.   profile_cmp(tm1, tm2)
  550. !     const proftime_T *tm1, *tm2;
  551.   {
  552.   # ifdef WIN3264
  553.       return (int)(tm2->QuadPart - tm1->QuadPart);
  554. *** ../vim-7.3.1128/src/proto/ex_cmds2.pro    2012-06-29 12:57:03.000000000 +0200
  555. --- src/proto/ex_cmds2.pro    2013-06-06 12:14:57.000000000 +0200
  556. ***************
  557. *** 17,28 ****
  558.   void profile_setlimit __ARGS((long msec, proftime_T *tm));
  559.   int profile_passed_limit __ARGS((proftime_T *tm));
  560.   void profile_zero __ARGS((proftime_T *tm));
  561.   void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
  562.   void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children));
  563.   void profile_get_wait __ARGS((proftime_T *tm));
  564.   void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma));
  565.   int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
  566. ! int profile_cmp __ARGS((proftime_T *tm1, proftime_T *tm2));
  567.   void ex_profile __ARGS((exarg_T *eap));
  568.   char_u *get_profile_name __ARGS((expand_T *xp, int idx));
  569.   void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
  570. --- 17,29 ----
  571.   void profile_setlimit __ARGS((long msec, proftime_T *tm));
  572.   int profile_passed_limit __ARGS((proftime_T *tm));
  573.   void profile_zero __ARGS((proftime_T *tm));
  574. + void profile_divide __ARGS((proftime_T *tm, int count, proftime_T *tm2));
  575.   void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
  576.   void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children));
  577.   void profile_get_wait __ARGS((proftime_T *tm));
  578.   void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma));
  579.   int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
  580. ! int profile_cmp __ARGS((const proftime_T *tm1, const proftime_T *tm2));
  581.   void ex_profile __ARGS((exarg_T *eap));
  582.   char_u *get_profile_name __ARGS((expand_T *xp, int idx));
  583.   void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
  584. *** ../vim-7.3.1128/runtime/doc/syntax.txt    2010-08-15 21:57:12.000000000 +0200
  585. --- runtime/doc/syntax.txt    2013-06-06 13:00:36.000000000 +0200
  586. ***************
  587. *** 37,42 ****
  588. --- 37,43 ----
  589.   15. Highlighting tags        |tag-highlight|
  590.   16. Window-local syntax        |:ownsyntax|
  591.   17. Color xterms        |xterm-color|
  592. + 18. When syntax is slow        |:syntime|
  593.   
  594.   {Vi does not have any of these commands}
  595.   
  596. ***************
  597. *** 4754,4757 ****
  598. --- 5087,5146 ----
  599.   that Setup / Font / Enable Bold is NOT enabled.
  600.   (info provided by John Love-Jensen <eljay@Adobe.COM>)
  601.   
  602. + ==============================================================================
  603. + 18. When syntax is slow                        *:syntime*
  604. + This is aimed at authors of a syntax file.
  605. + If your syntax causes redrawing to be slow, here are a few hints on making it
  606. + faster.  To see slowness switch on some features that usually interfere, such
  607. + as 'relativenumber' and |folding|.
  608. + To find out what patterns are consuming most time, get an overview with this
  609. + sequence: >
  610. +     :syntime on
  611. +     [ redraw the text at least once with CTRL-L ]
  612. +     :syntime report
  613. + This will display a list of syntax patterns that were used, sorted by the time
  614. + it took to match them against the text.
  615. + :syntime on        Start measuring syntax times.  This will add some
  616. +             overhead to compute the time spent on syntax pattern
  617. +             matching.
  618. + :syntime off        Stop measuring syntax times.
  619. + :syntime clear        Set all the counters to zero, restart measuring.
  620. + :syntime report        Show the syntax items used since ":syntime on" in the
  621. +             current window.  Use a wider display to see more of
  622. +             the output.
  623. +             The list is sorted by total time. The columns are:
  624. +             TOTAL        Total time in seconds spent on
  625. +                     matching this pattern.
  626. +             COUNT        Number of times the pattern was used.
  627. +             MATCH        Number of times the pattern actually
  628. +                     matched
  629. +             SLOWEST        The longest time for one try.
  630. +             AVERAGE        The average time for one try.
  631. +             NAME        Name of the syntax item.  Note that
  632. +                     this is not unique.
  633. +             PATTERN        The pattern being used.
  634. + Pattern matching gets slow when it has to try many alternatives.  Try to
  635. + include as much literal text as possible to reduce the number of ways a
  636. + pattern does NOT match.
  637. + When using the "\@<=" and "\@<!" items, add a maximum size to avoid trying at
  638. + all positions in the current and previous line.  For example, if the item is
  639. + literal text specify the size of that text (in bytes):
  640. + "<\@<=span"       Matches "span" in "<span".  This tries matching with "<" in
  641. +         many places.
  642. + "<\@1<=span"      Matches the same, but only tries one byte before "span".
  643.    vim:tw=78:sw=4:ts=8:ft=help:norl:
  644. *** ../vim-7.3.1128/src/version.c    2013-06-05 21:42:49.000000000 +0200
  645. --- src/version.c    2013-06-06 13:04:25.000000000 +0200
  646. ***************
  647. *** 730,731 ****
  648. --- 730,733 ----
  649.   {   /* Add new patch number below this line */
  650. + /**/
  651. +     1129,
  652.   /**/
  653.  
  654. -- 
  655. From "know your smileys":
  656.  :'-D    Laughing so much that they're crying
  657.  
  658.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  659. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  660. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  661.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  662.