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:
@@ -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
|
||||
|
Reference in New Issue
Block a user