From 8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:44:24 +0200 Subject: Adding upstream version 2:8.1.0875. Signed-off-by: Daniel Baumann --- src/testdir/bench_re_freeze.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/testdir/bench_re_freeze.vim (limited to 'src/testdir/bench_re_freeze.vim') diff --git a/src/testdir/bench_re_freeze.vim b/src/testdir/bench_re_freeze.vim new file mode 100644 index 0000000..ee84438 --- /dev/null +++ b/src/testdir/bench_re_freeze.vim @@ -0,0 +1,13 @@ +"Test for benchmarking the RE engine + +so small.vim +if !has("reltime") | finish | endif +func! Measure(file, pattern, arg) + for re in range(3) + let sstart=reltime() + let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'". + \ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg) + call system(cmd. ' '. a:file) + $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart))) + endfor +endfunc -- cgit v1.2.3