Show More
@@ -0,0 +1,14 b'' | |||||
|
1 | Prompt Rendering Performance improvements | |||
|
2 | ========================================= | |||
|
3 | ||||
|
4 | Pull Request :ghpull:`11933` introduced an optimisation in the prompt rendering | |||
|
5 | logic that should decrease the resource usage of IPython when using the | |||
|
6 | _default_ configuration but could potentially introduce a regression of | |||
|
7 | functionalities if you are using a custom prompt. | |||
|
8 | ||||
|
9 | We know assume if you haven't changed the default keybindings that the prompt | |||
|
10 | **will not change** during the duration of your input – which is for example | |||
|
11 | not true when using vi insert mode that switches between `[ins]` and `[nor]` | |||
|
12 | for the current mode. | |||
|
13 | ||||
|
14 | If you are experiencing any issue let us know. |
@@ -380,6 +380,16 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
380 | def get_message(): |
|
380 | def get_message(): | |
381 | return PygmentsTokens(self.prompts.in_prompt_tokens()) |
|
381 | return PygmentsTokens(self.prompts.in_prompt_tokens()) | |
382 |
|
382 | |||
|
383 | if self.editing_mode == 'emacs': | |||
|
384 | # with emacs mode the prompt is (usually) static, so we call only | |||
|
385 | # the function once. With VI mode it can toggle between [ins] and | |||
|
386 | # [nor] so we can't precompute. | |||
|
387 | # here I'm going to favor the default keybinding which almost | |||
|
388 | # everybody uses to decrease CPU usage. | |||
|
389 | # if we have issues with users with custom Prompts we can see how to | |||
|
390 | # work around this. | |||
|
391 | get_message = get_message() | |||
|
392 | ||||
383 | return { |
|
393 | return { | |
384 | 'complete_in_thread': False, |
|
394 | 'complete_in_thread': False, | |
385 | 'lexer':IPythonPTLexer(), |
|
395 | 'lexer':IPythonPTLexer(), |
General Comments 0
You need to be logged in to leave comments.
Login now