view src/testdir/bench_re_freeze.vim @ 16831:f42aa3d90b12 v8.1.1417

patch 8.1.1417: MS-Windows: resolve() does not resolve all components of path commit https://github.com/vim/vim/commit/1bbebab5255b5300d727c9b3f1b308205847dafd Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 29 20:36:54 2019 +0200 patch 8.1.1417: MS-Windows: resolve() does not resolve all components of path Problem: MS-Windows: resolve() does not resolve all components of the path. (David Briscoe) Solution: Do not bail out for a reparse point. (Yasuhiro Matsumoto, closes #4211, closes #4447)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 May 2019 20:45:05 +0200
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