view src/testdir/bench_re_freeze.vim @ 13527:b2b99d01321b v8.0.1637

patch 8.0.1637: no test for term_dumpdiff() options argument commit https://github.com/vim/vim/commit/897e63c4c0623078b5b39e2715b10f456a2453e7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 24 17:16:33 2018 +0100 patch 8.0.1637: no test for term_dumpdiff() options argument Problem: No test for term_dumpdiff() options argument. Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Mar 2018 17:30:07 +0100
parents adfbffe1e642
children
line wrap: on
line source

"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