Compare commits

...

16 Commits

Author SHA1 Message Date
Andrew Gallant
7cd02e9b7e update Cargo.toml description 2016-09-13 21:16:29 -04:00
Andrew Gallant
5fdfae2f15 add readme 2016-09-13 21:15:10 -04:00
Andrew Gallant
7057ee91de update grep Cargo.toml 2016-09-13 21:13:33 -04:00
Andrew Gallant
fdca74148d Stream results when feasible.
For example, when only a single file (or stdin) is being searched, then we
should be able to print directly to the terminal instead of intermediate
buffers. (The buffers are only necessary for parallelism.)

Closes #4.
2016-09-13 21:11:46 -04:00
Andrew Gallant
f11d9fb922 Add a word benchmark.
Add ag to case insensitive benchmark.
2016-09-12 19:35:59 -04:00
Andrew Gallant
1115c23a4c fix typos 2016-09-11 19:50:16 -04:00
Andrew Gallant
8c5eaa40b2 teaser 2016-09-11 19:27:50 -04:00
Andrew Gallant
3c05954c86 initial set of benchmarks 2016-09-11 19:06:16 -04:00
Andrew Gallant
cf3a33cea7 commit Cargo.lock 2016-09-11 19:06:05 -04:00
Andrew Gallant
8aa2ba3eb1 update gitignore 2016-09-11 19:05:53 -04:00
Andrew Gallant
466cd70a8e More benchmarks for subtitle corpus. 2016-09-11 18:52:53 -04:00
Andrew Gallant
954fbeb1d8 Update regex. 2016-09-11 18:52:42 -04:00
Andrew Gallant
68fa50709e Don't skip the first arg.
Docopt will do it for us.
2016-09-11 13:33:25 -04:00
Andrew Gallant
ab91e4b874 Don't panic when an argument is invalid UTF-8.
Suggest a workaround.
2016-09-11 13:27:08 -04:00
Andrew Gallant
2b943eda47 Make file type filtering a lot faster.
We do this by avoiding using a RegexSet (*sigh*). In particular, file
type matching has much simpler semantics than gitignore files, so we don't
actually need to care which file type matched. Therefore, we can get away
with a single regex with a giant alternation.
2016-09-11 13:26:53 -04:00
Andrew Gallant
37544c092f We don't need regex-syntax directly in ripgrep. 2016-09-11 13:25:37 -04:00
22 changed files with 1585 additions and 745 deletions

12
.gitignore vendored
View File

@@ -1,14 +1,4 @@
.*.swp
tags
target
*.lock
tmp
*.csv
*.fst
*-got
*.csv.idx
words
98m*
dict
test
months
/grep/Cargo.lock

243
Cargo.lock generated Normal file
View File

@@ -0,0 +1,243 @@
[root]
name = "ripgrep"
version = "0.1.0"
dependencies = [
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"docopt 0.6.83 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"grep 0.1.0",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "aho-corasick"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crossbeam"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "docopt"
version = "0.6.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "env_logger"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fs2"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glob"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "grep"
version = "0.1.0"
dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "memchr"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memmap"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fs2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num_cpus"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "0.1.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-serialize"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "simd"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "strsim"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "term"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread-id"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "utf8-ranges"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "walkdir"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
"checksum docopt 0.6.83 (registry+https://github.com/rust-lang/crates.io-index)" = "fc42c6077823a361410c37d47c2535b73a190cbe10838dc4f400fe87c10c8c3b"
"checksum env_logger 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "82dcb9ceed3868a03b335657b85a159736c961900f7e7747d3b0b97b9ccb5ccb"
"checksum fs2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bcd414e5a1a979b931bb92f41b7a54106d3f6d2e6c253e9ce943b7cd468251ef"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f"
"checksum libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "408014cace30ee0f767b1c4517980646a573ec61a57957aeeabcac8ac0a02e8d"
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
"checksum memmap 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f20f72ed93291a72e22e8b16bb18762183bb4943f0f483da5b8be1a9e8192752"
"checksum num_cpus 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a859041cbf7a70ea1ece4b87d1a2c6ef364dcb68749c88db1f97304b9ec09d5f"
"checksum regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)" = "63b49f873f36ddc838d773972511e5fed2ef7350885af07d58e2f48ce8073dcd"
"checksum regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279401017ae31cf4e15344aa3f085d0e2e5c1e70067289ef906906fdbe92c8fd"
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
"checksum simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5847c2d766ca7ce7227672850955802fabd779ba616aeabead4c2c3877023"
"checksum strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "50c069df92e4b01425a8bf3576d5d417943a6a7272fbabaf5bd80b1aaa76442e"
"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a"
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
"checksum thread_local 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "55dd963dbaeadc08aa7266bf7f91c3154a7805e32bb94b820b769d2ef3b4744d"
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
"checksum walkdir 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d42144c31c9909882ce76e696b306b88a5b091721251137d5d522d1ef3da7cf9"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

View File

@@ -1,10 +1,10 @@
[package]
publish = false
name = "ripgrep"
version = "0.1.0" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
Line oriented search tool using Rust's regex library.
Line oriented search tool using Rust's regex library. Combines the raw
performance of grep with the usability of the silver searcher.
"""
documentation = "https://github.com/BurntSushi/ripgrep"
homepage = "https://github.com/BurntSushi/ripgrep"
@@ -33,8 +33,7 @@ log = "0.3"
memchr = "0.1"
memmap = "0.2"
num_cpus = "1"
regex = "0.1.75"
regex-syntax = "0.3.5"
regex = "0.1.76"
rustc-serialize = "0.3"
term = "0.4"
thread_local = "0.2"

View File

@@ -1,5 +1,3 @@
rep
---
A faster `grep`, written in Rust using the
[`regex`](https://github.com/rust-lang-nursery/regex)
crate.
ripgrep (rg)
------------
ripgrep combines the usability of the silver searcher with the raw speed of grep.

View File

@@ -23,6 +23,7 @@ import time
SUBTITLES_DIR = 'subtitles'
SUBTITLES_EN_NAME = 'OpenSubtitles2016.raw.en'
SUBTITLES_EN_NAME_SAMPLE = 'OpenSubtitles2016.raw.sample.en'
SUBTITLES_EN_NAME_GZ = '%s.gz' % SUBTITLES_EN_NAME
SUBTITLES_EN_URL = 'http://opus.lingfil.uu.se/OpenSubtitles2016/mono/OpenSubtitles2016.raw.en.gz'
SUBTITLES_RU_NAME = 'OpenSubtitles2016.raw.ru'
@@ -32,6 +33,12 @@ SUBTITLES_RU_URL = 'http://opus.lingfil.uu.se/OpenSubtitles2016/mono/OpenSubtitl
LINUX_DIR = 'linux'
LINUX_CLONE = 'git://github.com/BurntSushi/linux'
# Grep takes locale settings from the environment. There is a *substantial*
# performance impact for enabling Unicode, so we need to handle this explicitly
# in our benchmarks.
GREP_ASCII = {'LC_ALL': 'C'}
GREP_UNICODE = {'LC_ALL': 'en_US.UTF-8'}
def bench_linux_literal_default(suite_dir):
'''
@@ -320,10 +327,10 @@ def bench_linux_no_literal(suite_dir):
return Benchmark(pattern=pat, commands=[
mkcmd('rg', ['rg', '-n', pat]),
mkcmd('rg-novcs', ['rg', '--no-ignore', '-n', pat]),
mkcmd('rg-whitelist', ['rg', '-tall', '--no-ignore', '-n', pat]),
mkcmd('rg (no Unicode)', ['rg', '-n', '(?-u)' + pat]),
mkcmd('rg-novcs (no Unicode)', [
'rg', '--no-ignore', '-n', '(?-u)' + pat,
mkcmd('rg-whitelist (no Unicode)', [
'rg', '-tall', '--no-ignore', '-n', '(?-u)' + pat,
]),
mkcmd('ag (no Unicode)', ['ag', '-s', pat]),
mkcmd('ag-novcs (no Unicode)', [
@@ -411,18 +418,164 @@ def bench_linux_alternates_casei(suite_dir):
])
# BREADCRUMBS(burntsushi): We should benchmark an alternation for `linux` as
# well.
def bench_sherlock(suite_dir):
'TODO: Fix this and add more single file benchmarks.'
def bench_subtitles_en_literal(suite_dir):
'''
Benchmark the speed of an ASCII string literal.
'''
require(suite_dir, 'subtitles-en')
en = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_EN_NAME)
pat = 'Sherlock'
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_EN_NAME_SAMPLE)
pat = 'Sherlock Holmes'
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', pat, en]),
Command('grep', ['grep', '-a', pat, en])
Command('rg', ['rg', '-n', pat, ru]),
Command('rg (no line numbers)', ['rg', pat, ru]),
Command('ag', ['ag', '-s', pat, ru]),
Command('ucg', ['ucg', '--nosmart-case', pat, ru]),
Command('grep', ['grep', '-an', pat, ru], env=GREP_ASCII),
Command('grep (no line numbers)', [
'grep', '-a', pat, ru,
], env=GREP_ASCII),
Command('pt', ['pt', pat, ru]),
Command('pt (no line numbers)', ['pt', '-N', pat, ru]),
Command('sift', ['sift', '-n', pat, ru]),
Command('sift (no line numbers)', ['sift', pat, ru]),
])
def bench_subtitles_ru_literal(suite_dir):
'''
Benchmark the speed of a Unicode-y string literal.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = 'Шерлок Холмс' # Sherlock Holmes
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-n', pat, ru]),
Command('rg (no line numbers)', ['rg', pat, ru]),
Command('ag', ['ag', '-s', pat, ru]),
Command('ucg', ['ucg', '--nosmart-case', pat, ru]),
Command('grep', ['grep', '-an', pat, ru], env=GREP_ASCII),
Command('grep (no line numbers)', [
'grep', '-a', pat, ru,
], env=GREP_ASCII),
Command('pt', ['pt', pat, ru]),
Command('pt (no line numbers)', ['pt', '-N', pat, ru]),
Command('sift', ['sift', '-n', pat, ru]),
Command('sift (no line numbers)', ['sift', pat, ru]),
])
def bench_subtitles_ru_literal_casei(suite_dir):
'''
Benchmark the speed of a Unicode-y string case insensitively.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = 'Шерлок Холмс' # Sherlock Holmes
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-n', '-i', pat, ru]),
Command('ag (not Unicode)', ['ag', '-i', pat, ru]),
Command('ucg (not Unicode)', ['ucg', '-i', pat, ru]),
Command('grep', ['grep', '-ani', pat, ru], env=GREP_UNICODE),
Command('grep (not Unicode)', [
'grep', '-E', '-ani', pat, ru,
], env=GREP_ASCII),
])
def bench_subtitles_ru_literal_word(suite_dir):
'''
Benchmark the speed of finding a literal inside word boundaries.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = 'Шерлок Холмс' # Sherlock Holmes
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-nw', pat, ru]),
Command('rg (not Unicode)', [
'rg', '-n', r'(?-u:\b)' + pat + r'(?-u:\b)', ru,
]),
Command('ag (not Unicode)', ['ag', '-sw', pat, ru]),
Command('ucg (not Unicode)', ['ucg', '--nosmart-case', pat, ru]),
Command('grep (not Unicode)', [
'grep', '-anw', pat, ru,
], env=GREP_ASCII),
Command('grep', ['grep', '-anw', pat, ru], env=GREP_UNICODE),
])
def bench_subtitles_ru_alternate(suite_dir):
'''
Benchmark the speed of a set of alternate literals.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = '|'.join([
'Шерлок Холмс', # Sherlock Holmes
'Джон Уотсон', # John Watson
'Ирен Адлер', # Irene Adler
'инспектор Лестрейд', # Inspector Lestrade
'профессор Мориарти', # Professor Moriarty
])
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-n', pat, ru]),
Command('rg (no line numbers)', ['rg', pat, ru]),
Command('ucg', ['ucg', '--nosmart-case', pat, ru]),
Command('grep', ['grep', '-E', '-an', pat, ru], env=GREP_ASCII),
Command('grep (no line numbers)', [
'grep', '-E', '-a', pat, ru,
], env=GREP_ASCII),
])
def bench_subtitles_ru_alternate_casei(suite_dir):
'''
Benchmark the speed of a set of alternate literals.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = '|'.join([
'Шерлок Холмс', # Sherlock Holmes
'Джон Уотсон', # John Watson
'Ирен Адлер', # Irene Adler
'инспектор Лестрейд', # Inspector Lestrade
'профессор Мориарти', # Professor Moriarty
])
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-n', '-i', pat, ru]),
Command('ucg (not Unicode)', ['ucg', '-i', pat, ru]),
Command('grep', ['grep', '-E', '-ani', pat, ru], env=GREP_UNICODE),
Command('grep (not Unicode)', [
'grep', '-E', '-ani', pat, ru,
], env=GREP_ASCII),
])
def bench_subtitles_ru_no_literal(suite_dir):
'''
Benchmark the speed of a regex with no literals.
Note that we don't even try to run grep with Unicode support
on this one. While it should eventually get the right answer,
I killed it after it had already been running for two minutes
and showed no signs of finishing soon.
'''
require(suite_dir, 'subtitles-ru')
ru = path.join(suite_dir, SUBTITLES_DIR, SUBTITLES_RU_NAME)
pat = r'\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}'
return Benchmark(pattern=pat, commands=[
Command('rg', ['rg', '-n', pat, ru]),
Command('rg (no line numbers)', ['rg', pat, ru]),
Command('ucg (no Unicode)', ['ucg', '--nosmart-case', pat, ru]),
Command('grep (no Unicode)', [
'grep', '-E', '-an', pat, ru,
], env=GREP_ASCII),
])
@@ -723,6 +876,7 @@ def download_subtitles_en(suite_dir):
subtitle_dir = path.join(suite_dir, SUBTITLES_DIR)
en_path_gz = path.join(subtitle_dir, SUBTITLES_EN_NAME_GZ)
en_path = path.join(subtitle_dir, SUBTITLES_EN_NAME)
en_path_sample = path.join(subtitle_dir, SUBTITLES_EN_NAME_SAMPLE)
if not os.path.isdir(subtitle_dir):
os.makedirs(subtitle_dir)
@@ -730,12 +884,19 @@ def download_subtitles_en(suite_dir):
if not os.path.exists(en_path_gz):
run_cmd(['curl', '-LO', SUBTITLES_EN_URL], cwd=subtitle_dir)
run_cmd(['gunzip', en_path_gz], cwd=subtitle_dir)
if not os.path.exists(en_path_sample):
# Get a sample roughly the same size as the Russian corpus so that
# benchmarks finish in a reasonable time.
with open(path.join(subtitle_dir, en_path_sample), 'wb+') as f:
run_cmd(
['head', '-n', '32722372', en_path],
cwd=subtitle_dir, stdout=f)
def has_subtitles_en(suite_dir):
'Returns true if English subtitles have been downloaded.'
subtitle_dir = path.join(suite_dir, SUBTITLES_DIR)
return path.exists(path.join(subtitle_dir, SUBTITLES_EN_NAME))
return path.exists(path.join(subtitle_dir, SUBTITLES_EN_NAME_SAMPLE))
def download_subtitles_ru(suite_dir):
@@ -770,7 +931,7 @@ def download(suite_dir, choices):
A list of corpora to download. Available choices are:
all, linux, subtitles-en, subtitles-ru.
'''
for choice in args.download:
for choice in choices:
if choice == 'linux':
download_linux(suite_dir)
elif choice == 'subtitles-en':
@@ -849,7 +1010,7 @@ def main():
args = p.parse_args()
if args.download is not None and len(args.download) > 0:
download(args.dir, args.choices)
download(args.dir, args.download)
sys.exit(0)
if not path.isdir(args.dir):

343
benchsuite.raw.csv Normal file
View File

@@ -0,0 +1,343 @@
benchmark,warmup_iter,iter,name,command,duration,lines,env
linux_alternates,1,3,rg,rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.24781584739685059,68,
linux_alternates,1,3,rg,rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.23398137092590332,68,
linux_alternates,1,3,rg,rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.23497819900512695,68,
linux_alternates,1,3,rg-novcs,rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.11090731620788574,68,
linux_alternates,1,3,rg-novcs,rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.14237189292907715,68,
linux_alternates,1,3,rg-novcs,rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.11315393447875977,68,
linux_alternates,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.39145565032958984,68,
linux_alternates,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.39217114448547363,68,
linux_alternates,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.39917516708374023,68,
linux_alternates,1,3,ag,ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.4898416996002197,68,
linux_alternates,1,3,ag,ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.5078432559967041,68,
linux_alternates,1,3,ag,ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.4942047595977783,68,
linux_alternates,1,3,ag-novcs,ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.4839494228363037,68,
linux_alternates,1,3,ag-novcs,ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.4806060791015625,68,
linux_alternates,1,3,ag-novcs,ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.6986649036407471,68,
linux_alternates,1,3,ucg,ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.1494297981262207,68,
linux_alternates,1,3,ucg,ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.15127253532409668,68,
linux_alternates,1,3,ucg,ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.1573657989501953,68,
linux_alternates,1,3,git grep,git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.25092005729675293,68,LC_ALL=C
linux_alternates,1,3,git grep,git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.2663850784301758,68,LC_ALL=C
linux_alternates,1,3,git grep,git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.24485993385314941,68,LC_ALL=C
linux_alternates_casei,1,3,rg,rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.24762463569641113,160,
linux_alternates_casei,1,3,rg,rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.21982502937316895,160,
linux_alternates_casei,1,3,rg,rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.2219092845916748,160,
linux_alternates_casei,1,3,rg-novcs,rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.12809348106384277,160,
linux_alternates_casei,1,3,rg-novcs,rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.12208032608032227,160,
linux_alternates_casei,1,3,rg-novcs,rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.12648415565490723,160,
linux_alternates_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.39945435523986816,160,
linux_alternates_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.39914917945861816,160,
linux_alternates_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.3931403160095215,160,
linux_alternates_casei,1,3,ag,ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,1.26180100440979,160,
linux_alternates_casei,1,3,ag,ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.6076450347900391,160,
linux_alternates_casei,1,3,ag,ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.6092875003814697,160,
linux_alternates_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.5668354034423828,160,
linux_alternates_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.5638954639434814,160,
linux_alternates_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.6463086605072021,160,
linux_alternates_casei,1,3,ucg,ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.23877739906311035,160,
linux_alternates_casei,1,3,ucg,ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.2357316017150879,160,
linux_alternates_casei,1,3,ucg,ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.23951983451843262,160,
linux_alternates_casei,1,3,git grep,git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.8604335784912109,160,LC_ALL=C
linux_alternates_casei,1,3,git grep,git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.9313437938690186,160,LC_ALL=C
linux_alternates_casei,1,3,git grep,git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.9674036502838135,160,LC_ALL=C
linux_literal,1,3,rg,rg -n PM_RESUME,0.2203836441040039,16,
linux_literal,1,3,rg,rg -n PM_RESUME,0.21490192413330078,16,
linux_literal,1,3,rg,rg -n PM_RESUME,0.21895813941955566,16,
linux_literal,1,3,rg-novcs,rg --no-ignore -n PM_RESUME,0.10370588302612305,16,
linux_literal,1,3,rg-novcs,rg --no-ignore -n PM_RESUME,0.12161660194396973,16,
linux_literal,1,3,rg-novcs,rg --no-ignore -n PM_RESUME,0.10118246078491211,16,
linux_literal,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n PM_RESUME,0.3846700191497803,16,
linux_literal,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n PM_RESUME,0.3972609043121338,16,
linux_literal,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n PM_RESUME,0.3864939212799072,16,
linux_literal,1,3,ag,ag -s PM_RESUME,0.5170495510101318,16,
linux_literal,1,3,ag,ag -s PM_RESUME,0.5066406726837158,16,
linux_literal,1,3,ag,ag -s PM_RESUME,0.5110535621643066,16,
linux_literal,1,3,ag-novcs,ag --skip-vcs-ignores -s PM_RESUME,0.5622231960296631,16,
linux_literal,1,3,ag-novcs,ag --skip-vcs-ignores -s PM_RESUME,0.7810573577880859,16,
linux_literal,1,3,ag-novcs,ag --skip-vcs-ignores -s PM_RESUME,1.2847375869750977,16,
linux_literal,1,3,ucg,ucg --nosmart-case PM_RESUME,0.16497445106506348,16,
linux_literal,1,3,ucg,ucg --nosmart-case PM_RESUME,0.16525840759277344,16,
linux_literal,1,3,ucg,ucg --nosmart-case PM_RESUME,0.1590101718902588,16,
linux_literal,1,3,git grep,git grep -I -n PM_RESUME,0.1928420066833496,16,LC_ALL=C
linux_literal,1,3,git grep,git grep -I -n PM_RESUME,0.19345307350158691,16,LC_ALL=C
linux_literal,1,3,git grep,git grep -I -n PM_RESUME,0.1954176425933838,16,LC_ALL=C
linux_literal,1,3,pt,pt PM_RESUME,0.20350170135498047,16,
linux_literal,1,3,pt,pt PM_RESUME,0.17547011375427246,16,
linux_literal,1,3,pt,pt PM_RESUME,0.21206402778625488,16,
linux_literal,1,3,sift,sift -n --binary-skip --exclude-files .* PM_RESUME,0.14285612106323242,16,
linux_literal,1,3,sift,sift -n --binary-skip --exclude-files .* PM_RESUME,0.14221596717834473,16,
linux_literal,1,3,sift,sift -n --binary-skip --exclude-files .* PM_RESUME,0.1395282745361328,16,
linux_literal_casei,1,3,rg,rg -n -i PM_RESUME,0.32401490211486816,370,
linux_literal_casei,1,3,rg,rg -n -i PM_RESUME,0.26114439964294434,370,
linux_literal_casei,1,3,rg,rg -n -i PM_RESUME,0.21575093269348145,370,
linux_literal_casei,1,3,rg-novcs,rg --no-ignore -n -i PM_RESUME,0.13971185684204102,399,
linux_literal_casei,1,3,rg-novcs,rg --no-ignore -n -i PM_RESUME,0.11648797988891602,399,
linux_literal_casei,1,3,rg-novcs,rg --no-ignore -n -i PM_RESUME,0.11060571670532227,399,
linux_literal_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i PM_RESUME,0.41420912742614746,399,
linux_literal_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i PM_RESUME,0.3933844566345215,399,
linux_literal_casei,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -i PM_RESUME,0.4015076160430908,399,
linux_literal_casei,1,3,ag,ag -i PM_RESUME,0.45723628997802734,370,
linux_literal_casei,1,3,ag,ag -i PM_RESUME,0.41663575172424316,370,
linux_literal_casei,1,3,ag,ag -i PM_RESUME,0.4088137149810791,370,
linux_literal_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i PM_RESUME,0.44587063789367676,399,
linux_literal_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i PM_RESUME,0.45557403564453125,399,
linux_literal_casei,1,3,ag-novcs,ag --skip-vcs-ignores -i PM_RESUME,0.41840505599975586,399,
linux_literal_casei,1,3,ucg,ucg -i PM_RESUME,0.1598954200744629,370,
linux_literal_casei,1,3,ucg,ucg -i PM_RESUME,0.15562868118286133,370,
linux_literal_casei,1,3,ucg,ucg -i PM_RESUME,0.15644288063049316,370,
linux_literal_casei,1,3,git grep,git grep -I -n -i PM_RESUME,0.1857764720916748,370,LC_ALL=C
linux_literal_casei,1,3,git grep,git grep -I -n -i PM_RESUME,0.17730069160461426,370,LC_ALL=C
linux_literal_casei,1,3,git grep,git grep -I -n -i PM_RESUME,0.18560075759887695,370,LC_ALL=C
linux_literal_casei,1,3,sift,sift -n --binary-skip --exclude-files .* -i PM_RESUME,0.20816397666931152,399,
linux_literal_casei,1,3,sift,sift -n --binary-skip --exclude-files .* -i PM_RESUME,0.1995244026184082,399,
linux_literal_casei,1,3,sift,sift -n --binary-skip --exclude-files .* -i PM_RESUME,0.2000412940979004,399,
linux_literal_default,1,3,rg,rg PM_RESUME,0.21781229972839355,16,
linux_literal_default,1,3,rg,rg PM_RESUME,0.2195730209350586,16,
linux_literal_default,1,3,rg,rg PM_RESUME,0.259692907333374,16,
linux_literal_default,1,3,ag,ag PM_RESUME,0.39571118354797363,16,
linux_literal_default,1,3,ag,ag PM_RESUME,0.48991870880126953,16,
linux_literal_default,1,3,ag,ag PM_RESUME,0.49497532844543457,16,
linux_literal_default,1,3,ucg,ucg PM_RESUME,0.166459321975708,16,
linux_literal_default,1,3,ucg,ucg PM_RESUME,0.1644885540008545,16,
linux_literal_default,1,3,ucg,ucg PM_RESUME,0.16440844535827637,16,
linux_literal_default,1,3,git grep,git grep PM_RESUME,0.1860334873199463,16,LC_ALL=C
linux_literal_default,1,3,git grep,git grep PM_RESUME,0.16703486442565918,16,LC_ALL=C
linux_literal_default,1,3,git grep,git grep PM_RESUME,0.20740580558776855,16,LC_ALL=C
linux_literal_default,1,3,pt,pt PM_RESUME,0.15500974655151367,16,
linux_literal_default,1,3,pt,pt PM_RESUME,0.15694642066955566,16,
linux_literal_default,1,3,pt,pt PM_RESUME,0.15679144859313965,16,
linux_literal_default,1,3,sift,sift PM_RESUME,0.11694097518920898,16,
linux_literal_default,1,3,sift,sift PM_RESUME,0.11726593971252441,16,
linux_literal_default,1,3,sift,sift PM_RESUME,0.11739015579223633,16,
linux_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.3873450756072998,490,
linux_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.38909482955932617,490,
linux_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.4019286632537842,490,
linux_no_literal,1,3,rg-whitelist,rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.32698678970336914,419,
linux_no_literal,1,3,rg-whitelist,rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.3220486640930176,419,
linux_no_literal,1,3,rg-whitelist,rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.32451391220092773,419,
linux_no_literal,1,3,rg (no Unicode),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.2920851707458496,490,
linux_no_literal,1,3,rg (no Unicode),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.3335237503051758,490,
linux_no_literal,1,3,rg (no Unicode),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.28688979148864746,490,
linux_no_literal,1,3,rg-whitelist (no Unicode),rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.222395658493042,419,
linux_no_literal,1,3,rg-whitelist (no Unicode),rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.22271037101745605,419,
linux_no_literal,1,3,rg-whitelist (no Unicode),rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.23732328414916992,419,
linux_no_literal,1,3,ag (no Unicode),ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.7565908432006836,766,
linux_no_literal,1,3,ag (no Unicode),ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.9270203113555908,766,
linux_no_literal,1,3,ag (no Unicode),ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.7432494163513184,766,
linux_no_literal,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.6899797916412354,767,
linux_no_literal,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.7057938575744629,767,
linux_no_literal,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.7126791477203369,767,
linux_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.44383835792541504,416,
linux_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.4448375701904297,416,
linux_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.4412264823913574,416,
linux_no_literal,1,3,git grep,git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},9.985018730163574,490,LC_ALL=en_US.UTF-8
linux_no_literal,1,3,git grep,git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},9.671714782714844,490,LC_ALL=en_US.UTF-8
linux_no_literal,1,3,git grep,git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},9.0708589553833,490,LC_ALL=en_US.UTF-8
linux_no_literal,1,3,git grep (no Unicode),git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},1.9452569484710693,490,LC_ALL=C
linux_no_literal,1,3,git grep (no Unicode),git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},2.3153109550476074,490,LC_ALL=C
linux_no_literal,1,3,git grep (no Unicode),git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},1.876504898071289,490,LC_ALL=C
linux_no_literal,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},8.800794124603271,491,
linux_no_literal,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},8.91090989112854,491,
linux_no_literal,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},8.970277547836304,491,
linux_re_literal_suffix,1,3,rg,rg -n [A-Z]+_RESUME,0.21518707275390625,1652,
linux_re_literal_suffix,1,3,rg,rg -n [A-Z]+_RESUME,0.2159252166748047,1652,
linux_re_literal_suffix,1,3,rg,rg -n [A-Z]+_RESUME,0.2178945541381836,1652,
linux_re_literal_suffix,1,3,rg-novcs,rg --no-ignore -n [A-Z]+_RESUME,0.10395693778991699,1653,
linux_re_literal_suffix,1,3,rg-novcs,rg --no-ignore -n [A-Z]+_RESUME,0.101318359375,1653,
linux_re_literal_suffix,1,3,rg-novcs,rg --no-ignore -n [A-Z]+_RESUME,0.09963226318359375,1653,
linux_re_literal_suffix,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n [A-Z]+_RESUME,0.40993452072143555,1653,
linux_re_literal_suffix,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n [A-Z]+_RESUME,0.4102144241333008,1653,
linux_re_literal_suffix,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n [A-Z]+_RESUME,0.3837263584136963,1653,
linux_re_literal_suffix,1,3,ag,ag -s [A-Z]+_RESUME,1.7373137474060059,1652,
linux_re_literal_suffix,1,3,ag,ag -s [A-Z]+_RESUME,1.7011380195617676,1652,
linux_re_literal_suffix,1,3,ag,ag -s [A-Z]+_RESUME,0.7572276592254639,1652,
linux_re_literal_suffix,1,3,ag-novcs,ag --skip-vcs-ignores -s [A-Z]+_RESUME,0.5061535835266113,1653,
linux_re_literal_suffix,1,3,ag-novcs,ag --skip-vcs-ignores -s [A-Z]+_RESUME,0.5377681255340576,1653,
linux_re_literal_suffix,1,3,ag-novcs,ag --skip-vcs-ignores -s [A-Z]+_RESUME,0.5237703323364258,1653,
linux_re_literal_suffix,1,3,ucg,ucg --nosmart-case [A-Z]+_RESUME,0.13993382453918457,1630,
linux_re_literal_suffix,1,3,ucg,ucg --nosmart-case [A-Z]+_RESUME,0.14264798164367676,1630,
linux_re_literal_suffix,1,3,ucg,ucg --nosmart-case [A-Z]+_RESUME,0.1370248794555664,1630,
linux_re_literal_suffix,1,3,git grep,git grep -E -I -n [A-Z]+_RESUME,0.5916049480438232,1652,LC_ALL=C
linux_re_literal_suffix,1,3,git grep,git grep -E -I -n [A-Z]+_RESUME,0.5460302829742432,1652,LC_ALL=C
linux_re_literal_suffix,1,3,git grep,git grep -E -I -n [A-Z]+_RESUME,0.5453126430511475,1652,LC_ALL=C
linux_re_literal_suffix,1,3,sift,sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME,4.272618055343628,1653,
linux_re_literal_suffix,1,3,sift,sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME,3.953784704208374,1653,
linux_re_literal_suffix,1,3,sift,sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME,4.050055742263794,1653,
linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.2921295166015625,23,
linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.2845008373260498,23,
linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.295884370803833,23,
linux_unicode_greek,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.8051228523254395,23,
linux_unicode_greek,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.824496269226074,23,
linux_unicode_greek,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.8370847702026367,23,
linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.2810385227203369,103,
linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.3430476188659668,103,
linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.34683680534362793,103,
linux_unicode_greek_casei,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.8701119422912598,23,
linux_unicode_greek_casei,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.9307808876037598,23,
linux_unicode_greek_casei,1,3,sift,sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek},2.9754345417022705,23,
linux_unicode_word,1,3,rg,rg -n \wAh,0.21484971046447754,186,
linux_unicode_word,1,3,rg,rg -n \wAh,0.2730236053466797,186,
linux_unicode_word,1,3,rg,rg -n \wAh,0.21688318252563477,186,
linux_unicode_word,1,3,rg (no Unicode),rg -n (?-u)\wAh,0.23591041564941406,174,
linux_unicode_word,1,3,rg (no Unicode),rg -n (?-u)\wAh,0.23375535011291504,174,
linux_unicode_word,1,3,rg (no Unicode),rg -n (?-u)\wAh,0.23137831687927246,174,
linux_unicode_word,1,3,rg-novcs,rg --no-ignore -n \wAh,0.11421418190002441,186,
linux_unicode_word,1,3,rg-novcs,rg --no-ignore -n \wAh,0.11203289031982422,186,
linux_unicode_word,1,3,rg-novcs,rg --no-ignore -n \wAh,0.10834765434265137,186,
linux_unicode_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n \wAh,0.39345431327819824,186,
linux_unicode_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n \wAh,0.40348386764526367,186,
linux_unicode_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n \wAh,0.40167927742004395,186,
linux_unicode_word,1,3,ag (no Unicode),ag -s \wAh,0.9391078948974609,174,
linux_unicode_word,1,3,ag (no Unicode),ag -s \wAh,0.9322304725646973,174,
linux_unicode_word,1,3,ag (no Unicode),ag -s \wAh,0.9393062591552734,174,
linux_unicode_word,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \wAh,0.9509954452514648,174,
linux_unicode_word,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \wAh,0.9229059219360352,174,
linux_unicode_word,1,3,ag-novcs (no Unicode),ag --skip-vcs-ignores -s \wAh,0.8915724754333496,174,
linux_unicode_word,1,3,ucg (no Unicode),ucg --nosmart-case \wAh,0.1719198226928711,168,
linux_unicode_word,1,3,ucg (no Unicode),ucg --nosmart-case \wAh,0.18027615547180176,168,
linux_unicode_word,1,3,ucg (no Unicode),ucg --nosmart-case \wAh,0.17251205444335938,168,
linux_unicode_word,1,3,git grep,git grep -E -I -n \wAh,4.980919122695923,186,LC_ALL=en_US.UTF-8
linux_unicode_word,1,3,git grep,git grep -E -I -n \wAh,4.995086193084717,186,LC_ALL=en_US.UTF-8
linux_unicode_word,1,3,git grep,git grep -E -I -n \wAh,4.941043376922607,186,LC_ALL=en_US.UTF-8
linux_unicode_word,1,3,git grep (no Unicode),git grep -E -I -n \wAh,1.5811383724212646,174,LC_ALL=C
linux_unicode_word,1,3,git grep (no Unicode),git grep -E -I -n \wAh,1.5947043895721436,174,LC_ALL=C
linux_unicode_word,1,3,git grep (no Unicode),git grep -E -I -n \wAh,1.522637128829956,174,LC_ALL=C
linux_unicode_word,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \wAh,4.356529951095581,174,
linux_unicode_word,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \wAh,4.129682540893555,174,
linux_unicode_word,1,3,sift (no Unicode),sift -n --binary-skip --exclude-files .* \wAh,4.098994731903076,174,
linux_word,1,3,rg,rg -n -w PM_RESUME,0.21953463554382324,6,
linux_word,1,3,rg,rg -n -w PM_RESUME,0.2401576042175293,6,
linux_word,1,3,rg,rg -n -w PM_RESUME,0.21302008628845215,6,
linux_word,1,3,rg-novcs,rg --no-ignore -n -w PM_RESUME,0.14854192733764648,6,
linux_word,1,3,rg-novcs,rg --no-ignore -n -w PM_RESUME,0.09938955307006836,6,
linux_word,1,3,rg-novcs,rg --no-ignore -n -w PM_RESUME,0.1005239486694336,6,
linux_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -w PM_RESUME,0.3981668949127197,6,
linux_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -w PM_RESUME,0.3999497890472412,6,
linux_word,1,3,rg-novcs-mmap,rg --mmap --no-ignore -n -w PM_RESUME,0.38619542121887207,6,
linux_word,1,3,ag,ag -s -w PM_RESUME,0.6837906837463379,6,
linux_word,1,3,ag,ag -s -w PM_RESUME,0.6158981323242188,6,
linux_word,1,3,ag,ag -s -w PM_RESUME,0.41248440742492676,6,
linux_word,1,3,ag-novcs,ag --skip-vcs-ignores -s -w PM_RESUME,0.42545604705810547,6,
linux_word,1,3,ag-novcs,ag --skip-vcs-ignores -s -w PM_RESUME,0.4142575263977051,6,
linux_word,1,3,ag-novcs,ag --skip-vcs-ignores -s -w PM_RESUME,0.4717123508453369,6,
linux_word,1,3,ucg,ucg --nosmart-case -w PM_RESUME,0.1639394760131836,6,
linux_word,1,3,ucg,ucg --nosmart-case -w PM_RESUME,0.16333961486816406,6,
linux_word,1,3,ucg,ucg --nosmart-case -w PM_RESUME,0.16097497940063477,6,
linux_word,1,3,git grep,git grep -E -I -n -w PM_RESUME,0.17300987243652344,6,LC_ALL=C
linux_word,1,3,git grep,git grep -E -I -n -w PM_RESUME,0.171494722366333,6,LC_ALL=C
linux_word,1,3,git grep,git grep -E -I -n -w PM_RESUME,0.19692277908325195,6,LC_ALL=C
linux_word,1,3,sift,sift -n --binary-skip --exclude-files .* -w PM_RESUME,3.190856695175171,6,
linux_word,1,3,sift,sift -n --binary-skip --exclude-files .* -w PM_RESUME,3.1970269680023193,6,
linux_word,1,3,sift,sift -n --binary-skip --exclude-files .* -w PM_RESUME,3.094048500061035,6,
subtitles_en_literal,1,3,rg,rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.41990160942077637,629,
subtitles_en_literal,1,3,rg,rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5151379108428955,629,
subtitles_en_literal,1,3,rg,rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5245285034179688,629,
subtitles_en_literal,1,3,rg (no line numbers),rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2494678497314453,629,
subtitles_en_literal,1,3,rg (no line numbers),rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2570071220397949,629,
subtitles_en_literal,1,3,rg (no line numbers),rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.20493078231811523,629,
subtitles_en_literal,1,3,ag,ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.0035574436187744,629,
subtitles_en_literal,1,3,ag,ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.004251003265381,629,
subtitles_en_literal,1,3,ag,ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.998549222946167,629,
subtitles_en_literal,1,3,ucg,ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.750638484954834,629,
subtitles_en_literal,1,3,ucg,ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.7518937587738037,629,
subtitles_en_literal,1,3,ucg,ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.6610665321350098,629,
subtitles_en_literal,1,3,grep,grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.9856901168823242,629,LC_ALL=C
subtitles_en_literal,1,3,grep,grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.0250558853149414,629,LC_ALL=C
subtitles_en_literal,1,3,grep,grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.0195670127868652,629,LC_ALL=C
subtitles_en_literal,1,3,grep (no line numbers),grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5834128856658936,629,LC_ALL=C
subtitles_en_literal,1,3,grep (no line numbers),grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5891468524932861,629,LC_ALL=C
subtitles_en_literal,1,3,grep (no line numbers),grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5075380802154541,629,LC_ALL=C
subtitles_en_literal,1,3,pt,pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.6499581336975098,629,
subtitles_en_literal,1,3,pt,pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.667529821395874,629,
subtitles_en_literal,1,3,pt,pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.6895508766174316,629,
subtitles_en_literal,1,3,pt (no line numbers),pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.4941000938415527,629,
subtitles_en_literal,1,3,pt (no line numbers),pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.670578956604004,629,
subtitles_en_literal,1,3,pt (no line numbers),pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.6264257431030273,629,
subtitles_en_literal,1,3,sift,sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.7577519416809082,629,
subtitles_en_literal,1,3,sift,sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.7018873691558838,629,
subtitles_en_literal,1,3,sift,sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.5913088321685791,629,
subtitles_en_literal,1,3,sift (no line numbers),sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2632462978363037,629,
subtitles_en_literal,1,3,sift (no line numbers),sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2749521732330322,629,
subtitles_en_literal,1,3,sift (no line numbers),sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.27170491218566895,629,
subtitles_ru_alternate,1,3,rg,rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.6460118293762207,691,
subtitles_ru_alternate,1,3,rg,rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5819060802459717,691,
subtitles_ru_alternate,1,3,rg,rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.7640905380249023,691,
subtitles_ru_alternate,1,3,rg (no line numbers),rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.2313611507415771,691,
subtitles_ru_alternate,1,3,rg (no line numbers),rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3044109344482422,691,
subtitles_ru_alternate,1,3,rg (no line numbers),rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3338491916656494,691,
subtitles_ru_alternate,1,3,ucg,ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.3752894401550293,691,
subtitles_ru_alternate,1,3,ucg,ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.370604991912842,691,
subtitles_ru_alternate,1,3,ucg,ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.399735689163208,691,
subtitles_ru_alternate,1,3,grep,grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.716331243515015,691,LC_ALL=C
subtitles_ru_alternate,1,3,grep,grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.910337448120117,691,LC_ALL=C
subtitles_ru_alternate,1,3,grep,grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.955447435379028,691,LC_ALL=C
subtitles_ru_alternate,1,3,grep (no line numbers),grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.488590240478516,691,LC_ALL=C
subtitles_ru_alternate,1,3,grep (no line numbers),grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.247926950454712,691,LC_ALL=C
subtitles_ru_alternate,1,3,grep (no line numbers),grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.541552305221558,691,LC_ALL=C
subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,4.170270681381226,735,
subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,4.186170816421509,735,
subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,4.001753807067871,735,
subtitles_ru_alternate_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.2377853393554688,691,
subtitles_ru_alternate_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.361377477645874,691,
subtitles_ru_alternate_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.4316565990448,691,
subtitles_ru_alternate_casei,1,3,grep,grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.9808149337768555,735,LC_ALL=en_US.UTF-8
subtitles_ru_alternate_casei,1,3,grep,grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.773010015487671,735,LC_ALL=en_US.UTF-8
subtitles_ru_alternate_casei,1,3,grep,grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.952658414840698,735,LC_ALL=en_US.UTF-8
subtitles_ru_alternate_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.799196481704712,691,LC_ALL=C
subtitles_ru_alternate_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.990447282791138,691,LC_ALL=C
subtitles_ru_alternate_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.916130781173706,691,LC_ALL=C
subtitles_ru_literal,1,3,rg,rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.824413537979126,583,
subtitles_ru_literal,1,3,rg,rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.8357686996459961,583,
subtitles_ru_literal,1,3,rg,rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.8958892822265625,583,
subtitles_ru_literal,1,3,rg (no line numbers),rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.2959728240966797,583,
subtitles_ru_literal,1,3,rg (no line numbers),rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3027801513671875,583,
subtitles_ru_literal,1,3,rg (no line numbers),rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3133840560913086,583,
subtitles_ru_literal,1,3,ag,ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.8583695888519287,583,
subtitles_ru_literal,1,3,ag,ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.0803942680358887,583,
subtitles_ru_literal,1,3,ag,ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.092284679412842,583,
subtitles_ru_literal,1,3,ucg,ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5811631679534912,583,
subtitles_ru_literal,1,3,ucg,ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5879406929016113,583,
subtitles_ru_literal,1,3,ucg,ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5010735988616943,583,
subtitles_ru_literal,1,3,grep,grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3335914611816406,583,LC_ALL=C
subtitles_ru_literal,1,3,grep,grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3385870456695557,583,LC_ALL=C
subtitles_ru_literal,1,3,grep,grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3321411609649658,583,LC_ALL=C
subtitles_ru_literal,1,3,grep (no line numbers),grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.8784911632537842,583,LC_ALL=C
subtitles_ru_literal,1,3,grep (no line numbers),grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.8721048831939697,583,LC_ALL=C
subtitles_ru_literal,1,3,grep (no line numbers),grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.8763093948364258,583,LC_ALL=C
subtitles_ru_literal,1,3,pt,pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,5.429335355758667,583,
subtitles_ru_literal,1,3,pt,pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,4.938883543014526,583,
subtitles_ru_literal,1,3,pt,pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,5.5893049240112305,583,
subtitles_ru_literal,1,3,pt (no line numbers),pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,5.522632598876953,583,
subtitles_ru_literal,1,3,pt (no line numbers),pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,5.237533330917358,583,
subtitles_ru_literal,1,3,pt (no line numbers),pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,5.215710401535034,583,
subtitles_ru_literal,1,3,sift,sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.944578170776367,583,
subtitles_ru_literal,1,3,sift,sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.835101127624512,583,
subtitles_ru_literal,1,3,sift,sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.847816228866577,583,
subtitles_ru_literal,1,3,sift (no line numbers),sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.25161075592041,583,
subtitles_ru_literal,1,3,sift (no line numbers),sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.299700736999512,583,
subtitles_ru_literal,1,3,sift (no line numbers),sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.38068151473999,583,
subtitles_ru_literal_casei,1,3,rg,rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.6576766967773438,604,
subtitles_ru_literal_casei,1,3,rg,rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.4723634719848633,604,
subtitles_ru_literal_casei,1,3,rg,rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.775054931640625,604,
subtitles_ru_literal_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5934054851531982,583,
subtitles_ru_literal_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.597702980041504,583,
subtitles_ru_literal_casei,1,3,ucg (not Unicode),ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.5229814052581787,583,
subtitles_ru_literal_casei,1,3,grep,grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.458112478256226,604,LC_ALL=en_US.UTF-8
subtitles_ru_literal_casei,1,3,grep,grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.91841197013855,604,LC_ALL=en_US.UTF-8
subtitles_ru_literal_casei,1,3,grep,grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,6.809293508529663,604,LC_ALL=en_US.UTF-8
subtitles_ru_literal_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3416473865509033,583,LC_ALL=C
subtitles_ru_literal_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.1377508640289307,583,LC_ALL=C
subtitles_ru_literal_casei,1,3,grep (not Unicode),grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.146819829940796,583,LC_ALL=C
subtitles_ru_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.7402286529541016,41,
subtitles_ru_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.872703790664673,41,
subtitles_ru_no_literal,1,3,rg,rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.8877029418945312,41,
subtitles_ru_no_literal,1,3,rg (no line numbers),rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.414641857147217,41,
subtitles_ru_no_literal,1,3,rg (no line numbers),rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.4537253379821777,41,
subtitles_ru_no_literal,1,3,rg (no line numbers),rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.460618019104004,41,
subtitles_ru_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.290541648864746,,
subtitles_ru_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.311371088027954,,
subtitles_ru_no_literal,1,3,ucg (no Unicode),ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.1349129676818848,,
subtitles_ru_no_literal,1,3,grep (no Unicode),grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.8941442966461182,,LC_ALL=C
subtitles_ru_no_literal,1,3,grep (no Unicode),grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.8850946426391602,,LC_ALL=C
subtitles_ru_no_literal,1,3,grep (no Unicode),grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru,2.074228525161743,,LC_ALL=C
1 benchmark warmup_iter iter name command duration lines env
2 linux_alternates 1 3 rg rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.24781584739685059 68
3 linux_alternates 1 3 rg rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.23398137092590332 68
4 linux_alternates 1 3 rg rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.23497819900512695 68
5 linux_alternates 1 3 rg-novcs rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.11090731620788574 68
6 linux_alternates 1 3 rg-novcs rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.14237189292907715 68
7 linux_alternates 1 3 rg-novcs rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.11315393447875977 68
8 linux_alternates 1 3 rg-novcs-mmap rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.39145565032958984 68
9 linux_alternates 1 3 rg-novcs-mmap rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.39217114448547363 68
10 linux_alternates 1 3 rg-novcs-mmap rg --mmap --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.39917516708374023 68
11 linux_alternates 1 3 ag ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.4898416996002197 68
12 linux_alternates 1 3 ag ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.5078432559967041 68
13 linux_alternates 1 3 ag ag -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.4942047595977783 68
14 linux_alternates 1 3 ag-novcs ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.4839494228363037 68
15 linux_alternates 1 3 ag-novcs ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.4806060791015625 68
16 linux_alternates 1 3 ag-novcs ag --skip-vcs-ignores -s ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.6986649036407471 68
17 linux_alternates 1 3 ucg ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.1494297981262207 68
18 linux_alternates 1 3 ucg ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.15127253532409668 68
19 linux_alternates 1 3 ucg ucg --nosmart-case ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.1573657989501953 68
20 linux_alternates 1 3 git grep git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.25092005729675293 68 LC_ALL=C
21 linux_alternates 1 3 git grep git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.2663850784301758 68 LC_ALL=C
22 linux_alternates 1 3 git grep git grep -E -I -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.24485993385314941 68 LC_ALL=C
23 linux_alternates_casei 1 3 rg rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.24762463569641113 160
24 linux_alternates_casei 1 3 rg rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.21982502937316895 160
25 linux_alternates_casei 1 3 rg rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.2219092845916748 160
26 linux_alternates_casei 1 3 rg-novcs rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.12809348106384277 160
27 linux_alternates_casei 1 3 rg-novcs rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.12208032608032227 160
28 linux_alternates_casei 1 3 rg-novcs rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.12648415565490723 160
29 linux_alternates_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.39945435523986816 160
30 linux_alternates_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.39914917945861816 160
31 linux_alternates_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.3931403160095215 160
32 linux_alternates_casei 1 3 ag ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 1.26180100440979 160
33 linux_alternates_casei 1 3 ag ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.6076450347900391 160
34 linux_alternates_casei 1 3 ag ag -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.6092875003814697 160
35 linux_alternates_casei 1 3 ag-novcs ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.5668354034423828 160
36 linux_alternates_casei 1 3 ag-novcs ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.5638954639434814 160
37 linux_alternates_casei 1 3 ag-novcs ag --skip-vcs-ignores -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.6463086605072021 160
38 linux_alternates_casei 1 3 ucg ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.23877739906311035 160
39 linux_alternates_casei 1 3 ucg ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.2357316017150879 160
40 linux_alternates_casei 1 3 ucg ucg -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.23951983451843262 160
41 linux_alternates_casei 1 3 git grep git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.8604335784912109 160 LC_ALL=C
42 linux_alternates_casei 1 3 git grep git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.9313437938690186 160 LC_ALL=C
43 linux_alternates_casei 1 3 git grep git grep -E -I -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT 0.9674036502838135 160 LC_ALL=C
44 linux_literal 1 3 rg rg -n PM_RESUME 0.2203836441040039 16
45 linux_literal 1 3 rg rg -n PM_RESUME 0.21490192413330078 16
46 linux_literal 1 3 rg rg -n PM_RESUME 0.21895813941955566 16
47 linux_literal 1 3 rg-novcs rg --no-ignore -n PM_RESUME 0.10370588302612305 16
48 linux_literal 1 3 rg-novcs rg --no-ignore -n PM_RESUME 0.12161660194396973 16
49 linux_literal 1 3 rg-novcs rg --no-ignore -n PM_RESUME 0.10118246078491211 16
50 linux_literal 1 3 rg-novcs-mmap rg --mmap --no-ignore -n PM_RESUME 0.3846700191497803 16
51 linux_literal 1 3 rg-novcs-mmap rg --mmap --no-ignore -n PM_RESUME 0.3972609043121338 16
52 linux_literal 1 3 rg-novcs-mmap rg --mmap --no-ignore -n PM_RESUME 0.3864939212799072 16
53 linux_literal 1 3 ag ag -s PM_RESUME 0.5170495510101318 16
54 linux_literal 1 3 ag ag -s PM_RESUME 0.5066406726837158 16
55 linux_literal 1 3 ag ag -s PM_RESUME 0.5110535621643066 16
56 linux_literal 1 3 ag-novcs ag --skip-vcs-ignores -s PM_RESUME 0.5622231960296631 16
57 linux_literal 1 3 ag-novcs ag --skip-vcs-ignores -s PM_RESUME 0.7810573577880859 16
58 linux_literal 1 3 ag-novcs ag --skip-vcs-ignores -s PM_RESUME 1.2847375869750977 16
59 linux_literal 1 3 ucg ucg --nosmart-case PM_RESUME 0.16497445106506348 16
60 linux_literal 1 3 ucg ucg --nosmart-case PM_RESUME 0.16525840759277344 16
61 linux_literal 1 3 ucg ucg --nosmart-case PM_RESUME 0.1590101718902588 16
62 linux_literal 1 3 git grep git grep -I -n PM_RESUME 0.1928420066833496 16 LC_ALL=C
63 linux_literal 1 3 git grep git grep -I -n PM_RESUME 0.19345307350158691 16 LC_ALL=C
64 linux_literal 1 3 git grep git grep -I -n PM_RESUME 0.1954176425933838 16 LC_ALL=C
65 linux_literal 1 3 pt pt PM_RESUME 0.20350170135498047 16
66 linux_literal 1 3 pt pt PM_RESUME 0.17547011375427246 16
67 linux_literal 1 3 pt pt PM_RESUME 0.21206402778625488 16
68 linux_literal 1 3 sift sift -n --binary-skip --exclude-files .* PM_RESUME 0.14285612106323242 16
69 linux_literal 1 3 sift sift -n --binary-skip --exclude-files .* PM_RESUME 0.14221596717834473 16
70 linux_literal 1 3 sift sift -n --binary-skip --exclude-files .* PM_RESUME 0.1395282745361328 16
71 linux_literal_casei 1 3 rg rg -n -i PM_RESUME 0.32401490211486816 370
72 linux_literal_casei 1 3 rg rg -n -i PM_RESUME 0.26114439964294434 370
73 linux_literal_casei 1 3 rg rg -n -i PM_RESUME 0.21575093269348145 370
74 linux_literal_casei 1 3 rg-novcs rg --no-ignore -n -i PM_RESUME 0.13971185684204102 399
75 linux_literal_casei 1 3 rg-novcs rg --no-ignore -n -i PM_RESUME 0.11648797988891602 399
76 linux_literal_casei 1 3 rg-novcs rg --no-ignore -n -i PM_RESUME 0.11060571670532227 399
77 linux_literal_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i PM_RESUME 0.41420912742614746 399
78 linux_literal_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i PM_RESUME 0.3933844566345215 399
79 linux_literal_casei 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -i PM_RESUME 0.4015076160430908 399
80 linux_literal_casei 1 3 ag ag -i PM_RESUME 0.45723628997802734 370
81 linux_literal_casei 1 3 ag ag -i PM_RESUME 0.41663575172424316 370
82 linux_literal_casei 1 3 ag ag -i PM_RESUME 0.4088137149810791 370
83 linux_literal_casei 1 3 ag-novcs ag --skip-vcs-ignores -i PM_RESUME 0.44587063789367676 399
84 linux_literal_casei 1 3 ag-novcs ag --skip-vcs-ignores -i PM_RESUME 0.45557403564453125 399
85 linux_literal_casei 1 3 ag-novcs ag --skip-vcs-ignores -i PM_RESUME 0.41840505599975586 399
86 linux_literal_casei 1 3 ucg ucg -i PM_RESUME 0.1598954200744629 370
87 linux_literal_casei 1 3 ucg ucg -i PM_RESUME 0.15562868118286133 370
88 linux_literal_casei 1 3 ucg ucg -i PM_RESUME 0.15644288063049316 370
89 linux_literal_casei 1 3 git grep git grep -I -n -i PM_RESUME 0.1857764720916748 370 LC_ALL=C
90 linux_literal_casei 1 3 git grep git grep -I -n -i PM_RESUME 0.17730069160461426 370 LC_ALL=C
91 linux_literal_casei 1 3 git grep git grep -I -n -i PM_RESUME 0.18560075759887695 370 LC_ALL=C
92 linux_literal_casei 1 3 sift sift -n --binary-skip --exclude-files .* -i PM_RESUME 0.20816397666931152 399
93 linux_literal_casei 1 3 sift sift -n --binary-skip --exclude-files .* -i PM_RESUME 0.1995244026184082 399
94 linux_literal_casei 1 3 sift sift -n --binary-skip --exclude-files .* -i PM_RESUME 0.2000412940979004 399
95 linux_literal_default 1 3 rg rg PM_RESUME 0.21781229972839355 16
96 linux_literal_default 1 3 rg rg PM_RESUME 0.2195730209350586 16
97 linux_literal_default 1 3 rg rg PM_RESUME 0.259692907333374 16
98 linux_literal_default 1 3 ag ag PM_RESUME 0.39571118354797363 16
99 linux_literal_default 1 3 ag ag PM_RESUME 0.48991870880126953 16
100 linux_literal_default 1 3 ag ag PM_RESUME 0.49497532844543457 16
101 linux_literal_default 1 3 ucg ucg PM_RESUME 0.166459321975708 16
102 linux_literal_default 1 3 ucg ucg PM_RESUME 0.1644885540008545 16
103 linux_literal_default 1 3 ucg ucg PM_RESUME 0.16440844535827637 16
104 linux_literal_default 1 3 git grep git grep PM_RESUME 0.1860334873199463 16 LC_ALL=C
105 linux_literal_default 1 3 git grep git grep PM_RESUME 0.16703486442565918 16 LC_ALL=C
106 linux_literal_default 1 3 git grep git grep PM_RESUME 0.20740580558776855 16 LC_ALL=C
107 linux_literal_default 1 3 pt pt PM_RESUME 0.15500974655151367 16
108 linux_literal_default 1 3 pt pt PM_RESUME 0.15694642066955566 16
109 linux_literal_default 1 3 pt pt PM_RESUME 0.15679144859313965 16
110 linux_literal_default 1 3 sift sift PM_RESUME 0.11694097518920898 16
111 linux_literal_default 1 3 sift sift PM_RESUME 0.11726593971252441 16
112 linux_literal_default 1 3 sift sift PM_RESUME 0.11739015579223633 16
113 linux_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.3873450756072998 490
114 linux_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.38909482955932617 490
115 linux_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.4019286632537842 490
116 linux_no_literal 1 3 rg-whitelist rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.32698678970336914 419
117 linux_no_literal 1 3 rg-whitelist rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.3220486640930176 419
118 linux_no_literal 1 3 rg-whitelist rg -tall --no-ignore -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.32451391220092773 419
119 linux_no_literal 1 3 rg (no Unicode) rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.2920851707458496 490
120 linux_no_literal 1 3 rg (no Unicode) rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.3335237503051758 490
121 linux_no_literal 1 3 rg (no Unicode) rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.28688979148864746 490
122 linux_no_literal 1 3 rg-whitelist (no Unicode) rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.222395658493042 419
123 linux_no_literal 1 3 rg-whitelist (no Unicode) rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.22271037101745605 419
124 linux_no_literal 1 3 rg-whitelist (no Unicode) rg -tall --no-ignore -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.23732328414916992 419
125 linux_no_literal 1 3 ag (no Unicode) ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.7565908432006836 766
126 linux_no_literal 1 3 ag (no Unicode) ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.9270203113555908 766
127 linux_no_literal 1 3 ag (no Unicode) ag -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.7432494163513184 766
128 linux_no_literal 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.6899797916412354 767
129 linux_no_literal 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.7057938575744629 767
130 linux_no_literal 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.7126791477203369 767
131 linux_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.44383835792541504 416
132 linux_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.4448375701904297 416
133 linux_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 0.4412264823913574 416
134 linux_no_literal 1 3 git grep git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 9.985018730163574 490 LC_ALL=en_US.UTF-8
135 linux_no_literal 1 3 git grep git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 9.671714782714844 490 LC_ALL=en_US.UTF-8
136 linux_no_literal 1 3 git grep git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 9.0708589553833 490 LC_ALL=en_US.UTF-8
137 linux_no_literal 1 3 git grep (no Unicode) git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 1.9452569484710693 490 LC_ALL=C
138 linux_no_literal 1 3 git grep (no Unicode) git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 2.3153109550476074 490 LC_ALL=C
139 linux_no_literal 1 3 git grep (no Unicode) git grep -E -I -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 1.876504898071289 490 LC_ALL=C
140 linux_no_literal 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 8.800794124603271 491
141 linux_no_literal 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 8.91090989112854 491
142 linux_no_literal 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} 8.970277547836304 491
143 linux_re_literal_suffix 1 3 rg rg -n [A-Z]+_RESUME 0.21518707275390625 1652
144 linux_re_literal_suffix 1 3 rg rg -n [A-Z]+_RESUME 0.2159252166748047 1652
145 linux_re_literal_suffix 1 3 rg rg -n [A-Z]+_RESUME 0.2178945541381836 1652
146 linux_re_literal_suffix 1 3 rg-novcs rg --no-ignore -n [A-Z]+_RESUME 0.10395693778991699 1653
147 linux_re_literal_suffix 1 3 rg-novcs rg --no-ignore -n [A-Z]+_RESUME 0.101318359375 1653
148 linux_re_literal_suffix 1 3 rg-novcs rg --no-ignore -n [A-Z]+_RESUME 0.09963226318359375 1653
149 linux_re_literal_suffix 1 3 rg-novcs-mmap rg --mmap --no-ignore -n [A-Z]+_RESUME 0.40993452072143555 1653
150 linux_re_literal_suffix 1 3 rg-novcs-mmap rg --mmap --no-ignore -n [A-Z]+_RESUME 0.4102144241333008 1653
151 linux_re_literal_suffix 1 3 rg-novcs-mmap rg --mmap --no-ignore -n [A-Z]+_RESUME 0.3837263584136963 1653
152 linux_re_literal_suffix 1 3 ag ag -s [A-Z]+_RESUME 1.7373137474060059 1652
153 linux_re_literal_suffix 1 3 ag ag -s [A-Z]+_RESUME 1.7011380195617676 1652
154 linux_re_literal_suffix 1 3 ag ag -s [A-Z]+_RESUME 0.7572276592254639 1652
155 linux_re_literal_suffix 1 3 ag-novcs ag --skip-vcs-ignores -s [A-Z]+_RESUME 0.5061535835266113 1653
156 linux_re_literal_suffix 1 3 ag-novcs ag --skip-vcs-ignores -s [A-Z]+_RESUME 0.5377681255340576 1653
157 linux_re_literal_suffix 1 3 ag-novcs ag --skip-vcs-ignores -s [A-Z]+_RESUME 0.5237703323364258 1653
158 linux_re_literal_suffix 1 3 ucg ucg --nosmart-case [A-Z]+_RESUME 0.13993382453918457 1630
159 linux_re_literal_suffix 1 3 ucg ucg --nosmart-case [A-Z]+_RESUME 0.14264798164367676 1630
160 linux_re_literal_suffix 1 3 ucg ucg --nosmart-case [A-Z]+_RESUME 0.1370248794555664 1630
161 linux_re_literal_suffix 1 3 git grep git grep -E -I -n [A-Z]+_RESUME 0.5916049480438232 1652 LC_ALL=C
162 linux_re_literal_suffix 1 3 git grep git grep -E -I -n [A-Z]+_RESUME 0.5460302829742432 1652 LC_ALL=C
163 linux_re_literal_suffix 1 3 git grep git grep -E -I -n [A-Z]+_RESUME 0.5453126430511475 1652 LC_ALL=C
164 linux_re_literal_suffix 1 3 sift sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME 4.272618055343628 1653
165 linux_re_literal_suffix 1 3 sift sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME 3.953784704208374 1653
166 linux_re_literal_suffix 1 3 sift sift -n --binary-skip --exclude-files .* [A-Z]+_RESUME 4.050055742263794 1653
167 linux_unicode_greek 1 3 rg rg -n \p{Greek} 0.2921295166015625 23
168 linux_unicode_greek 1 3 rg rg -n \p{Greek} 0.2845008373260498 23
169 linux_unicode_greek 1 3 rg rg -n \p{Greek} 0.295884370803833 23
170 linux_unicode_greek 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.8051228523254395 23
171 linux_unicode_greek 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.824496269226074 23
172 linux_unicode_greek 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.8370847702026367 23
173 linux_unicode_greek_casei 1 3 rg rg -n -i \p{Greek} 0.2810385227203369 103
174 linux_unicode_greek_casei 1 3 rg rg -n -i \p{Greek} 0.3430476188659668 103
175 linux_unicode_greek_casei 1 3 rg rg -n -i \p{Greek} 0.34683680534362793 103
176 linux_unicode_greek_casei 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.8701119422912598 23
177 linux_unicode_greek_casei 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.9307808876037598 23
178 linux_unicode_greek_casei 1 3 sift sift -n --binary-skip --exclude-files .* --exclude-files *.pdf \p{Greek} 2.9754345417022705 23
179 linux_unicode_word 1 3 rg rg -n \wAh 0.21484971046447754 186
180 linux_unicode_word 1 3 rg rg -n \wAh 0.2730236053466797 186
181 linux_unicode_word 1 3 rg rg -n \wAh 0.21688318252563477 186
182 linux_unicode_word 1 3 rg (no Unicode) rg -n (?-u)\wAh 0.23591041564941406 174
183 linux_unicode_word 1 3 rg (no Unicode) rg -n (?-u)\wAh 0.23375535011291504 174
184 linux_unicode_word 1 3 rg (no Unicode) rg -n (?-u)\wAh 0.23137831687927246 174
185 linux_unicode_word 1 3 rg-novcs rg --no-ignore -n \wAh 0.11421418190002441 186
186 linux_unicode_word 1 3 rg-novcs rg --no-ignore -n \wAh 0.11203289031982422 186
187 linux_unicode_word 1 3 rg-novcs rg --no-ignore -n \wAh 0.10834765434265137 186
188 linux_unicode_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n \wAh 0.39345431327819824 186
189 linux_unicode_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n \wAh 0.40348386764526367 186
190 linux_unicode_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n \wAh 0.40167927742004395 186
191 linux_unicode_word 1 3 ag (no Unicode) ag -s \wAh 0.9391078948974609 174
192 linux_unicode_word 1 3 ag (no Unicode) ag -s \wAh 0.9322304725646973 174
193 linux_unicode_word 1 3 ag (no Unicode) ag -s \wAh 0.9393062591552734 174
194 linux_unicode_word 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \wAh 0.9509954452514648 174
195 linux_unicode_word 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \wAh 0.9229059219360352 174
196 linux_unicode_word 1 3 ag-novcs (no Unicode) ag --skip-vcs-ignores -s \wAh 0.8915724754333496 174
197 linux_unicode_word 1 3 ucg (no Unicode) ucg --nosmart-case \wAh 0.1719198226928711 168
198 linux_unicode_word 1 3 ucg (no Unicode) ucg --nosmart-case \wAh 0.18027615547180176 168
199 linux_unicode_word 1 3 ucg (no Unicode) ucg --nosmart-case \wAh 0.17251205444335938 168
200 linux_unicode_word 1 3 git grep git grep -E -I -n \wAh 4.980919122695923 186 LC_ALL=en_US.UTF-8
201 linux_unicode_word 1 3 git grep git grep -E -I -n \wAh 4.995086193084717 186 LC_ALL=en_US.UTF-8
202 linux_unicode_word 1 3 git grep git grep -E -I -n \wAh 4.941043376922607 186 LC_ALL=en_US.UTF-8
203 linux_unicode_word 1 3 git grep (no Unicode) git grep -E -I -n \wAh 1.5811383724212646 174 LC_ALL=C
204 linux_unicode_word 1 3 git grep (no Unicode) git grep -E -I -n \wAh 1.5947043895721436 174 LC_ALL=C
205 linux_unicode_word 1 3 git grep (no Unicode) git grep -E -I -n \wAh 1.522637128829956 174 LC_ALL=C
206 linux_unicode_word 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \wAh 4.356529951095581 174
207 linux_unicode_word 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \wAh 4.129682540893555 174
208 linux_unicode_word 1 3 sift (no Unicode) sift -n --binary-skip --exclude-files .* \wAh 4.098994731903076 174
209 linux_word 1 3 rg rg -n -w PM_RESUME 0.21953463554382324 6
210 linux_word 1 3 rg rg -n -w PM_RESUME 0.2401576042175293 6
211 linux_word 1 3 rg rg -n -w PM_RESUME 0.21302008628845215 6
212 linux_word 1 3 rg-novcs rg --no-ignore -n -w PM_RESUME 0.14854192733764648 6
213 linux_word 1 3 rg-novcs rg --no-ignore -n -w PM_RESUME 0.09938955307006836 6
214 linux_word 1 3 rg-novcs rg --no-ignore -n -w PM_RESUME 0.1005239486694336 6
215 linux_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -w PM_RESUME 0.3981668949127197 6
216 linux_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -w PM_RESUME 0.3999497890472412 6
217 linux_word 1 3 rg-novcs-mmap rg --mmap --no-ignore -n -w PM_RESUME 0.38619542121887207 6
218 linux_word 1 3 ag ag -s -w PM_RESUME 0.6837906837463379 6
219 linux_word 1 3 ag ag -s -w PM_RESUME 0.6158981323242188 6
220 linux_word 1 3 ag ag -s -w PM_RESUME 0.41248440742492676 6
221 linux_word 1 3 ag-novcs ag --skip-vcs-ignores -s -w PM_RESUME 0.42545604705810547 6
222 linux_word 1 3 ag-novcs ag --skip-vcs-ignores -s -w PM_RESUME 0.4142575263977051 6
223 linux_word 1 3 ag-novcs ag --skip-vcs-ignores -s -w PM_RESUME 0.4717123508453369 6
224 linux_word 1 3 ucg ucg --nosmart-case -w PM_RESUME 0.1639394760131836 6
225 linux_word 1 3 ucg ucg --nosmart-case -w PM_RESUME 0.16333961486816406 6
226 linux_word 1 3 ucg ucg --nosmart-case -w PM_RESUME 0.16097497940063477 6
227 linux_word 1 3 git grep git grep -E -I -n -w PM_RESUME 0.17300987243652344 6 LC_ALL=C
228 linux_word 1 3 git grep git grep -E -I -n -w PM_RESUME 0.171494722366333 6 LC_ALL=C
229 linux_word 1 3 git grep git grep -E -I -n -w PM_RESUME 0.19692277908325195 6 LC_ALL=C
230 linux_word 1 3 sift sift -n --binary-skip --exclude-files .* -w PM_RESUME 3.190856695175171 6
231 linux_word 1 3 sift sift -n --binary-skip --exclude-files .* -w PM_RESUME 3.1970269680023193 6
232 linux_word 1 3 sift sift -n --binary-skip --exclude-files .* -w PM_RESUME 3.094048500061035 6
233 subtitles_en_literal 1 3 rg rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.41990160942077637 629
234 subtitles_en_literal 1 3 rg rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5151379108428955 629
235 subtitles_en_literal 1 3 rg rg -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5245285034179688 629
236 subtitles_en_literal 1 3 rg (no line numbers) rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.2494678497314453 629
237 subtitles_en_literal 1 3 rg (no line numbers) rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.2570071220397949 629
238 subtitles_en_literal 1 3 rg (no line numbers) rg Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.20493078231811523 629
239 subtitles_en_literal 1 3 ag ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 2.0035574436187744 629
240 subtitles_en_literal 1 3 ag ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 2.004251003265381 629
241 subtitles_en_literal 1 3 ag ag -s Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.998549222946167 629
242 subtitles_en_literal 1 3 ucg ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.750638484954834 629
243 subtitles_en_literal 1 3 ucg ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.7518937587738037 629
244 subtitles_en_literal 1 3 ucg ucg --nosmart-case Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.6610665321350098 629
245 subtitles_en_literal 1 3 grep grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.9856901168823242 629 LC_ALL=C
246 subtitles_en_literal 1 3 grep grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.0250558853149414 629 LC_ALL=C
247 subtitles_en_literal 1 3 grep grep -an Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.0195670127868652 629 LC_ALL=C
248 subtitles_en_literal 1 3 grep (no line numbers) grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5834128856658936 629 LC_ALL=C
249 subtitles_en_literal 1 3 grep (no line numbers) grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5891468524932861 629 LC_ALL=C
250 subtitles_en_literal 1 3 grep (no line numbers) grep -a Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5075380802154541 629 LC_ALL=C
251 subtitles_en_literal 1 3 pt pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.6499581336975098 629
252 subtitles_en_literal 1 3 pt pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.667529821395874 629
253 subtitles_en_literal 1 3 pt pt Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.6895508766174316 629
254 subtitles_en_literal 1 3 pt (no line numbers) pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.4941000938415527 629
255 subtitles_en_literal 1 3 pt (no line numbers) pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.670578956604004 629
256 subtitles_en_literal 1 3 pt (no line numbers) pt -N Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 1.6264257431030273 629
257 subtitles_en_literal 1 3 sift sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.7577519416809082 629
258 subtitles_en_literal 1 3 sift sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.7018873691558838 629
259 subtitles_en_literal 1 3 sift sift -n Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.5913088321685791 629
260 subtitles_en_literal 1 3 sift (no line numbers) sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.2632462978363037 629
261 subtitles_en_literal 1 3 sift (no line numbers) sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.2749521732330322 629
262 subtitles_en_literal 1 3 sift (no line numbers) sift Sherlock Holmes /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en 0.27170491218566895 629
263 subtitles_ru_alternate 1 3 rg rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.6460118293762207 691
264 subtitles_ru_alternate 1 3 rg rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5819060802459717 691
265 subtitles_ru_alternate 1 3 rg rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.7640905380249023 691
266 subtitles_ru_alternate 1 3 rg (no line numbers) rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.2313611507415771 691
267 subtitles_ru_alternate 1 3 rg (no line numbers) rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3044109344482422 691
268 subtitles_ru_alternate 1 3 rg (no line numbers) rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3338491916656494 691
269 subtitles_ru_alternate 1 3 ucg ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.3752894401550293 691
270 subtitles_ru_alternate 1 3 ucg ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.370604991912842 691
271 subtitles_ru_alternate 1 3 ucg ucg --nosmart-case Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.399735689163208 691
272 subtitles_ru_alternate 1 3 grep grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.716331243515015 691 LC_ALL=C
273 subtitles_ru_alternate 1 3 grep grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.910337448120117 691 LC_ALL=C
274 subtitles_ru_alternate 1 3 grep grep -E -an Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.955447435379028 691 LC_ALL=C
275 subtitles_ru_alternate 1 3 grep (no line numbers) grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.488590240478516 691 LC_ALL=C
276 subtitles_ru_alternate 1 3 grep (no line numbers) grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.247926950454712 691 LC_ALL=C
277 subtitles_ru_alternate 1 3 grep (no line numbers) grep -E -a Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.541552305221558 691 LC_ALL=C
278 subtitles_ru_alternate_casei 1 3 rg rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 4.170270681381226 735
279 subtitles_ru_alternate_casei 1 3 rg rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 4.186170816421509 735
280 subtitles_ru_alternate_casei 1 3 rg rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 4.001753807067871 735
281 subtitles_ru_alternate_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.2377853393554688 691
282 subtitles_ru_alternate_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.361377477645874 691
283 subtitles_ru_alternate_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.4316565990448 691
284 subtitles_ru_alternate_casei 1 3 grep grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.9808149337768555 735 LC_ALL=en_US.UTF-8
285 subtitles_ru_alternate_casei 1 3 grep grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.773010015487671 735 LC_ALL=en_US.UTF-8
286 subtitles_ru_alternate_casei 1 3 grep grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.952658414840698 735 LC_ALL=en_US.UTF-8
287 subtitles_ru_alternate_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.799196481704712 691 LC_ALL=C
288 subtitles_ru_alternate_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.990447282791138 691 LC_ALL=C
289 subtitles_ru_alternate_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.916130781173706 691 LC_ALL=C
290 subtitles_ru_literal 1 3 rg rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.824413537979126 583
291 subtitles_ru_literal 1 3 rg rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.8357686996459961 583
292 subtitles_ru_literal 1 3 rg rg -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.8958892822265625 583
293 subtitles_ru_literal 1 3 rg (no line numbers) rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.2959728240966797 583
294 subtitles_ru_literal 1 3 rg (no line numbers) rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.3027801513671875 583
295 subtitles_ru_literal 1 3 rg (no line numbers) rg Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.3133840560913086 583
296 subtitles_ru_literal 1 3 ag ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.8583695888519287 583
297 subtitles_ru_literal 1 3 ag ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.0803942680358887 583
298 subtitles_ru_literal 1 3 ag ag -s Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.092284679412842 583
299 subtitles_ru_literal 1 3 ucg ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5811631679534912 583
300 subtitles_ru_literal 1 3 ucg ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5879406929016113 583
301 subtitles_ru_literal 1 3 ucg ucg --nosmart-case Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5010735988616943 583
302 subtitles_ru_literal 1 3 grep grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3335914611816406 583 LC_ALL=C
303 subtitles_ru_literal 1 3 grep grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3385870456695557 583 LC_ALL=C
304 subtitles_ru_literal 1 3 grep grep -an Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3321411609649658 583 LC_ALL=C
305 subtitles_ru_literal 1 3 grep (no line numbers) grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.8784911632537842 583 LC_ALL=C
306 subtitles_ru_literal 1 3 grep (no line numbers) grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.8721048831939697 583 LC_ALL=C
307 subtitles_ru_literal 1 3 grep (no line numbers) grep -a Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 0.8763093948364258 583 LC_ALL=C
308 subtitles_ru_literal 1 3 pt pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 5.429335355758667 583
309 subtitles_ru_literal 1 3 pt pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 4.938883543014526 583
310 subtitles_ru_literal 1 3 pt pt Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 5.5893049240112305 583
311 subtitles_ru_literal 1 3 pt (no line numbers) pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 5.522632598876953 583
312 subtitles_ru_literal 1 3 pt (no line numbers) pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 5.237533330917358 583
313 subtitles_ru_literal 1 3 pt (no line numbers) pt -N Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 5.215710401535034 583
314 subtitles_ru_literal 1 3 sift sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.944578170776367 583
315 subtitles_ru_literal 1 3 sift sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.835101127624512 583
316 subtitles_ru_literal 1 3 sift sift -n Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.847816228866577 583
317 subtitles_ru_literal 1 3 sift (no line numbers) sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.25161075592041 583
318 subtitles_ru_literal 1 3 sift (no line numbers) sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.299700736999512 583
319 subtitles_ru_literal 1 3 sift (no line numbers) sift Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.38068151473999 583
320 subtitles_ru_literal_casei 1 3 rg rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.6576766967773438 604
321 subtitles_ru_literal_casei 1 3 rg rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.4723634719848633 604
322 subtitles_ru_literal_casei 1 3 rg rg -n -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.775054931640625 604
323 subtitles_ru_literal_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5934054851531982 583
324 subtitles_ru_literal_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.597702980041504 583
325 subtitles_ru_literal_casei 1 3 ucg (not Unicode) ucg -i Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.5229814052581787 583
326 subtitles_ru_literal_casei 1 3 grep grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.458112478256226 604 LC_ALL=en_US.UTF-8
327 subtitles_ru_literal_casei 1 3 grep grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.91841197013855 604 LC_ALL=en_US.UTF-8
328 subtitles_ru_literal_casei 1 3 grep grep -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 6.809293508529663 604 LC_ALL=en_US.UTF-8
329 subtitles_ru_literal_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.3416473865509033 583 LC_ALL=C
330 subtitles_ru_literal_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.1377508640289307 583 LC_ALL=C
331 subtitles_ru_literal_casei 1 3 grep (not Unicode) grep -E -ani Шерлок Холмс /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.146819829940796 583 LC_ALL=C
332 subtitles_ru_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.7402286529541016 41
333 subtitles_ru_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.872703790664673 41
334 subtitles_ru_no_literal 1 3 rg rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.8877029418945312 41
335 subtitles_ru_no_literal 1 3 rg (no line numbers) rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.414641857147217 41
336 subtitles_ru_no_literal 1 3 rg (no line numbers) rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.4537253379821777 41
337 subtitles_ru_no_literal 1 3 rg (no line numbers) rg \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 3.460618019104004 41
338 subtitles_ru_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.290541648864746
339 subtitles_ru_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.311371088027954
340 subtitles_ru_no_literal 1 3 ucg (no Unicode) ucg --nosmart-case \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.1349129676818848
341 subtitles_ru_no_literal 1 3 grep (no Unicode) grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.8941442966461182 LC_ALL=C
342 subtitles_ru_no_literal 1 3 grep (no Unicode) grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 1.8850946426391602 LC_ALL=C
343 subtitles_ru_no_literal 1 3 grep (no Unicode) grep -E -an \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /home/andrew/tmp/benchsuite/subtitles/OpenSubtitles2016.raw.ru 2.074228525161743 LC_ALL=C

164
benchsuite.summary Normal file
View File

@@ -0,0 +1,164 @@
linux_alternates (pattern: ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT)
-------------------------------------------------------------------------
rg 0.239 +/- 0.008 (lines: 68)
rg-novcs* 0.122 +/- 0.018 (lines: 68)*
rg-novcs-mmap 0.394 +/- 0.004 (lines: 68)
ag 0.497 +/- 0.009 (lines: 68)
ag-novcs 0.554 +/- 0.125 (lines: 68)
ucg 0.153 +/- 0.004 (lines: 68)
git grep 0.254 +/- 0.011 (lines: 68)
linux_alternates_casei (pattern: ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT)
-------------------------------------------------------------------------------
rg 0.230 +/- 0.015 (lines: 160)
rg-novcs* 0.126 +/- 0.003 (lines: 160)*
rg-novcs-mmap 0.397 +/- 0.004 (lines: 160)
ag 0.826 +/- 0.377 (lines: 160)
ag-novcs 0.592 +/- 0.047 (lines: 160)
ucg 0.238 +/- 0.002 (lines: 160)
git grep 0.920 +/- 0.054 (lines: 160)
linux_literal (pattern: PM_RESUME)
----------------------------------
rg 0.218 +/- 0.003 (lines: 16)
rg-novcs* 0.109 +/- 0.011 (lines: 16)*
rg-novcs-mmap 0.389 +/- 0.007 (lines: 16)
ag 0.512 +/- 0.005 (lines: 16)
ag-novcs 0.876 +/- 0.370 (lines: 16)
ucg 0.163 +/- 0.004 (lines: 16)
git grep 0.194 +/- 0.001 (lines: 16)
pt 0.197 +/- 0.019 (lines: 16)
sift 0.142 +/- 0.002 (lines: 16)
linux_literal_casei (pattern: PM_RESUME)
----------------------------------------
rg 0.267 +/- 0.054 (lines: 370)
rg-novcs* 0.122 +/- 0.015 (lines: 399)*
rg-novcs-mmap 0.403 +/- 0.010 (lines: 399)
ag 0.428 +/- 0.026 (lines: 370)
ag-novcs 0.440 +/- 0.019 (lines: 399)
ucg 0.157 +/- 0.002 (lines: 370)
git grep 0.183 +/- 0.005 (lines: 370)
sift 0.203 +/- 0.005 (lines: 399)
linux_literal_default (pattern: PM_RESUME)
------------------------------------------
rg 0.232 +/- 0.024 (lines: 16)
ag 0.460 +/- 0.056 (lines: 16)
ucg 0.165 +/- 0.001 (lines: 16)
git grep 0.187 +/- 0.020 (lines: 16)
pt 0.156 +/- 0.001 (lines: 16)
sift* 0.117 +/- 0.000 (lines: 16)*
linux_no_literal (pattern: \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5})
-----------------------------------------------------------------
rg 0.393 +/- 0.008 (lines: 490)
rg-whitelist 0.325 +/- 0.002 (lines: 419)
rg (no Unicode) 0.304 +/- 0.026 (lines: 490)
rg-whitelist (no Unicode)* 0.227 +/- 0.009 (lines: 419)*
ag (no Unicode) 0.809 +/- 0.102 (lines: 766)
ag-novcs (no Unicode) 0.703 +/- 0.012 (lines: 767)
ucg (no Unicode) 0.443 +/- 0.002 (lines: 416)
git grep 9.576 +/- 0.465 (lines: 490)
git grep (no Unicode) 2.046 +/- 0.236 (lines: 490)
sift (no Unicode) 8.894 +/- 0.086 (lines: 491)
linux_re_literal_suffix (pattern: [A-Z]+_RESUME)
------------------------------------------------
rg 0.216 +/- 0.001 (lines: 1652)
rg-novcs* 0.102 +/- 0.002 (lines: 1653)*
rg-novcs-mmap 0.401 +/- 0.015 (lines: 1653)
ag 1.399 +/- 0.556 (lines: 1652)
ag-novcs 0.523 +/- 0.016 (lines: 1653)
ucg 0.140 +/- 0.003 (lines: 1630)
git grep 0.561 +/- 0.027 (lines: 1652)
sift 4.092 +/- 0.164 (lines: 1653)
linux_unicode_greek (pattern: \p{Greek})
----------------------------------------
rg* 0.291 +/- 0.006 (lines: 23)*
sift 2.822 +/- 0.016 (lines: 23)
linux_unicode_greek_casei (pattern: \p{Greek})
----------------------------------------------
rg* 0.324 +/- 0.037 (lines: 103)*
sift 2.925 +/- 0.053 (lines: 23)
linux_unicode_word (pattern: \wAh)
----------------------------------
rg 0.235 +/- 0.033 (lines: 186)
rg (no Unicode) 0.234 +/- 0.002 (lines: 174)
rg-novcs* 0.112 +/- 0.003 (lines: 186)*
rg-novcs-mmap 0.400 +/- 0.005 (lines: 186)
ag (no Unicode) 0.937 +/- 0.004 (lines: 174)
ag-novcs (no Unicode) 0.922 +/- 0.030 (lines: 174)
ucg (no Unicode) 0.175 +/- 0.005 (lines: 168)
git grep 4.972 +/- 0.028 (lines: 186)
git grep (no Unicode) 1.566 +/- 0.038 (lines: 174)
sift (no Unicode) 4.195 +/- 0.141 (lines: 174)
linux_word (pattern: PM_RESUME)
-------------------------------
rg 0.224 +/- 0.014 (lines: 6)
rg-novcs* 0.116 +/- 0.028 (lines: 6)*
rg-novcs-mmap 0.395 +/- 0.007 (lines: 6)
ag 0.571 +/- 0.141 (lines: 6)
ag-novcs 0.437 +/- 0.030 (lines: 6)
ucg 0.163 +/- 0.002 (lines: 6)
git grep 0.180 +/- 0.014 (lines: 6)
sift 3.161 +/- 0.058 (lines: 6)
subtitles_en_literal (pattern: Sherlock Holmes)
-----------------------------------------------
rg 0.487 +/- 0.058 (lines: 629)
rg (no line numbers)* 0.237 +/- 0.028 (lines: 629)*
ag 2.002 +/- 0.003 (lines: 629)
ucg 0.721 +/- 0.052 (lines: 629)
grep 1.010 +/- 0.021 (lines: 629)
grep (no line numbers) 0.560 +/- 0.046 (lines: 629)
pt 1.669 +/- 0.020 (lines: 629)
pt (no line numbers) 1.597 +/- 0.092 (lines: 629)
sift 0.684 +/- 0.085 (lines: 629)
sift (no line numbers) 0.270 +/- 0.006 (lines: 629)
subtitles_ru_alternate (pattern: Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти)
-----------------------------------------------------------------------------------------------------------
rg 1.664 +/- 0.092 (lines: 691)
rg (no line numbers)* 1.290 +/- 0.053 (lines: 691)*
ucg 2.382 +/- 0.016 (lines: 691)
grep 6.861 +/- 0.127 (lines: 691)
grep (no line numbers) 6.426 +/- 0.156 (lines: 691)
subtitles_ru_alternate_casei (pattern: Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти)
-----------------------------------------------------------------------------------------------------------------
rg 4.119 +/- 0.102 (lines: 735)
ucg (not Unicode)* 2.344 +/- 0.098 (lines: 691)*
grep 6.902 +/- 0.113 (lines: 735)
grep (not Unicode) 6.902 +/- 0.096 (lines: 691)
subtitles_ru_literal (pattern: Шерлок Холмс)
--------------------------------------------
rg 0.852 +/- 0.038 (lines: 583)
rg (no line numbers)* 0.304 +/- 0.009 (lines: 583)*
ag 3.010 +/- 0.132 (lines: 583)
ucg 1.557 +/- 0.048 (lines: 583)
grep 1.335 +/- 0.003 (lines: 583)
grep (no line numbers) 0.876 +/- 0.003 (lines: 583)
pt 5.319 +/- 0.339 (lines: 583)
pt (no line numbers) 5.325 +/- 0.171 (lines: 583)
sift 6.876 +/- 0.060 (lines: 583)
sift (no line numbers) 6.311 +/- 0.065 (lines: 583)
subtitles_ru_literal_casei (pattern: Шерлок Холмс)
--------------------------------------------------
rg 1.635 +/- 0.153 (lines: 604)
ucg (not Unicode) 1.571 +/- 0.042 (lines: 583)
grep 6.729 +/- 0.241 (lines: 604)
grep (not Unicode)* 1.209 +/- 0.115 (lines: 583)*
subtitles_ru_no_literal (pattern: \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5})
----------------------------------------------------------------------------------------
rg 3.834 +/- 0.081 (lines: 41)
rg (no line numbers) 3.443 +/- 0.025 (lines: 41)
ucg (no Unicode) 2.246 +/- 0.096 (lines: 0)
grep (no Unicode)* 1.951 +/- 0.107 (lines: 0)*

View File

@@ -1,12 +1,11 @@
[package]
publish = false
name = "grep"
version = "0.1.0" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
Fast line oriented regex searching as a library.
"""
documentation = "https://github.com/BurntSushi/ripgrep"
documentation = "http://burntsushi.net/rustdoc/grep/"
homepage = "https://github.com/BurntSushi/ripgrep"
repository = "https://github.com/BurntSushi/ripgrep"
readme = "README.md"
@@ -17,5 +16,5 @@ license = "Unlicense/MIT"
log = "0.3"
memchr = "0.1"
memmap = "0.2"
regex = "0.1.75"
regex = "0.1.76"
regex-syntax = "0.3.5"

4
grep/README.md Normal file
View File

@@ -0,0 +1,4 @@
grep
----
This is a *library* that provides grep-style line-by-line regex searching (with
comparable performance to `grep` itself).

View File

@@ -9,16 +9,20 @@ use grep::{Grep, GrepBuilder};
use log;
use num_cpus;
use regex;
use term::Terminal;
use term::{self, Terminal};
#[cfg(windows)]
use term::WinConsole;
use walkdir::WalkDir;
use atty;
use gitignore::{Gitignore, GitignoreBuilder};
use ignore::Ignore;
use out::{Out, OutBuffer};
use out::{Out, ColoredTerminal};
use printer::Printer;
use search_buffer::BufferSearcher;
use search_stream::{InputBuffer, Searcher};
#[cfg(windows)]
use terminal_win::WindowsBuffer;
use types::{FileTypeDef, Types, TypesBuilder};
use walk;
@@ -367,7 +371,7 @@ impl RawArgs {
types.select(ty);
}
for ty in &self.flag_type_not {
types.select_not(ty);
types.negate(ty);
}
Ok(())
}
@@ -382,9 +386,22 @@ impl Args {
///
/// Also, initialize a global logger.
pub fn parse() -> Result<Args> {
// Get all of the arguments, being careful to require valid UTF-8.
let mut argv = vec![];
for arg in env::args_os() {
match arg.into_string() {
Ok(s) => argv.push(s),
Err(s) => {
errored!("Argument '{}' is not valid UTF-8. \
Use hex escape sequences to match arbitrary \
bytes in a pattern (e.g., \\xFF).",
s.to_string_lossy());
}
}
}
let raw: RawArgs =
Docopt::new(USAGE)
.and_then(|d| d.version(Some(version())).decode())
.and_then(|d| d.argv(argv).version(Some(version())).decode())
.unwrap_or_else(|e| e.exit());
let mut logb = env_logger::LogBuilder::new();
@@ -429,7 +446,7 @@ impl Args {
/// Create a new printer of individual search results that writes to the
/// writer given.
pub fn printer<W: Send + Terminal>(&self, wtr: W) -> Printer<W> {
pub fn printer<W: Terminal + Send>(&self, wtr: W) -> Printer<W> {
let mut p = Printer::new(wtr)
.column(self.column)
.context_separator(self.context_separator.clone())
@@ -456,8 +473,29 @@ impl Args {
}
/// Create a new buffer for use with searching.
pub fn outbuf(&self) -> OutBuffer {
OutBuffer::new(self.color)
#[cfg(not(windows))]
pub fn outbuf(&self) -> ColoredTerminal<term::TerminfoTerminal<Vec<u8>>> {
ColoredTerminal::new(vec![], self.color)
}
/// Create a new buffer for use with searching.
#[cfg(windows)]
pub fn outbuf(&self) -> ColoredTerminal<WindowsBuffer> {
ColoredTerminal::new_buffer(self.color)
}
/// Create a new buffer for use with searching.
#[cfg(not(windows))]
pub fn stdout(
&self,
) -> ColoredTerminal<term::TerminfoTerminal<io::BufWriter<io::Stdout>>> {
ColoredTerminal::new(io::BufWriter::new(io::stdout()), self.color)
}
/// Create a new buffer for use with searching.
#[cfg(windows)]
pub fn stdout(&self) -> ColoredTerminal<WinConsole<io::Stdout>> {
ColoredTerminal::new_stdout(self.color)
}
/// Return the paths that should be searched.

View File

@@ -21,7 +21,6 @@ additional rules such as whitelists (prefix of `!`) or directory-only globs
// TODO(burntsushi): Implement something similar, but for Mercurial. We can't
// use this exact implementation because hgignore files are different.
use std::env;
use std::error::Error as StdError;
use std::fmt;
use std::fs::File;
@@ -89,21 +88,10 @@ pub struct Gitignore {
}
impl Gitignore {
/// Create a new gitignore glob matcher from the gitignore file at the
/// given path. The root of the gitignore file is the basename of path.
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Gitignore, Error> {
let root = match path.as_ref().parent() {
Some(parent) => parent.to_path_buf(),
None => env::current_dir().unwrap_or(Path::new("/").to_path_buf()),
};
let mut builder = GitignoreBuilder::new(root);
try!(builder.add_path(path));
builder.build()
}
/// Create a new gitignore glob matcher from the given root directory and
/// string containing the contents of a gitignore file.
pub fn from_str<P: AsRef<Path>>(
#[allow(dead_code)]
fn from_str<P: AsRef<Path>>(
root: P,
gitignore: &str,
) -> Result<Gitignore, Error> {
@@ -159,11 +147,6 @@ impl Gitignore {
pub fn num_ignores(&self) -> u64 {
self.num_ignores
}
/// Returns the total number of whitelisted patterns.
pub fn num_whitelist(&self) -> u64 {
self.num_whitelist
}
}
/// The result of a glob match.
@@ -182,6 +165,7 @@ pub enum Match<'a> {
impl<'a> Match<'a> {
/// Returns true if the match result implies the path should be ignored.
#[allow(dead_code)]
pub fn is_ignored(&self) -> bool {
match *self {
Match::Ignored(_) => true,

View File

@@ -95,6 +95,7 @@ impl Set {
}
/// Returns the number of glob patterns in this set.
#[allow(dead_code)]
pub fn len(&self) -> usize {
self.set.len()
}
@@ -137,6 +138,7 @@ impl SetBuilder {
///
/// If the pattern could not be parsed as a glob, then an error is
/// returned.
#[allow(dead_code)]
pub fn add(&mut self, pat: &str) -> Result<(), Error> {
self.add_with(pat, &MatchOptions::default())
}
@@ -205,6 +207,7 @@ impl Pattern {
/// Convert this pattern to a string that is guaranteed to be a valid
/// regular expression and will represent the matching semantics of this
/// glob pattern. This uses a default set of options.
#[allow(dead_code)]
pub fn to_regex(&self) -> String {
self.to_regex_with(&MatchOptions::default())
}
@@ -315,7 +318,7 @@ impl<'a> Parser<'a> {
}
return Ok(());
}
let last = self.p.tokens.pop().unwrap();
self.p.tokens.pop().unwrap();
if prev != Some('/') {
return Err(Error::InvalidRecursive);
}

View File

@@ -1,5 +1,3 @@
#![allow(dead_code, unused_variables)]
extern crate crossbeam;
extern crate docopt;
extern crate env_logger;
@@ -15,7 +13,6 @@ extern crate memchr;
extern crate memmap;
extern crate num_cpus;
extern crate regex;
extern crate regex_syntax as syntax;
extern crate rustc_serialize;
extern crate term;
extern crate thread_local;
@@ -26,7 +23,7 @@ extern crate winapi;
use std::error::Error;
use std::fs::File;
use std::io;
use std::path::Path;
use std::path::{Path, PathBuf};
use std::process;
use std::result;
use std::sync::{Arc, Mutex};
@@ -39,9 +36,11 @@ use term::Terminal;
use walkdir::DirEntry;
use args::Args;
use out::{NoColorTerminal, Out, OutBuffer};
use out::{ColoredTerminal, Out};
use printer::Printer;
use search_stream::InputBuffer;
#[cfg(windows)]
use terminal_win::WindowsBuffer;
macro_rules! errored {
($($tt:tt)*) => {
@@ -65,7 +64,8 @@ mod out;
mod printer;
mod search_buffer;
mod search_stream;
mod terminal;
#[cfg(windows)]
mod terminal_win;
mod types;
mod walk;
@@ -74,7 +74,7 @@ pub type Result<T> = result::Result<T, Box<Error + Send + Sync>>;
fn main() {
match Args::parse().and_then(run) {
Ok(count) if count == 0 => process::exit(1),
Ok(count) => process::exit(0),
Ok(_) => process::exit(0),
Err(err) => {
eprintln!("{}", err);
process::exit(1);
@@ -83,34 +83,40 @@ fn main() {
}
fn run(args: Args) -> Result<u64> {
let args = Arc::new(args);
let paths = args.paths();
if args.files() {
return run_files(args);
return run_files(args.clone());
}
if args.type_list() {
return run_types(args);
return run_types(args.clone());
}
let args = Arc::new(args);
if paths.len() == 1 && (paths[0] == Path::new("-") || paths[0].is_file()) {
return run_one(args.clone(), &paths[0]);
}
let out = Arc::new(Mutex::new(args.out()));
let outbuf = args.outbuf();
let mut workers = vec![];
let mut workq = {
let (workq, stealer) = chase_lev::deque();
for _ in 0..args.threads() {
let worker = Worker {
args: args.clone(),
out: out.clone(),
let worker = MultiWorker {
chan_work: stealer.clone(),
inpbuf: args.input_buffer(),
outbuf: Some(outbuf.clone()),
grep: args.grep(),
match_count: 0,
out: out.clone(),
outbuf: Some(args.outbuf()),
worker: Worker {
args: args.clone(),
inpbuf: args.input_buffer(),
grep: args.grep(),
match_count: 0,
},
};
workers.push(thread::spawn(move || worker.run()));
}
workq
};
for p in args.paths() {
for p in paths {
if p == Path::new("-") {
workq.push(Work::Stdin)
} else {
@@ -129,8 +135,27 @@ fn run(args: Args) -> Result<u64> {
Ok(match_count)
}
fn run_files(args: Args) -> Result<u64> {
let term = NoColorTerminal::new(io::BufWriter::new(io::stdout()));
fn run_one(args: Arc<Args>, path: &Path) -> Result<u64> {
let mut worker = Worker {
args: args.clone(),
inpbuf: args.input_buffer(),
grep: args.grep(),
match_count: 0,
};
let term = args.stdout();
let mut printer = args.printer(term);
let work =
if path == Path::new("-") {
WorkReady::Stdin
} else {
WorkReady::PathFile(path.to_path_buf(), try!(File::open(path)))
};
worker.do_work(&mut printer, work);
Ok(worker.match_count)
}
fn run_files(args: Arc<Args>) -> Result<u64> {
let term = args.stdout();
let mut printer = args.printer(term);
let mut file_count = 0;
for p in args.paths() {
@@ -147,8 +172,8 @@ fn run_files(args: Args) -> Result<u64> {
Ok(file_count)
}
fn run_types(args: Args) -> Result<u64> {
let term = NoColorTerminal::new(io::BufWriter::new(io::stdout()));
fn run_types(args: Arc<Args>) -> Result<u64> {
let term = args.stdout();
let mut printer = args.printer(term);
let mut ty_count = 0;
for def in args.type_defs() {
@@ -166,22 +191,29 @@ enum Work {
enum WorkReady {
Stdin,
File(DirEntry, File),
DirFile(DirEntry, File),
PathFile(PathBuf, File),
}
struct MultiWorker {
chan_work: Stealer<Work>,
out: Arc<Mutex<Out>>,
#[cfg(not(windows))]
outbuf: Option<ColoredTerminal<term::TerminfoTerminal<Vec<u8>>>>,
#[cfg(windows)]
outbuf: Option<ColoredTerminal<WindowsBuffer>>,
worker: Worker,
}
struct Worker {
args: Arc<Args>,
out: Arc<Mutex<Out>>,
chan_work: Stealer<Work>,
inpbuf: InputBuffer,
outbuf: Option<OutBuffer>,
grep: Grep,
match_count: u64,
}
impl Worker {
impl MultiWorker {
fn run(mut self) -> u64 {
self.match_count = 0;
loop {
let work = match self.chan_work.steal() {
Steal::Empty | Steal::Abort => continue,
@@ -189,7 +221,7 @@ impl Worker {
Steal::Data(Work::Stdin) => WorkReady::Stdin,
Steal::Data(Work::File(ent)) => {
match File::open(ent.path()) {
Ok(file) => WorkReady::File(ent, file),
Ok(file) => WorkReady::DirFile(ent, file),
Err(err) => {
eprintln!("{}: {}", ent.path().display(), err);
continue;
@@ -199,8 +231,8 @@ impl Worker {
};
let mut outbuf = self.outbuf.take().unwrap();
outbuf.clear();
let mut printer = self.args.printer(outbuf);
self.do_work(&mut printer, work);
let mut printer = self.worker.args.printer(outbuf);
self.worker.do_work(&mut printer, work);
let outbuf = printer.into_inner();
if !outbuf.get_ref().is_empty() {
let mut out = self.out.lock().unwrap();
@@ -208,10 +240,12 @@ impl Worker {
}
self.outbuf = Some(outbuf);
}
self.match_count
self.worker.match_count
}
}
fn do_work<W: Send + Terminal>(
impl Worker {
fn do_work<W: Terminal + Send>(
&mut self,
printer: &mut Printer<W>,
work: WorkReady,
@@ -222,7 +256,7 @@ impl Worker {
let stdin = stdin.lock();
self.search(printer, &Path::new("<stdin>"), stdin)
}
WorkReady::File(ent, file) => {
WorkReady::DirFile(ent, file) => {
let mut path = ent.path();
if let Ok(p) = path.strip_prefix("./") {
path = p;
@@ -233,6 +267,17 @@ impl Worker {
self.search(printer, path, file)
}
}
WorkReady::PathFile(path, file) => {
let mut path = &*path;
if let Ok(p) = path.strip_prefix("./") {
path = p;
}
if self.args.mmap() {
self.search_mmap(printer, path, &file)
} else {
self.search(printer, path, file)
}
}
};
match result {
Ok(count) => {
@@ -244,7 +289,7 @@ impl Worker {
}
}
fn search<R: io::Read, W: Send + Terminal>(
fn search<R: io::Read, W: Terminal + Send>(
&mut self,
printer: &mut Printer<W>,
path: &Path,
@@ -259,7 +304,7 @@ impl Worker {
).run().map_err(From::from)
}
fn search_mmap<W: Send + Terminal>(
fn search_mmap<W: Terminal + Send>(
&mut self,
printer: &mut Printer<W>,
path: &Path,

View File

@@ -1,40 +1,12 @@
use std::io::{self, Write};
use std::sync::Arc;
use term::{self, Terminal};
use term::color::Color;
use term::terminfo::TermInfo;
#[cfg(windows)]
use term::WinConsole;
use terminal::TerminfoTerminal;
pub type StdoutTerminal = Box<Terminal<Output=io::Stdout> + Send>;
/// Gets a terminal that supports color if available.
#[cfg(windows)]
fn term_stdout(color: bool) -> StdoutTerminal {
let stdout = io::stdout();
WinConsole::new(stdout)
.ok()
.map(|t| Box::new(t) as StdoutTerminal)
.unwrap_or_else(|| {
let stdout = io::stdout();
Box::new(NoColorTerminal::new(stdout)) as StdoutTerminal
})
}
/// Gets a terminal that supports color if available.
#[cfg(not(windows))]
fn term_stdout(color: bool) -> StdoutTerminal {
let stdout = io::stdout();
if !color || TERMINFO.is_none() {
Box::new(NoColorTerminal::new(stdout))
} else {
let info = TERMINFO.clone().unwrap();
Box::new(TerminfoTerminal::new_with_terminfo(stdout, info))
}
}
use terminal_win::WindowsBuffer;
/// Out controls the actual output of all search results for a particular file
/// to the end user.
@@ -43,16 +15,31 @@ fn term_stdout(color: bool) -> StdoutTerminal {
/// individual search results where as Out works with search results for each
/// file as a whole. For example, it knows when to print a file separator.)
pub struct Out {
term: StdoutTerminal,
#[cfg(not(windows))]
term: ColoredTerminal<term::TerminfoTerminal<io::BufWriter<io::Stdout>>>,
#[cfg(windows)]
term: ColoredTerminal<WinConsole<io::Stdout>>,
printed: bool,
file_separator: Option<Vec<u8>>,
}
impl Out {
/// Create a new Out that writes to the wtr given.
#[cfg(not(windows))]
pub fn new(color: bool) -> Out {
let wtr = io::BufWriter::new(io::stdout());
Out {
term: ColoredTerminal::new(wtr, color),
printed: false,
file_separator: None,
}
}
/// Create a new Out that writes to the wtr given.
#[cfg(windows)]
pub fn new(color: bool) -> Out {
Out {
term: term_stdout(color),
term: ColoredTerminal::new_stdout(color),
printed: false,
file_separator: None,
}
@@ -69,154 +56,194 @@ impl Out {
/// Write the search results of a single file to the underlying wtr and
/// flush wtr.
pub fn write(&mut self, buf: &OutBuffer) {
#[cfg(not(windows))]
pub fn write(
&mut self,
buf: &ColoredTerminal<term::TerminfoTerminal<Vec<u8>>>,
) {
self.write_sep();
match *buf {
ColoredTerminal::Colored(ref tt) => {
let _ = self.term.write_all(tt.get_ref());
}
ColoredTerminal::NoColor(ref buf) => {
let _ = self.term.write_all(buf);
}
}
self.write_done();
}
/// Write the search results of a single file to the underlying wtr and
/// flush wtr.
#[cfg(windows)]
pub fn write(
&mut self,
buf: &ColoredTerminal<WindowsBuffer>,
) {
self.write_sep();
match *buf {
ColoredTerminal::Colored(ref tt) => {
tt.print_stdout(&mut self.term);
}
ColoredTerminal::NoColor(ref buf) => {
let _ = self.term.write_all(buf);
}
}
self.write_done();
}
fn write_sep(&mut self) {
if let Some(ref sep) = self.file_separator {
if self.printed {
let _ = self.term.write_all(sep);
let _ = self.term.write_all(b"\n");
}
}
match *buf {
OutBuffer::Colored(ref tt) => {
let _ = self.term.write_all(tt.get_ref());
}
OutBuffer::Windows(ref w) => {
w.print_stdout(&mut self.term);
}
OutBuffer::NoColor(ref buf) => {
let _ = self.term.write_all(buf);
}
}
}
fn write_done(&mut self) {
let _ = self.term.flush();
self.printed = true;
}
}
/// OutBuffer corresponds to the final output buffer for search results. All
/// search results are written to a buffer and then a buffer is flushed to
/// stdout only after the full search has completed.
/// ColoredTerminal provides optional colored output through the term::Terminal
/// trait. In particular, it will dynamically configure itself to use coloring
/// if it's available in the environment.
#[derive(Clone, Debug)]
pub enum OutBuffer {
Colored(TerminfoTerminal<Vec<u8>>),
Windows(WindowsBuffer),
NoColor(Vec<u8>),
pub enum ColoredTerminal<T: Terminal + Send> {
Colored(T),
NoColor(T::Output),
}
#[derive(Clone, Debug)]
pub struct WindowsBuffer {
buf: Vec<u8>,
pos: usize,
colors: Vec<WindowsColor>,
}
#[derive(Clone, Debug)]
pub struct WindowsColor {
pos: usize,
opt: WindowsOption,
}
#[derive(Clone, Debug)]
pub enum WindowsOption {
Foreground(Color),
Background(Color),
Reset,
}
lazy_static! {
static ref TERMINFO: Option<Arc<TermInfo>> = {
match TermInfo::from_env() {
Ok(info) => Some(Arc::new(info)),
Err(err) => {
debug!("error loading terminfo for coloring: {}", err);
None
}
}
};
}
impl OutBuffer {
#[cfg(not(windows))]
impl<W: io::Write + Send> ColoredTerminal<term::TerminfoTerminal<W>> {
/// Create a new output buffer.
///
/// When color is true, the buffer will attempt to support coloring.
pub fn new(color: bool) -> OutBuffer {
// If we want color, build a TerminfoTerminal and see if the current
// environment supports coloring. If not, bail with NoColor. To avoid
// losing our writer (ownership), do this the long way.
pub fn new(wtr: W, color: bool) -> Self {
lazy_static! {
// Only pay for parsing the terminfo once.
static ref TERMINFO: Option<TermInfo> = {
match TermInfo::from_env() {
Ok(info) => Some(info),
Err(err) => {
debug!("error loading terminfo for coloring: {}", err);
None
}
}
};
}
// If we want color, build a term::TerminfoTerminal and see if the
// current environment supports coloring. If not, bail with NoColor. To
// avoid losing our writer (ownership), do this the long way.
if !color {
return OutBuffer::NoColor(vec![]);
return ColoredTerminal::NoColor(wtr);
}
if cfg!(windows) {
return OutBuffer::Windows(WindowsBuffer {
buf: vec![],
pos: 0,
colors: vec![]
});
}
if TERMINFO.is_none() {
return OutBuffer::NoColor(vec![]);
}
let info = TERMINFO.clone().unwrap();
let tt = TerminfoTerminal::new_with_terminfo(vec![], info);
let terminfo = match *TERMINFO {
None => return ColoredTerminal::NoColor(wtr),
Some(ref ti) => {
// Ug, this should go away with the next release of `term`.
TermInfo {
names: ti.names.clone(),
bools: ti.bools.clone(),
numbers: ti.numbers.clone(),
strings: ti.strings.clone(),
}
}
};
let tt = term::TerminfoTerminal::new_with_terminfo(wtr, terminfo);
if !tt.supports_color() {
debug!("environment doesn't support coloring");
return OutBuffer::NoColor(tt.into_inner());
return ColoredTerminal::NoColor(tt.into_inner());
}
ColoredTerminal::Colored(tt)
}
}
#[cfg(not(windows))]
impl ColoredTerminal<term::TerminfoTerminal<Vec<u8>>> {
/// Clear the give buffer of all search results such that it is reusable
/// in another search.
pub fn clear(&mut self) {
match *self {
ColoredTerminal::Colored(ref mut tt) => {
tt.get_mut().clear();
}
ColoredTerminal::NoColor(ref mut buf) => {
buf.clear();
}
}
}
}
#[cfg(windows)]
impl ColoredTerminal<WindowsBuffer> {
/// Create a new output buffer.
///
/// When color is true, the buffer will attempt to support coloring.
pub fn new_buffer(color: bool) -> Self {
if !color {
ColoredTerminal::NoColor(vec![])
} else {
ColoredTerminal::Colored(WindowsBuffer::new())
}
OutBuffer::Colored(tt)
}
/// Clear the give buffer of all search results such that it is reusable
/// in another search.
pub fn clear(&mut self) {
match *self {
OutBuffer::Colored(ref mut tt) => {
tt.get_mut().clear();
}
OutBuffer::Windows(ref mut win) => {
win.buf.clear();
win.colors.clear();
win.pos = 0;
}
OutBuffer::NoColor(ref mut buf) => {
buf.clear();
}
ColoredTerminal::Colored(ref mut win) => win.clear(),
ColoredTerminal::NoColor(ref mut buf) => buf.clear(),
}
}
}
fn map_result<F, G>(
#[cfg(windows)]
impl ColoredTerminal<WinConsole<io::Stdout>> {
/// Create a new output buffer.
///
/// When color is true, the buffer will attempt to support coloring.
pub fn new_stdout(color: bool) -> Self {
if !color {
return ColoredTerminal::NoColor(io::stdout());
}
match WinConsole::new(io::stdout()) {
Ok(win) => ColoredTerminal::Colored(win),
Err(_) => ColoredTerminal::NoColor(io::stdout()),
}
}
}
impl<T: Terminal + Send> ColoredTerminal<T> {
fn map_result<F>(
&mut self,
mut f: F,
mut g: G,
) -> term::Result<()>
where F: FnMut(&mut TerminfoTerminal<Vec<u8>>) -> term::Result<()>,
G: FnMut(&mut WindowsBuffer) -> term::Result<()> {
where F: FnMut(&mut T) -> term::Result<()> {
match *self {
OutBuffer::Colored(ref mut w) => f(w),
OutBuffer::Windows(ref mut w) => g(w),
OutBuffer::NoColor(_) => Err(term::Error::NotSupported),
ColoredTerminal::Colored(ref mut w) => f(w),
ColoredTerminal::NoColor(_) => Err(term::Error::NotSupported),
}
}
fn map_bool<F, G>(
fn map_bool<F>(
&self,
mut f: F,
mut g: G,
) -> bool
where F: FnMut(&TerminfoTerminal<Vec<u8>>) -> bool,
G: FnMut(&WindowsBuffer) -> bool {
where F: FnMut(&T) -> bool {
match *self {
OutBuffer::Colored(ref w) => f(w),
OutBuffer::Windows(ref w) => g(w),
OutBuffer::NoColor(_) => false,
ColoredTerminal::Colored(ref w) => f(w),
ColoredTerminal::NoColor(_) => false,
}
}
}
impl io::Write for OutBuffer {
impl<T: Terminal + Send> io::Write for ColoredTerminal<T> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
match *self {
OutBuffer::Colored(ref mut w) => w.write(buf),
OutBuffer::Windows(ref mut w) => w.write(buf),
OutBuffer::NoColor(ref mut w) => w.write(buf),
ColoredTerminal::Colored(ref mut w) => w.write(buf),
ColoredTerminal::NoColor(ref mut w) => w.write(buf),
}
}
@@ -225,259 +252,67 @@ impl io::Write for OutBuffer {
}
}
impl term::Terminal for OutBuffer {
type Output = Vec<u8>;
impl<T: Terminal + Send> term::Terminal for ColoredTerminal<T> {
type Output = T::Output;
fn fg(&mut self, fg: term::color::Color) -> term::Result<()> {
self.map_result(|w| w.fg(fg), |w| w.fg(fg))
self.map_result(|w| w.fg(fg))
}
fn bg(&mut self, bg: term::color::Color) -> term::Result<()> {
self.map_result(|w| w.bg(bg), |w| w.bg(bg))
self.map_result(|w| w.bg(bg))
}
fn attr(&mut self, attr: term::Attr) -> term::Result<()> {
self.map_result(|w| w.attr(attr), |w| w.attr(attr))
self.map_result(|w| w.attr(attr))
}
fn supports_attr(&self, attr: term::Attr) -> bool {
self.map_bool(|w| w.supports_attr(attr), |w| w.supports_attr(attr))
self.map_bool(|w| w.supports_attr(attr))
}
fn reset(&mut self) -> term::Result<()> {
self.map_result(|w| w.reset(), |w| w.reset())
self.map_result(|w| w.reset())
}
fn supports_reset(&self) -> bool {
self.map_bool(|w| w.supports_reset(), |w| w.supports_reset())
self.map_bool(|w| w.supports_reset())
}
fn supports_color(&self) -> bool {
self.map_bool(|w| w.supports_color(), |w| w.supports_color())
self.map_bool(|w| w.supports_color())
}
fn cursor_up(&mut self) -> term::Result<()> {
self.map_result(|w| w.cursor_up(), |w| w.cursor_up())
self.map_result(|w| w.cursor_up())
}
fn delete_line(&mut self) -> term::Result<()> {
self.map_result(|w| w.delete_line(), |w| w.delete_line())
self.map_result(|w| w.delete_line())
}
fn carriage_return(&mut self) -> term::Result<()> {
self.map_result(|w| w.carriage_return(), |w| w.carriage_return())
self.map_result(|w| w.carriage_return())
}
fn get_ref(&self) -> &Vec<u8> {
fn get_ref(&self) -> &Self::Output {
match *self {
OutBuffer::Colored(ref w) => w.get_ref(),
OutBuffer::Windows(ref w) => w.get_ref(),
OutBuffer::NoColor(ref w) => w,
ColoredTerminal::Colored(ref w) => w.get_ref(),
ColoredTerminal::NoColor(ref w) => w,
}
}
fn get_mut(&mut self) -> &mut Vec<u8> {
fn get_mut(&mut self) -> &mut Self::Output {
match *self {
OutBuffer::Colored(ref mut w) => w.get_mut(),
OutBuffer::Windows(ref mut w) => w.get_mut(),
OutBuffer::NoColor(ref mut w) => w,
ColoredTerminal::Colored(ref mut w) => w.get_mut(),
ColoredTerminal::NoColor(ref mut w) => w,
}
}
fn into_inner(self) -> Vec<u8> {
fn into_inner(self) -> Self::Output {
match self {
OutBuffer::Colored(w) => w.into_inner(),
OutBuffer::Windows(w) => w.into_inner(),
OutBuffer::NoColor(w) => w,
ColoredTerminal::Colored(w) => w.into_inner(),
ColoredTerminal::NoColor(w) => w,
}
}
}
impl WindowsBuffer {
fn push(&mut self, opt: WindowsOption) {
let pos = self.pos;
self.colors.push(WindowsColor { pos: pos, opt: opt });
}
}
impl WindowsBuffer {
/// Print the contents to the given terminal.
pub fn print_stdout(&self, tt: &mut StdoutTerminal) {
if !tt.supports_color() {
let _ = tt.write_all(&self.buf);
let _ = tt.flush();
return;
}
let mut last = 0;
for col in &self.colors {
let _ = tt.write_all(&self.buf[last..col.pos]);
match col.opt {
WindowsOption::Foreground(c) => {
let _ = tt.fg(c);
}
WindowsOption::Background(c) => {
let _ = tt.bg(c);
}
WindowsOption::Reset => {
let _ = tt.reset();
}
}
last = col.pos;
}
let _ = tt.write_all(&self.buf[last..]);
let _ = tt.flush();
}
}
impl io::Write for WindowsBuffer {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let n = try!(self.buf.write(buf));
self.pos += n;
Ok(n)
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
impl term::Terminal for WindowsBuffer {
type Output = Vec<u8>;
fn fg(&mut self, fg: term::color::Color) -> term::Result<()> {
self.push(WindowsOption::Foreground(fg));
Ok(())
}
fn bg(&mut self, bg: term::color::Color) -> term::Result<()> {
self.push(WindowsOption::Background(bg));
Ok(())
}
fn attr(&mut self, attr: term::Attr) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn supports_attr(&self, attr: term::Attr) -> bool {
false
}
fn reset(&mut self) -> term::Result<()> {
self.push(WindowsOption::Reset);
Ok(())
}
fn supports_reset(&self) -> bool {
true
}
fn supports_color(&self) -> bool {
true
}
fn cursor_up(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn delete_line(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn carriage_return(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn get_ref(&self) -> &Vec<u8> {
&self.buf
}
fn get_mut(&mut self) -> &mut Vec<u8> {
&mut self.buf
}
fn into_inner(self) -> Vec<u8> {
self.buf
}
}
/// NoColorTerminal implements Terminal, but supports no coloring.
///
/// Its useful when an API requires a Terminal, but coloring isn't needed.
pub struct NoColorTerminal<W> {
wtr: W,
}
impl<W: Send + io::Write> NoColorTerminal<W> {
/// Wrap the given writer in a Terminal interface.
pub fn new(wtr: W) -> NoColorTerminal<W> {
NoColorTerminal {
wtr: wtr,
}
}
}
impl<W: Send + io::Write> io::Write for NoColorTerminal<W> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.wtr.write(buf)
}
fn flush(&mut self) -> io::Result<()> {
self.wtr.flush()
}
}
impl<W: Send + io::Write> term::Terminal for NoColorTerminal<W> {
type Output = W;
fn fg(&mut self, fg: term::color::Color) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn bg(&mut self, bg: term::color::Color) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn attr(&mut self, attr: term::Attr) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn supports_attr(&self, attr: term::Attr) -> bool {
false
}
fn reset(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn supports_reset(&self) -> bool {
false
}
fn supports_color(&self) -> bool {
false
}
fn cursor_up(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn delete_line(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn carriage_return(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn get_ref(&self) -> &W {
&self.wtr
}
fn get_mut(&mut self) -> &mut W {
&mut self.wtr
}
fn into_inner(self) -> W {
self.wtr
}
}

View File

@@ -36,7 +36,7 @@ pub struct Printer<W> {
with_filename: bool,
}
impl<W: Send + Terminal> Printer<W> {
impl<W: Terminal + Send> Printer<W> {
/// Create a new printer that writes to wtr.
pub fn new(wtr: W) -> Printer<W> {
Printer {

View File

@@ -151,10 +151,10 @@ impl<'a, W: Send + Terminal> BufferSearcher<'a, W> {
mod tests {
use std::path::Path;
use grep::{Grep, GrepBuilder};
use term::Terminal;
use grep::GrepBuilder;
use term::{Terminal, TerminfoTerminal};
use out::OutBuffer;
use out::ColoredTerminal;
use printer::Printer;
use super::BufferSearcher;
@@ -168,38 +168,19 @@ but Doctor Watson has to have it taken out for him and dusted,
and exhibited clearly, with a label attached.\
";
const CODE: &'static str = "\
extern crate snap;
use std::io;
fn main() {
let stdin = io::stdin();
let stdout = io::stdout();
// Wrap the stdin reader in a Snappy reader.
let mut rdr = snap::Reader::new(stdin.lock());
let mut wtr = stdout.lock();
io::copy(&mut rdr, &mut wtr).expect(\"I/O operation failed\");
}
";
fn matcher(pat: &str) -> Grep {
GrepBuilder::new(pat).build().unwrap()
}
fn test_path() -> &'static Path {
&Path::new("/baz.rs")
}
type TestSearcher<'a> = BufferSearcher<'a, OutBuffer>;
type TestSearcher<'a> =
BufferSearcher<'a, ColoredTerminal<TerminfoTerminal<Vec<u8>>>>;
fn search<F: FnMut(TestSearcher) -> TestSearcher>(
pat: &str,
haystack: &str,
mut map: F,
) -> (u64, String) {
let outbuf = OutBuffer::NoColor(vec![]);
let outbuf = ColoredTerminal::NoColor(vec![]);
let mut pp = Printer::new(outbuf).with_filename(true);
let grep = GrepBuilder::new(pat).build().unwrap();
let count = {

View File

@@ -100,7 +100,7 @@ impl Default for Options {
}
}
impl<'a, R: io::Read, W: Send + Terminal> Searcher<'a, R, W> {
impl<'a, R: io::Read, W: Terminal + Send> Searcher<'a, R, W> {
/// Create a new searcher.
///
/// `inp` is a reusable input buffer that is used as scratch space by this
@@ -763,10 +763,10 @@ mod tests {
use std::io;
use std::path::Path;
use grep::{Grep, GrepBuilder};
use term::Terminal;
use grep::GrepBuilder;
use term::{Terminal, TerminfoTerminal};
use out::OutBuffer;
use out::ColoredTerminal;
use printer::Printer;
use super::{InputBuffer, Searcher, start_of_previous_lines};
@@ -800,15 +800,15 @@ fn main() {
io::Cursor::new(s.to_string().into_bytes())
}
fn matcher(pat: &str) -> Grep {
GrepBuilder::new(pat).build().unwrap()
}
fn test_path() -> &'static Path {
&Path::new("/baz.rs")
}
type TestSearcher<'a> = Searcher<'a, io::Cursor<Vec<u8>>, OutBuffer>;
type TestSearcher<'a> = Searcher<
'a,
io::Cursor<Vec<u8>>,
ColoredTerminal<TerminfoTerminal<Vec<u8>>>,
>;
fn search_smallcap<F: FnMut(TestSearcher) -> TestSearcher>(
pat: &str,
@@ -816,7 +816,7 @@ fn main() {
mut map: F,
) -> (u64, String) {
let mut inp = InputBuffer::with_capacity(1);
let outbuf = OutBuffer::NoColor(vec![]);
let outbuf = ColoredTerminal::NoColor(vec![]);
let mut pp = Printer::new(outbuf).with_filename(true);
let grep = GrepBuilder::new(pat).build().unwrap();
let count = {
@@ -833,7 +833,7 @@ fn main() {
mut map: F,
) -> (u64, String) {
let mut inp = InputBuffer::with_capacity(4096);
let outbuf = OutBuffer::NoColor(vec![]);
let outbuf = ColoredTerminal::NoColor(vec![]);
let mut pp = Printer::new(outbuf).with_filename(true);
let grep = GrepBuilder::new(pat).build().unwrap();
let count = {

View File

@@ -1,202 +0,0 @@
/*!
This module contains an implementation of the `term::Terminal` trait.
The actual implementation is copied almost verbatim from the `term` crate, so
this code is under the same license (MIT/Apache).
The specific reason why this is copied here is to wrap an Arc<TermInfo> instead
of a TermInfo. This makes multithreaded sharing much more performant.
N.B. This is temporary until this issue is fixed:
https://github.com/Stebalien/term/issues/64
*/
use std::io::{self, Write};
use std::sync::Arc;
use term::{Attr, Error, Result, Terminal, color};
use term::terminfo::TermInfo;
use term::terminfo::parm::{Param, Variables, expand};
/// A Terminal that knows how many colors it supports, with a reference to its
/// parsed Terminfo database record.
#[derive(Clone, Debug)]
pub struct TerminfoTerminal<T> {
num_colors: u16,
out: T,
ti: Arc<TermInfo>,
}
impl<T: Write + Send> Terminal for TerminfoTerminal<T> {
type Output = T;
fn fg(&mut self, color: color::Color) -> Result<()> {
let color = self.dim_if_necessary(color);
if self.num_colors > color {
return apply_cap(&self.ti, "setaf", &[Param::Number(color as i32)], &mut self.out);
}
Err(Error::ColorOutOfRange)
}
fn bg(&mut self, color: color::Color) -> Result<()> {
let color = self.dim_if_necessary(color);
if self.num_colors > color {
return apply_cap(&self.ti, "setab", &[Param::Number(color as i32)], &mut self.out);
}
Err(Error::ColorOutOfRange)
}
fn attr(&mut self, attr: Attr) -> Result<()> {
match attr {
Attr::ForegroundColor(c) => self.fg(c),
Attr::BackgroundColor(c) => self.bg(c),
_ => apply_cap(&self.ti, cap_for_attr(attr), &[], &mut self.out),
}
}
fn supports_attr(&self, attr: Attr) -> bool {
match attr {
Attr::ForegroundColor(_) | Attr::BackgroundColor(_) => self.num_colors > 0,
_ => {
let cap = cap_for_attr(attr);
self.ti.strings.get(cap).is_some()
}
}
}
fn reset(&mut self) -> Result<()> {
reset(&self.ti, &mut self.out)
}
fn supports_reset(&self) -> bool {
["sgr0", "sgr", "op"].iter().any(|&cap| self.ti.strings.get(cap).is_some())
}
fn supports_color(&self) -> bool {
self.num_colors > 0 && self.supports_reset()
}
fn cursor_up(&mut self) -> Result<()> {
apply_cap(&self.ti, "cuu1", &[], &mut self.out)
}
fn delete_line(&mut self) -> Result<()> {
apply_cap(&self.ti, "dl", &[], &mut self.out)
}
fn carriage_return(&mut self) -> Result<()> {
apply_cap(&self.ti, "cr", &[], &mut self.out)
}
fn get_ref(&self) -> &T {
&self.out
}
fn get_mut(&mut self) -> &mut T {
&mut self.out
}
fn into_inner(self) -> T
where Self: Sized
{
self.out
}
}
impl<T: Write + Send> TerminfoTerminal<T> {
/// Create a new TerminfoTerminal with the given TermInfo and Write.
pub fn new_with_terminfo(out: T, terminfo: Arc<TermInfo>) -> TerminfoTerminal<T> {
let nc = if terminfo.strings.contains_key("setaf") &&
terminfo.strings.contains_key("setab") {
terminfo.numbers.get("colors").map_or(0, |&n| n)
} else {
0
};
TerminfoTerminal {
out: out,
ti: terminfo,
num_colors: nc,
}
}
/// Create a new TerminfoTerminal for the current environment with the given Write.
///
/// Returns `None` when the terminfo cannot be found or parsed.
pub fn new(out: T) -> Option<TerminfoTerminal<T>> {
TermInfo::from_env().map(move |ti| {
TerminfoTerminal::new_with_terminfo(out, Arc::new(ti))
}).ok()
}
fn dim_if_necessary(&self, color: color::Color) -> color::Color {
if color >= self.num_colors && color >= 8 && color < 16 {
color - 8
} else {
color
}
}
}
impl<T: Write> Write for TerminfoTerminal<T> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.out.write(buf)
}
fn flush(&mut self) -> io::Result<()> {
self.out.flush()
}
}
fn cap_for_attr(attr: Attr) -> &'static str {
match attr {
Attr::Bold => "bold",
Attr::Dim => "dim",
Attr::Italic(true) => "sitm",
Attr::Italic(false) => "ritm",
Attr::Underline(true) => "smul",
Attr::Underline(false) => "rmul",
Attr::Blink => "blink",
Attr::Standout(true) => "smso",
Attr::Standout(false) => "rmso",
Attr::Reverse => "rev",
Attr::Secure => "invis",
Attr::ForegroundColor(_) => "setaf",
Attr::BackgroundColor(_) => "setab",
}
}
fn apply_cap(ti: &TermInfo, cmd: &str, params: &[Param], out: &mut io::Write) -> Result<()> {
match ti.strings.get(cmd) {
Some(cmd) => {
match expand(cmd, params, &mut Variables::new()) {
Ok(s) => {
try!(out.write_all(&s));
Ok(())
}
Err(e) => Err(e.into()),
}
}
None => Err(Error::NotSupported),
}
}
fn reset(ti: &TermInfo, out: &mut io::Write) -> Result<()> {
// are there any terminals that have color/attrs and not sgr0?
// Try falling back to sgr, then op
let cmd = match [("sgr0", &[] as &[Param]), ("sgr", &[Param::Number(0)]), ("op", &[])]
.iter()
.filter_map(|&(cap, params)| {
ti.strings.get(cap).map(|c| (c, params))
})
.next() {
Some((op, params)) => {
match expand(op, params, &mut Variables::new()) {
Ok(cmd) => cmd,
Err(e) => return Err(e.into()),
}
}
None => return Err(Error::NotSupported),
};
try!(out.write_all(&cmd));
Ok(())
}

176
src/terminal_win.rs Normal file
View File

@@ -0,0 +1,176 @@
/*!
This module contains a Windows-only *in-memory* implementation of the
`term::Terminal` trait.
This particular implementation is a bit idiosyncratic, and the "in-memory"
specification is to blame. In particular, on Windows, coloring requires
communicating with the console synchronously as data is written to stdout.
This is anathema to how ripgrep fundamentally works: by writing search results
to intermediate thread local buffers in order to maximize parallelism.
Eliminating parallelism on Windows isn't an option, because that would negate
a tremendous performance benefit just for coloring.
We've worked around this by providing an implementation of `term::Terminal`
that records precisely where a color or a reset should be invoked, according
to a byte offset in the in memory buffer. When the buffer is actually printed,
we copy the bytes from the buffer to stdout incrementally while invoking the
corresponding console APIs for coloring at the right location.
(Another approach would be to do ANSI coloring unconditionally, then parse that
and translate it to console commands. The advantage of that approach is that
it doesn't require any additional memory for storing offsets. In practice
though, coloring is only used in the terminal, which tends to correspond to
searches that produce very few results with respect to the corpus searched.
Therefore, this is an acceptable trade off. Namely, we do not pay for it when
coloring is disabled.
*/
use std::io;
use term::{self, Terminal};
use term::color::Color;
/// An in-memory buffer that provides Windows console coloring.
#[derive(Clone, Debug)]
pub struct WindowsBuffer {
buf: Vec<u8>,
pos: usize,
colors: Vec<WindowsColor>,
}
/// A color associated with a particular location in a buffer.
#[derive(Clone, Debug)]
struct WindowsColor {
pos: usize,
opt: WindowsOption,
}
/// A color or reset directive that can be translated into an instruction to
/// the Windows console.
#[derive(Clone, Debug)]
enum WindowsOption {
Foreground(Color),
Background(Color),
Reset,
}
impl WindowsBuffer {
/// Create a new empty buffer for Windows console coloring.
pub fn new() -> WindowsBuffer {
WindowsBuffer {
buf: vec![],
pos: 0,
colors: vec![],
}
}
fn push(&mut self, opt: WindowsOption) {
let pos = self.pos;
self.colors.push(WindowsColor { pos: pos, opt: opt });
}
/// Print the contents to the given terminal.
pub fn print_stdout<T: Terminal + Send>(&self, tt: &mut T) {
if !tt.supports_color() {
let _ = tt.write_all(&self.buf);
let _ = tt.flush();
return;
}
let mut last = 0;
for col in &self.colors {
let _ = tt.write_all(&self.buf[last..col.pos]);
match col.opt {
WindowsOption::Foreground(c) => {
let _ = tt.fg(c);
}
WindowsOption::Background(c) => {
let _ = tt.bg(c);
}
WindowsOption::Reset => {
let _ = tt.reset();
}
}
last = col.pos;
}
let _ = tt.write_all(&self.buf[last..]);
let _ = tt.flush();
}
/// Clear the buffer.
pub fn clear(&mut self) {
self.buf.clear();
self.colors.clear();
self.pos = 0;
}
}
impl io::Write for WindowsBuffer {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let n = try!(self.buf.write(buf));
self.pos += n;
Ok(n)
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
impl Terminal for WindowsBuffer {
type Output = Vec<u8>;
fn fg(&mut self, fg: Color) -> term::Result<()> {
self.push(WindowsOption::Foreground(fg));
Ok(())
}
fn bg(&mut self, bg: Color) -> term::Result<()> {
self.push(WindowsOption::Background(bg));
Ok(())
}
fn attr(&mut self, _attr: term::Attr) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn supports_attr(&self, _attr: term::Attr) -> bool {
false
}
fn reset(&mut self) -> term::Result<()> {
self.push(WindowsOption::Reset);
Ok(())
}
fn supports_reset(&self) -> bool {
true
}
fn supports_color(&self) -> bool {
true
}
fn cursor_up(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn delete_line(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn carriage_return(&mut self) -> term::Result<()> {
Err(term::Error::NotSupported)
}
fn get_ref(&self) -> &Vec<u8> {
&self.buf
}
fn get_mut(&mut self) -> &mut Vec<u8> {
&mut self.buf
}
fn into_inner(self) -> Vec<u8> {
self.buf
}
}

View File

@@ -8,7 +8,10 @@ use std::error::Error as StdError;
use std::fmt;
use std::path::Path;
use gitignore::{self, Gitignore, GitignoreBuilder, Match, Pattern};
use regex;
use gitignore::{Match, Pattern};
use glob::{self, MatchOptions};
const TYPE_EXTENSIONS: &'static [(&'static str, &'static [&'static str])] = &[
("asm", &["*.asm", "*.s", "*.S"]),
@@ -55,6 +58,7 @@ const TYPE_EXTENSIONS: &'static [(&'static str, &'static [&'static str])] = &[
("perl", &["*.perl", "*.pl", "*.PL", "*.plh", "*.plx", "*.pm"]),
("php", &["*.php", "*.php3", "*.php4", "*.php5", "*.phtml"]),
("py", &["*.py"]),
("readme", &["README*", "*README"]),
("rr", &["*.R"]),
("rst", &["*.rst"]),
("ruby", &["*.rb"]),
@@ -81,7 +85,9 @@ pub enum Error {
/// A user specified file type definition could not be parsed.
InvalidDefinition,
/// There was an error building the matcher (probably a bad glob).
Gitignore(gitignore::Error),
Glob(glob::Error),
/// There was an error compiling a glob as a regex.
Regex(regex::Error),
}
impl StdError for Error {
@@ -89,7 +95,8 @@ impl StdError for Error {
match *self {
Error::UnrecognizedFileType(_) => "unrecognized file type",
Error::InvalidDefinition => "invalid definition",
Error::Gitignore(ref err) => err.description(),
Error::Glob(ref err) => err.description(),
Error::Regex(ref err) => err.description(),
}
}
}
@@ -104,14 +111,21 @@ impl fmt::Display for Error {
write!(f, "invalid definition (format is type:glob, e.g., \
html:*.html)")
}
Error::Gitignore(ref err) => err.fmt(f),
Error::Glob(ref err) => err.fmt(f),
Error::Regex(ref err) => err.fmt(f),
}
}
}
impl From<gitignore::Error> for Error {
fn from(err: gitignore::Error) -> Error {
Error::Gitignore(err)
impl From<glob::Error> for Error {
fn from(err: glob::Error) -> Error {
Error::Glob(err)
}
}
impl From<regex::Error> for Error {
fn from(err: regex::Error) -> Error {
Error::Regex(err)
}
}
@@ -137,7 +151,8 @@ impl FileTypeDef {
/// Types is a file type matcher.
#[derive(Clone, Debug)]
pub struct Types {
gi: Option<Gitignore>,
selected: Option<glob::Set>,
negated: Option<glob::Set>,
has_selected: bool,
unmatched_pat: Pattern,
}
@@ -149,14 +164,19 @@ impl Types {
///
/// If has_selected is true, then at least one file type was selected.
/// Therefore, any non-matches should be ignored.
fn new(gi: Option<Gitignore>, has_selected: bool) -> Types {
fn new(
selected: Option<glob::Set>,
negated: Option<glob::Set>,
has_selected: bool,
) -> Types {
Types {
gi: gi,
selected: selected,
negated: negated,
has_selected: has_selected,
unmatched_pat: Pattern {
from: Path::new("<filetype>").to_path_buf(),
original: "<none>".to_string(),
pat: "<none>".to_string(),
original: "<N/A>".to_string(),
pat: "<N/A>".to_string(),
whitelist: false,
only_dir: false,
},
@@ -165,7 +185,7 @@ impl Types {
/// Creates a new file type matcher that never matches.
pub fn empty() -> Types {
Types::new(None, false)
Types::new(None, None, false)
}
/// Returns a match for the given path against this file type matcher.
@@ -175,22 +195,35 @@ impl Types {
/// If at least one file type is selected and path doesn't match, then
/// the path is also considered ignored.
pub fn matched<P: AsRef<Path>>(&self, path: P, is_dir: bool) -> Match {
// If we don't have any matcher, then we can't do anything.
if self.negated.is_none() && self.selected.is_none() {
return Match::None;
}
// File types don't apply to directories.
if is_dir {
return Match::None;
}
let path = path.as_ref();
self.gi.as_ref()
.map(|gi| {
let path = &*path.to_string_lossy();
let mat = gi.matched_utf8(path, is_dir).invert();
if self.has_selected && mat.is_none() {
Match::Ignored(&self.unmatched_pat)
} else {
mat
}
})
.unwrap_or(Match::None)
let name = match path.file_name() {
Some(name) => name.to_string_lossy(),
None if self.has_selected => {
return Match::Ignored(&self.unmatched_pat);
}
None => {
return Match::None;
}
};
if self.negated.as_ref().map(|s| s.is_match(&*name)).unwrap_or(false) {
return Match::Ignored(&self.unmatched_pat);
}
if self.selected.as_ref().map(|s|s.is_match(&*name)).unwrap_or(false) {
return Match::Whitelist(&self.unmatched_pat);
}
if self.has_selected {
Match::Ignored(&self.unmatched_pat)
} else {
Match::None
}
}
}
@@ -198,8 +231,8 @@ impl Types {
/// a set of file type selections.
pub struct TypesBuilder {
types: HashMap<String, Vec<String>>,
select: Vec<String>,
select_not: Vec<String>,
selected: Vec<String>,
negated: Vec<String>,
}
impl TypesBuilder {
@@ -207,41 +240,57 @@ impl TypesBuilder {
pub fn new() -> TypesBuilder {
TypesBuilder {
types: HashMap::new(),
select: vec![],
select_not: vec![],
selected: vec![],
negated: vec![],
}
}
/// Build the current set of file type definitions *and* selections into
/// a file type matcher.
pub fn build(&self) -> Result<Types, Error> {
if self.select.is_empty() && self.select_not.is_empty() {
return Ok(Types::new(None, false));
}
let mut bgi = GitignoreBuilder::new("/");
for name in &self.select {
let globs = match self.types.get(name) {
Some(globs) => globs,
None => {
return Err(Error::UnrecognizedFileType(name.to_string()));
let opts = MatchOptions {
require_literal_separator: true, ..MatchOptions::default()
};
let selected_globs =
if self.selected.is_empty() {
None
} else {
let mut bset = glob::SetBuilder::new();
for name in &self.selected {
let globs = match self.types.get(name) {
Some(globs) => globs,
None => {
let msg = name.to_string();
return Err(Error::UnrecognizedFileType(msg));
}
};
for glob in globs {
try!(bset.add_with(glob, &opts));
}
}
Some(try!(bset.build()))
};
for glob in globs {
try!(bgi.add("<filetype>", glob));
}
}
for name in &self.select_not {
let globs = match self.types.get(name) {
Some(globs) => globs,
None => {
return Err(Error::UnrecognizedFileType(name.to_string()));
let negated_globs =
if self.negated.is_empty() {
None
} else {
let mut bset = glob::SetBuilder::new();
for name in &self.negated {
let globs = match self.types.get(name) {
Some(globs) => globs,
None => {
let msg = name.to_string();
return Err(Error::UnrecognizedFileType(msg));
}
};
for glob in globs {
try!(bset.add_with(glob, &opts));
}
}
Some(try!(bset.build()))
};
for glob in globs {
try!(bgi.add("<filetype>", &format!("!{}", glob)));
}
}
Ok(Types::new(Some(try!(bgi.build())), !self.select.is_empty()))
Ok(Types::new(
selected_globs, negated_globs, !self.selected.is_empty()))
}
/// Return the set of current file type definitions.
@@ -260,14 +309,30 @@ impl TypesBuilder {
}
/// Select the file type given by `name`.
///
/// If `name` is `all`, then all file types are selected.
pub fn select(&mut self, name: &str) -> &mut TypesBuilder {
self.select.push(name.to_string());
if name == "all" {
for name in self.types.keys() {
self.selected.push(name.to_string());
}
} else {
self.selected.push(name.to_string());
}
self
}
/// Ignore the file type given by `name`.
pub fn select_not(&mut self, name: &str) -> &mut TypesBuilder {
self.select_not.push(name.to_string());
///
/// If `name` is `all`, then all file types are negated.
pub fn negate(&mut self, name: &str) -> &mut TypesBuilder {
if name == "all" {
for name in self.types.keys() {
self.negated.push(name.to_string());
}
} else {
self.negated.push(name.to_string());
}
self
}
@@ -333,7 +398,7 @@ mod tests {
btypes.select(sel);
}
for selnot in $selnot {
btypes.select_not(selnot);
btypes.negate(selnot);
}
let types = btypes.build().unwrap();
let mat = types.matched($path, false);

View File

@@ -135,8 +135,3 @@ impl Iterator for WalkEventIter {
}
}
}
fn is_hidden(ent: &DirEntry) -> bool {
ent.depth() > 0 &&
ent.file_name().to_str().map(|s| s.starts_with(".")).unwrap_or(false)
}

View File

@@ -219,6 +219,13 @@ sherlock!(file_types, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, "file.rs:Sherlock\n");
});
sherlock!(file_types_all, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.create("file.py", "Sherlock");
cmd.arg("-t").arg("all");
let lines: String = wd.stdout(&mut cmd);
assert_eq!(lines, "file.py:Sherlock\n");
});
sherlock!(file_types_negate, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.remove("sherlock");
wd.create("file.py", "Sherlock");
@@ -228,6 +235,18 @@ sherlock!(file_types_negate, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, "file.py:Sherlock\n");
});
sherlock!(file_types_negate_all, "Sherlock", ".",
|wd: WorkDir, mut cmd: Command| {
wd.create("file.py", "Sherlock");
cmd.arg("-T").arg("all");
let lines: String = wd.stdout(&mut cmd);
assert_eq!(lines, "\
sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock
sherlock:be, to a very large extent, the result of luck. Sherlock Holmes
");
});
sherlock!(file_type_clear, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.create("file.py", "Sherlock");
wd.create("file.rs", "Sherlock");