1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-25 21:16:38 +03:00
kakoune/rc
Johannes Altmanninger b7e9d9bae3 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
2023-06-02 22:38:32 +02:00
..
detection rc detection modeline: optimize modeline pre-filtering 2023-06-02 22:38:32 +02:00
filetype Merge remote-tracking branch 'poweredbypie/master' 2023-05-10 20:08:12 +10:00
tools git.kak: Use gawk's strftime instead of shelling out to date 2023-05-30 13:01:56 +10:00
windowing Merge remote-tracking branch 'Frojdholm/rc-windowing-kitty-window-id' 2023-05-10 19:54:12 +10:00