Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance of preoutput filter seems to grow exponentially to length of line. #28

Closed
zenspider opened this issue Apr 26, 2019 · 8 comments

Comments

@zenspider
Copy link

- comint-output-filter                                           1276  69%
 - font-lock-prepend-text-property                                472  25%
  - put-text-property                                             442  24%
     jit-lock-after-change                                        437  23%
     undo-auto--undoable-change                                     2   0%
 - font-lock--remove-face-from-text-property                      470  25%
  - put-text-property                                             456  24%
     jit-lock-after-change                                        453  24%
     undo-auto--undoable-change                                     1   0%
 - run-hook-with-args                                             320  17%
    comint-postoutput-scroll-to-bottom                            320  17%
   xterm-color-filter                                              11   0%

Repro:

ruby -rminitest/autorun -rminitest/pride -e 'describe :X do 2000.times do it do end end end'

should reproduce on any system w/ ruby installed. If you don't have access to that, I can probably whip up a static file. This script should run in about a quarter second on a reasonable machine.

@zenspider
Copy link
Author

I should add... I tried to swap this over to the regular comint-output-filter-functions hook, but it just leaves the raw codes in the output. It runs faster, but there's ~18x more output and it is unreadable.

@atomontage
Copy link
Owner

atomontage commented Apr 27, 2019 via email

@atomontage
Copy link
Owner

atomontage commented Apr 27, 2019 via email

@atomontage
Copy link
Owner

atomontage commented Apr 27, 2019 via email

@atomontage
Copy link
Owner

atomontage commented Apr 27, 2019 via email

@zenspider
Copy link
Author

Here's some of my config data:

;;;;;;
;; Timing data:

;; running:
;; time ruby -rminitest/autorun -rminitest/pride -e 'describe :X do 2000.times do it do end end end'

;;; without minitest/pride
;;  font-lock: 0.24s
;; -font-lock: 0.24s

;;; with minitest/pride:
;; DUMB      font-lock: 13.8s
;; DUMB-256  font-lock:  7.6s
;; DUMB     -font-lock:  1.4s
;; DUMB-256 -font-lock:  2.1s

;;; with xterm-color   minitest/pride:
;; DUMB     -font-lock: 3.4s
;; DUMB-256 -font-lock: 4.0s

;;; with xterm-color   minitest/pride -scroll-to-bottom:
;; DUMB     -font-lock: 1.6s
;; DUMB-256 -font-lock: 1.8s

;; 1000: 0.985s
;; 2000: 2.356s
;; 3000: 4.445s
;; 4000: 6.781s
;;
;; linear fit w/ RR = 0.9873

1.6s is a far cry from 0.25s... but it'll do.

I think I'm also going to experiment with making my own output filter to break up long lines that fit this pattern. Not sure if that'll help, but it seems necessary since I use comint-scroll-to-bottom in my compilation buffers (like my autotest.el).

@zenspider
Copy link
Author

I just experimented with (setq ansi-color-for-comint-mode 'filter) and the times were also linear and only slightly faster than xterm-color. So I'm going to mix and match based on whether I need scroll-to-bottom. I'm leaving font-lock off regardless.

Thank you for poking at this and making suggestions for my config.

I guess the only thing that should come out of this is some extra doco suggesting that font-lock be turned off and possibly scroll-to-bottom removed?

@atomontage
Copy link
Owner

Updated docs and linked to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants