Subject: Re: bug#17837: 24.4.50; Search very slow

From: Eli Zaretskii <[email-masked]>
Date: Mon, 23 Jun 2014 19:32:21 +0300

Here's the profile, with today's trunk.  Looks like the function
called by syntax-ppss via funcall is the culprit.  The only funcall in
syntax-ppss calls syntax-begin-function, AFAICS.

  - command-execute                                                 672  94%
   - call-interactively                                             672  94%
    - funcall-interactively                                         672  94%
     - isearch-repeat-forward                                       663  93%
      - isearch-repeat                                              663  93%
       - isearch-update                                             655  92%
	- isearch-lazy-highlight-new-loop                           654  92%
	 - sit-for                                                  654  92%
	  - redisplay                                               654  92%
	   - redisplay_internal (C function)                        636  89%
	    - jit-lock-function                                     634  89%
	     - jit-lock-fontify-now                                 634  89%
	      - funcall                                             634  89%
	       - #<compiled 0x13152f7>                              634  89%
		- run-hook-with-args                                634  89%
		 - font-lock-fontify-region                         634  89%
		  - font-lock-default-fontify-region                634  89%
		   - font-lock-fontify-syntactically-region         631  89%
		    - syntax-propertize                             597  84%
		     - #<compiled 0x106c735>                        593  83%
		      - syntax-ppss                                 579  81%
		       - funcall                                    571  80%
			  #<compiled 0x106ced3>                     569  80%
		    - syntax-ppss                                    33   4%
		     - funcall                                       33   4%
			#<compiled 0x1448019>                        33   4%
		     font-lock-fontify-keywords-region                  2   0%
	    - find-image                                              2   0%
	       cond                                                   2   0%
       - isearch-search                                               8   1%
	- byte-code                                                   8   1%
	 - isearch-search-string                                      8   1%
	    search-forward-lax-whitespace                             8   1%
     - isearch-printing-char                                          7   0%
      - isearch-process-search-char                                   7   0%
       - isearch-process-search-string                                7   0%
	- isearch-search-and-update                                   7   0%
	 - isearch-update                                             7   0%
	  - isearch-lazy-highlight-new-loop                           7   0%
	   - sit-for                                                  7   0%
	    - redisplay                                               7   0%
	       redisplay_internal (C function)                        1   0%
     - execute-extended-command                                       1   0%
      - command-execute                                               1   0%
       - call-interactively                                           1   0%
	- funcall-interactively                                       1   0%
	   profiler-start                                             1   0%
     - minibuffer-complete                                            1   0%
      - completion-in-region                                          1   0%
       - completion--in-region                                        1   0%
	- #<compiled 0x145b655>                                       1   0%
	 - apply                                                      1   0%
	  - #<compiled 0x4bd08b>                                      1   0%
	   - completion--in-region-1                                  1   0%
	    - completion--do-completion                               1   0%
	     - completion-try-completion                              1   0%
	      - completion--nth-completion                            1   0%
	       - completion--some                                     1   0%
		- funcall                                             1   0%
		 - #<compiled 0x145b677>                              1   0%
		  - #<compiled 0x145b669>                             1   0%
		     completion-basic-try-completion                  1   0%
  - ...                                                              36   5%
     Automatic GC                                                    36   5%