diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-11 13:09:39 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-11 13:09:39 +0100 |
commit | b259cb68aa3f76d1e23b47be67d3fbeb6f6b62df (patch) | |
tree | 87fa2e003daa0f584d996ef28365b9b1bd39f5c0 /TODO | |
parent | 723b75534632a99228a7266d7579c9d8b3f0cb77 (diff) | |
download | sciteco-b259cb68aa3f76d1e23b47be67d3fbeb6f6b62df.tar.gz |
optimized command execution in batch mode, during macro calls, loops etc.
* SciTECO commands are implemented with immediate execution in mind.
Those commands that do need to execute immediately while a string
command is entered, can do so using StateExpectString::process().
For simplicity, the parser just assumed that every input character
should result in immediate execution (if the command supports it
of course).
* This lead to unnecessarily slow execution of commands like <I> or
<S> in batch mode. E.g. a search was always repeated for every
character of the pattern - a N character pattern could result in
N searches instead of one.
Also in interactive mode when executing a macro
or repeating commands in a loop, immediate processing of string arguments
is unnecessary and results in superfluous undo tokens.
* These cases are all optimized now by being informed about
the necessity of providing immediate feedback via State::refresh().
This is used by StateExpectString to defer calling process() as
long as possible.
* For states extending StateExpectString, there is no change since
they can already process arbitrarily long strings.
The optimization is hidden in StateExpectString.
* some allocations are now also avoided in StateExpectString::custom().
Diffstat (limited to 'TODO')
-rw-r--r-- | TODO | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -222,12 +222,6 @@ Optimizations: * refactor search commands (create proper base class) * refactor match-char state machine using MicroStateMachine class * simplify parser (static jump tables are unnecessary!) - * search and other commands can be significantly optimized: - in batch mode, or in loops/macros there is no need to rematch every character! - -> immediate vs. non-immediate command execution - * can be handled automatically in StateExpectString - * but it requires to be able to determine whether we're in the - command line macro stack frame and are executing the end of it. Documentation: * Code docs (Doxygen). It's slowly getting better... |