summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2023-05-28 22:55:46 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2023-06-02 22:38:32 +0200
commitb7e9d9bae301ecf1e803c133b094e0cd708b730b (patch)
tree00baccc686d5dadb56d5da3e676d77aff98d1d6f /src/input_handler.cc
parent7f950bc4a97a9eac6714573faf5928ad88d0eb4b (diff)
rc detection modeline: optimize modeline pre-filtering
modeline-parse leads by matching an expensive regex against the entire buffer, which can take a long time on huge files. Perl takes too long on this regex and it seems not even ripgrep optimizes the \z component $ ruby -e '10000.times { puts "a" * 10000 }' > big $ time rg --multiline --only-matching '\A(.+\n){1,5}|(.+\n){1,5}\z' big | wc -l 10 __________________________ Executed in 419.81 millis usr time 399.84 millis sys time 20.78 millis where $ time kak big -e q __________________________ Executed in 179.19 millis usr time 133.61 millis sys time 53.50 millis Let's lose the regex. Fixes #4911
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions