0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0958: compiling weird regexp pattern is very slow

Problem:    Compiling weird regexp pattern is very slow.
Solution:   When reallocating post list increase size by 50%. (Kuang-che Wu,
            closes #4012)  Make assert_inrange() accept float values.
This commit is contained in:
Bram Moolenaar
2019-02-20 22:04:32 +01:00
parent 3585671888
commit 38f08e76ac
5 changed files with 84 additions and 25 deletions

View File

@@ -130,3 +130,14 @@ func Test_range_with_newline()
call assert_equal(0, search("[ -*\\t-\\n]"))
bwipe!
endfunc
func Test_pattern_compile_speed()
if !exists('+spellcapcheck') || !has('reltime')
return
endif
let start = reltime()
" this used to be very slow, not it should be about a second
set spc=\\v(((((Nxxxxxxx&&xxxx){179})+)+)+){179}
call assert_inrange(0.01, 10.0, reltimefloat(reltime(start)))
set spc=
endfunc