diff options
-rw-r--r-- | Cargo.lock | 50 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | benchsuite/runs/2016-12-30-archlinux-cheetah/raw.csv | 157 | ||||
-rw-r--r-- | benchsuite/runs/2016-12-30-archlinux-cheetah/summary | 126 | ||||
-rw-r--r-- | globset/Cargo.toml | 2 | ||||
-rw-r--r-- | globset/src/glob.rs | 2 | ||||
-rw-r--r-- | globset/src/lib.rs | 2 | ||||
-rw-r--r-- | grep/Cargo.toml | 4 | ||||
-rw-r--r-- | grep/src/lib.rs | 2 | ||||
-rw-r--r-- | grep/src/literals.rs | 8 | ||||
-rw-r--r-- | grep/src/search.rs | 16 | ||||
-rw-r--r-- | ignore/Cargo.toml | 2 | ||||
-rw-r--r-- | src/args.rs | 2 | ||||
-rw-r--r-- | src/printer.rs | 19 |
14 files changed, 335 insertions, 61 deletions
@@ -14,7 +14,7 @@ dependencies = [ "memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 0.1.1", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -71,7 +71,6 @@ version = "0.3.5" 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.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -98,7 +97,7 @@ dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -107,8 +106,8 @@ version = "0.1.4" dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -120,7 +119,7 @@ dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -186,20 +185,20 @@ dependencies = [ [[package]] name = "regex" -version = "0.1.80" +version = "0.2.0" 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.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.0 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -231,15 +230,6 @@ dependencies = [ [[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.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread-id" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ @@ -249,14 +239,6 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.2.7" -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 = "thread_local" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ @@ -284,7 +266,7 @@ dependencies = [ [[package]] name = "utf8-ranges" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -342,19 +324,17 @@ dependencies = [ "checksum memchr 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7492849298f0731c393b1f34ce03a7c84c00bead2e7057db9342907c8fdcae28" "checksum memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "065ce59af31c18ea2c419100bda6247dd4ec3099423202b12f0bd32e529fabd2" "checksum num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55aabf4e2d6271a2e4e4c0f2ea1f5b07cc589cc1a9e9213013b54a76678ca4f3" -"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" -"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" +"checksum regex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5338778c78b1d17424ffc270282b611c2e2fab6af72e59afd691b324451a2587" +"checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" "checksum simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5847c2d766ca7ce7227672850955802fabd779ba616aeabead4c2c3877023" "checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" "checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0" -"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a" -"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" "checksum thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7793b722f0f77ce716e7f1acf416359ca32ff24d04ffbac4269f44a4a83be05d" "checksum unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c3bc443ded17b11305ffffe6b37e2076f328a5a8cb6aa877b1b98f77699e98b5" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" -"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" +"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd7c16466ecc507c7cb5988db03e6eab4aaeab89a5c37a29251fcfd3ac9b7afe" @@ -27,7 +27,7 @@ path = "tests/tests.rs" [dependencies] bytecount = "0.1.4" clap = "2.19.0" -env_logger = "0.3" +env_logger = { version = "0.3", default-features = false } grep = { version = "0.1.4", path = "grep" } ignore = { version = "0.1.5", path = "ignore" } lazy_static = "0.2" @@ -36,7 +36,7 @@ log = "0.3" memchr = "1" memmap = "0.5" num_cpus = "1" -regex = "0.1.77" +regex = "0.2.0" termcolor = { version = "0.1.0", path = "termcolor" } [target.'cfg(windows)'.dependencies] diff --git a/benchsuite/runs/2016-12-30-archlinux-cheetah/raw.csv b/benchsuite/runs/2016-12-30-archlinux-cheetah/raw.csv new file mode 100644 index 00000000..e780d273 --- /dev/null +++ b/benchsuite/runs/2016-12-30-archlinux-cheetah/raw.csv @@ -0,0 +1,157 @@ +benchmark,warmup_iter,iter,name,command,duration,lines,env
+linux_alternates,1,3,rg (ignore),rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.09816598892211914,68,
+linux_alternates,1,3,rg (ignore),rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.08965039253234863,68,
+linux_alternates,1,3,rg (ignore),rg -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.09101128578186035,68,
+linux_alternates,1,3,rg (whitelist),rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.07472872734069824,68,
+linux_alternates,1,3,rg (whitelist),rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.07628297805786133,68,
+linux_alternates,1,3,rg (whitelist),rg --no-ignore -n ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.07189559936523438,68,
+linux_alternates_casei,1,3,rg (ignore),rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.10288548469543457,160,
+linux_alternates_casei,1,3,rg (ignore),rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.10204243659973145,160,
+linux_alternates_casei,1,3,rg (ignore),rg -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.1031193733215332,160,
+linux_alternates_casei,1,3,rg (whitelist),rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.08190178871154785,160,
+linux_alternates_casei,1,3,rg (whitelist),rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.08523178100585938,160,
+linux_alternates_casei,1,3,rg (whitelist),rg --no-ignore -n -i ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT,0.07952761650085449,160,
+linux_literal,1,3,rg (ignore),rg -n PM_RESUME,0.06972551345825195,16,
+linux_literal,1,3,rg (ignore),rg -n PM_RESUME,0.0691523551940918,16,
+linux_literal,1,3,rg (ignore),rg -n PM_RESUME,0.06865429878234863,16,
+linux_literal,1,3,rg (ignore) (mmap),rg -n --mmap PM_RESUME,0.39247632026672363,16,
+linux_literal,1,3,rg (ignore) (mmap),rg -n --mmap PM_RESUME,0.4009978771209717,16,
+linux_literal,1,3,rg (ignore) (mmap),rg -n --mmap PM_RESUME,0.40122294425964355,16,
+linux_literal,1,3,rg (whitelist),rg -n --no-ignore -tall PM_RESUME,0.062048912048339844,16,
+linux_literal,1,3,rg (whitelist),rg -n --no-ignore -tall PM_RESUME,0.05932760238647461,16,
+linux_literal,1,3,rg (whitelist),rg -n --no-ignore -tall PM_RESUME,0.058171749114990234,16,
+linux_literal_casei,1,3,rg (ignore),rg -n -i PM_RESUME,0.08261799812316895,370,
+linux_literal_casei,1,3,rg (ignore),rg -n -i PM_RESUME,0.0780181884765625,370,
+linux_literal_casei,1,3,rg (ignore),rg -n -i PM_RESUME,0.07934045791625977,370,
+linux_literal_casei,1,3,rg (ignore) (mmap),rg -n -i --mmap PM_RESUME,0.4008915424346924,370,
+linux_literal_casei,1,3,rg (ignore) (mmap),rg -n -i --mmap PM_RESUME,0.3899986743927002,370,
+linux_literal_casei,1,3,rg (ignore) (mmap),rg -n -i --mmap PM_RESUME,0.39725732803344727,370,
+linux_literal_casei,1,3,rg (whitelist),rg -n -i --no-ignore -tall PM_RESUME,0.07104611396789551,370,
+linux_literal_casei,1,3,rg (whitelist),rg -n -i --no-ignore -tall PM_RESUME,0.0707247257232666,370,
+linux_literal_casei,1,3,rg (whitelist),rg -n -i --no-ignore -tall PM_RESUME,0.06864142417907715,370,
+linux_literal_default,1,3,rg,rg PM_RESUME,0.06764745712280273,16,
+linux_literal_default,1,3,rg,rg PM_RESUME,0.06994485855102539,16,
+linux_literal_default,1,3,rg,rg PM_RESUME,0.0682222843170166,16,
+linux_no_literal,1,3,rg (ignore),rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.27941250801086426,490,
+linux_no_literal,1,3,rg (ignore),rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.31389880180358887,490,
+linux_no_literal,1,3,rg (ignore),rg -n \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.30502963066101074,490,
+linux_no_literal,1,3,rg (ignore) (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.16565680503845215,490,
+linux_no_literal,1,3,rg (ignore) (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.16579079627990723,490,
+linux_no_literal,1,3,rg (ignore) (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.169691801071167,490,
+linux_no_literal,1,3,rg (whitelist),rg -n --no-ignore -tall \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.2969038486480713,419,
+linux_no_literal,1,3,rg (whitelist),rg -n --no-ignore -tall \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.2995884418487549,419,
+linux_no_literal,1,3,rg (whitelist),rg -n --no-ignore -tall \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.27426910400390625,419,
+linux_no_literal,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.15207958221435547,419,
+linux_no_literal,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.15367984771728516,419,
+linux_no_literal,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5},0.15249848365783691,419,
+linux_re_literal_suffix,1,3,rg (ignore),rg -n [A-Z]+_RESUME,0.07145977020263672,1652,
+linux_re_literal_suffix,1,3,rg (ignore),rg -n [A-Z]+_RESUME,0.07139325141906738,1652,
+linux_re_literal_suffix,1,3,rg (ignore),rg -n [A-Z]+_RESUME,0.0708932876586914,1652,
+linux_re_literal_suffix,1,3,rg (whitelist),rg -n --no-ignore -tall [A-Z]+_RESUME,0.05987191200256348,1630,
+linux_re_literal_suffix,1,3,rg (whitelist),rg -n --no-ignore -tall [A-Z]+_RESUME,0.06223797798156738,1630,
+linux_re_literal_suffix,1,3,rg (whitelist),rg -n --no-ignore -tall [A-Z]+_RESUME,0.06115579605102539,1630,
+linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.16427040100097656,23,
+linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.16524410247802734,23,
+linux_unicode_greek,1,3,rg,rg -n \p{Greek},0.1664714813232422,23,
+linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.16639113426208496,103,
+linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.16803503036499023,103,
+linux_unicode_greek_casei,1,3,rg,rg -n -i \p{Greek},0.16656923294067383,103,
+linux_unicode_word,1,3,rg (ignore),rg -n \wAh,0.07580804824829102,186,
+linux_unicode_word,1,3,rg (ignore),rg -n \wAh,0.07589507102966309,186,
+linux_unicode_word,1,3,rg (ignore),rg -n \wAh,0.07574295997619629,186,
+linux_unicode_word,1,3,rg (ignore) (ASCII),rg -n (?-u)\wAh,0.07641291618347168,174,
+linux_unicode_word,1,3,rg (ignore) (ASCII),rg -n (?-u)\wAh,0.07523059844970703,174,
+linux_unicode_word,1,3,rg (ignore) (ASCII),rg -n (?-u)\wAh,0.07748007774353027,174,
+linux_unicode_word,1,3,rg (whitelist),rg -n --no-ignore -tall \wAh,0.06804847717285156,180,
+linux_unicode_word,1,3,rg (whitelist),rg -n --no-ignore -tall \wAh,0.06720519065856934,180,
+linux_unicode_word,1,3,rg (whitelist),rg -n --no-ignore -tall \wAh,0.06687021255493164,180,
+linux_unicode_word,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\wAh,0.06528687477111816,168,
+linux_unicode_word,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\wAh,0.07101035118103027,168,
+linux_unicode_word,1,3,rg (whitelist) (ASCII),rg -n --no-ignore -tall (?-u)\wAh,0.06446981430053711,168,
+linux_word,1,3,rg (ignore),rg -n -w PM_RESUME,0.07159972190856934,6,
+linux_word,1,3,rg (ignore),rg -n -w PM_RESUME,0.0695488452911377,6,
+linux_word,1,3,rg (ignore),rg -n -w PM_RESUME,0.07082796096801758,6,
+linux_word,1,3,rg (whitelist),rg -n -w --no-ignore -tall PM_RESUME,0.06297016143798828,6,
+linux_word,1,3,rg (whitelist),rg -n -w --no-ignore -tall PM_RESUME,0.06128263473510742,6,
+linux_word,1,3,rg (whitelist),rg -n -w --no-ignore -tall PM_RESUME,0.06177973747253418,6,
+subtitles_en_alternate,1,3,rg (lines),rg -n Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.36841607093811035,848,
+subtitles_en_alternate,1,3,rg (lines),rg -n Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.30306172370910645,848,
+subtitles_en_alternate,1,3,rg (lines),rg -n Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.3288271427154541,848,
+subtitles_en_alternate,1,3,rg,rg Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.3186373710632324,848,
+subtitles_en_alternate,1,3,rg,rg Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.23814082145690918,848,
+subtitles_en_alternate,1,3,rg,rg Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.23152780532836914,848,
+subtitles_en_alternate_casei,1,3,rg,rg -n -i Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.2480580806732178,862,
+subtitles_en_alternate_casei,1,3,rg,rg -n -i Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.2288904190063477,862,
+subtitles_en_alternate_casei,1,3,rg,rg -n -i Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.287020206451416,862,
+subtitles_en_literal,1,3,rg,rg Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.21738362312316895,629,
+subtitles_en_literal,1,3,rg,rg Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.16032648086547852,629,
+subtitles_en_literal,1,3,rg,rg Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.15392351150512695,629,
+subtitles_en_literal,1,3,rg (no mmap),rg --no-mmap Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.21230578422546387,629,
+subtitles_en_literal,1,3,rg (no mmap),rg --no-mmap Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.27013158798217773,629,
+subtitles_en_literal,1,3,rg (no mmap),rg --no-mmap Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.19994258880615234,629,
+subtitles_en_literal,1,3,rg (lines),rg -n Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2728753089904785,629,
+subtitles_en_literal,1,3,rg (lines),rg -n Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.23652935028076172,629,
+subtitles_en_literal,1,3,rg (lines),rg -n Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2579770088195801,629,
+subtitles_en_literal_casei,1,3,rg,rg -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.3031468391418457,642,
+subtitles_en_literal_casei,1,3,rg,rg -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.40822505950927734,642,
+subtitles_en_literal_casei,1,3,rg,rg -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.38727545738220215,642,
+subtitles_en_literal_casei,1,3,rg (lines),rg -n -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.4260599613189697,642,
+subtitles_en_literal_casei,1,3,rg (lines),rg -n -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.4490511417388916,642,
+subtitles_en_literal_casei,1,3,rg (lines),rg -n -i Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.49449872970581055,642,
+subtitles_en_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Sherlock Holmes(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2707977294921875,629,
+subtitles_en_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Sherlock Holmes(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2691836357116699,629,
+subtitles_en_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Sherlock Holmes(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.24464011192321777,629,
+subtitles_en_literal_word,1,3,rg,rg -nw Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.22373199462890625,629,
+subtitles_en_literal_word,1,3,rg,rg -nw Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.25702810287475586,629,
+subtitles_en_literal_word,1,3,rg,rg -nw Sherlock Holmes /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.23047828674316406,629,
+subtitles_en_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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.139404773712158,13,
+subtitles_en_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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.0484464168548584,13,
+subtitles_en_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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,2.0293972492218018,13,
+subtitles_en_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.840238094329834,13,
+subtitles_en_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.7812306880950928,13,
+subtitles_en_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,1.7657690048217773,13,
+subtitles_en_surrounding_words,1,3,rg,rg -n \w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.26054978370666504,317,
+subtitles_en_surrounding_words,1,3,rg,rg -n \w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2869753837585449,317,
+subtitles_en_surrounding_words,1,3,rg,rg -n \w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.22949600219726562,317,
+subtitles_en_surrounding_words,1,3,rg (ASCII),rg -n (?-u)\w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.21858429908752441,317,
+subtitles_en_surrounding_words,1,3,rg (ASCII),rg -n (?-u)\w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.2064223289489746,317,
+subtitles_en_surrounding_words,1,3,rg (ASCII),rg -n (?-u)\w+\s+Holmes\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.sample.en,0.20789289474487305,317,
+subtitles_ru_alternate,1,3,rg (lines),rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.313758373260498,691,
+subtitles_ru_alternate,1,3,rg (lines),rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.2925219535827637,691,
+subtitles_ru_alternate,1,3,rg (lines),rg -n Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.3444299697875977,691,
+subtitles_ru_alternate,1,3,rg,rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.264918565750122,691,
+subtitles_ru_alternate,1,3,rg,rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.30733060836792,691,
+subtitles_ru_alternate,1,3,rg,rg Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.1466560363769531,691,
+subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.783818244934082,735,
+subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.76894474029541,735,
+subtitles_ru_alternate_casei,1,3,rg,rg -n -i Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.788987398147583,735,
+subtitles_ru_literal,1,3,rg,rg Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.2822730541229248,583,
+subtitles_ru_literal,1,3,rg,rg Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.25232434272766113,583,
+subtitles_ru_literal,1,3,rg,rg Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.2563645839691162,583,
+subtitles_ru_literal,1,3,rg (no mmap),rg --no-mmap Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.34694504737854004,583,
+subtitles_ru_literal,1,3,rg (no mmap),rg --no-mmap Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3202054500579834,583,
+subtitles_ru_literal,1,3,rg (no mmap),rg --no-mmap Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3236703872680664,583,
+subtitles_ru_literal,1,3,rg (lines),rg -n Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.36035776138305664,583,
+subtitles_ru_literal,1,3,rg (lines),rg -n Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3270585536956787,583,
+subtitles_ru_literal,1,3,rg (lines),rg -n Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3121967315673828,583,
+subtitles_ru_literal_casei,1,3,rg,rg -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.0397696495056152,604,
+subtitles_ru_literal_casei,1,3,rg,rg -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.158402442932129,604,
+subtitles_ru_literal_casei,1,3,rg,rg -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.1158676147460938,604,
+subtitles_ru_literal_casei,1,3,rg (lines),rg -n -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.2041549682617188,604,
+subtitles_ru_literal_casei,1,3,rg (lines),rg -n -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.1511006355285645,604,
+subtitles_ru_literal_casei,1,3,rg (lines),rg -n -i Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,1.1794021129608154,604,
+subtitles_ru_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Шерлок Холмс(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.19694828987121582,,
+subtitles_ru_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Шерлок Холмс(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.1980271339416504,,
+subtitles_ru_literal_word,1,3,rg (ASCII),rg -n (?-u:\b)Шерлок Холмс(?-u:\b) /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.2128591537475586,,
+subtitles_ru_literal_word,1,3,rg,rg -nw Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3568108081817627,579,
+subtitles_ru_literal_word,1,3,rg,rg -nw Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3353869915008545,579,
+subtitles_ru_literal_word,1,3,rg,rg -nw Шерлок Холмс /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3075387477874756,579,
+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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.5629587173461914,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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.5984435081481934,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} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.4725229740142822,41,
+subtitles_ru_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.170077323913574,,
+subtitles_ru_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.064476490020752,,
+subtitles_ru_no_literal,1,3,rg (ASCII),rg -n (?-u)\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5} /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,3.159156084060669,,
+subtitles_ru_surrounding_words,1,3,rg,rg -n \w+\s+Холмс\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3924906253814697,278,
+subtitles_ru_surrounding_words,1,3,rg,rg -n \w+\s+Холмс\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.3874075412750244,278,
+subtitles_ru_surrounding_words,1,3,rg,rg -n \w+\s+Холмс\s+\w+ /data/benchsuite/subtitles/OpenSubtitles2016.raw.ru,0.39940643310546875,278,
diff --git a/benchsuite/runs/2016-12-30-archlinux-cheetah/summary b/benchsuite/runs/2016-12-30-archlinux-cheetah/summary new file mode 100644 index 00000000..f4a7451d --- /dev/null +++ b/benchsuite/runs/2016-12-30-archlinux-cheetah/summary @@ -0,0 +1,126 @@ +linux_alternates (pattern: ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT) +------------------------------------------------------------------------- +rg (ignore) 0.093 +/- 0.005 (lines: 68) +rg (whitelist)* 0.074 +/- 0.002 (lines: 68)* + +linux_alternates_casei (pattern: ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT) +------------------------------------------------------------------------------- +rg (ignore) 0.103 +/- 0.001 (lines: 160) +rg (whitelist)* 0.082 +/- 0.003 (lines: 160)* + +linux_literal (pattern: PM_RESUME) +---------------------------------- +rg (ignore) 0.069 +/- 0.001 (lines: 16) +rg (ignore) (mmap) 0.398 +/- 0.005 (lines: 16) +rg (whitelist)* 0.060 +/- 0.002 (lines: 16)* + +linux_literal_casei (pattern: PM_RESUME) +---------------------------------------- +rg (ignore) 0.080 +/- 0.002 (lines: 370) +rg (ignore) (mmap) 0.396 +/- 0.006 (lines: 370) +rg (whitelist)* 0.070 +/- 0.001 (lines: 370)* + +linux_literal_default (pattern: PM_RESUME) +------------------------------------------ +rg* 0.069 +/- 0.001 (lines: 16)* + +linux_no_literal (pattern: \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}) +----------------------------------------------------------------- +rg (ignore) 0.299 +/- 0.018 (lines: 490) +rg (ignore) (ASCII) 0.167 +/- 0.002 (lines: 490) +rg (whitelist) 0.290 +/- 0.014 (lines: 419) +rg (whitelist) (ASCII)* 0.153 +/- 0.001 (lines: 419)* + +linux_re_literal_suffix (pattern: [A-Z]+_RESUME) +------------------------------------------------ +rg (ignore) 0.071 +/- 0.000 (lines: 1652) +rg (whitelist)* 0.061 +/- 0.001 (lines: 1630)* + +linux_unicode_greek (pattern: \p{Greek}) +---------------------------------------- +rg* 0.165 +/- 0.001 (lines: 23)* + +linux_unicode_greek_casei (pattern: \p{Greek}) +---------------------------------------------- +rg* 0.167 +/- 0.001 (lines: 103)* + +linux_unicode_word (pattern: \wAh) +---------------------------------- +rg (ignore) 0.076 +/- 0.000 (lines: 186) +rg (ignore) (ASCII) 0.076 +/- 0.001 (lines: 174) +rg (whitelist) 0.067 +/- 0.001 (lines: 180) +rg (whitelist) (ASCII)* 0.067 +/- 0.004 (lines: 168)* + +linux_word (pattern: PM_RESUME) +------------------------------- +rg (ignore) 0.071 +/- 0.001 (lines: 6) +rg (whitelist)* 0.062 +/- 0.001 (lines: 6)* + +subtitles_en_alternate (pattern: Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty) +--------------------------------------------------------------------------------------------------------------- +rg (lines) 0.333 +/- 0.033 (lines: 848) +rg* 0.263 +/- 0.048 (lines: 848)* + +subtitles_en_alternate_casei (pattern: Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty) +--------------------------------------------------------------------------------------------------------------------- +rg* 2.255 +/- 0.030 (lines: 862)* + +subtitles_en_literal (pattern: Sherlock Holmes) +----------------------------------------------- +rg* 0.177 +/- 0.035 (lines: 629)* +rg (no mmap) 0.227 +/- 0.037 (lines: 629) +rg (lines) 0.256 +/- 0.018 (lines: 629) + +subtitles_en_literal_casei (pattern: Sherlock Holmes) +----------------------------------------------------- +rg* 0.366 +/- 0.056 (lines: 642)* +rg (lines) 0.457 +/- 0.035 (lines: 642) + +subtitles_en_literal_word (pattern: Sherlock Holmes) +---------------------------------------------------- +rg (ASCII) 0.262 +/- 0.015 (lines: 629) +rg* 0.237 +/- 0.018 (lines: 629)* + +subtitles_en_no_literal (pattern: \w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}\s+\w{5}) +---------------------------------------------------------------------------------------- +rg 2.072 +/- 0.059 (lines: 13) +rg (ASCII)* 1.796 +/- 0.039 (lines: 13)* + +subtitles_en_surrounding_words (pattern: \w+\s+Holmes\s+\w+) +------------------------------------------------------------ +rg 0.259 +/- 0.029 (lines: 317) +rg (ASCII)* 0.211 +/- 0.007 (lines: 317)* + +subtitles_ru_alternate (pattern: Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти) +----------------------------------------------------------------------------------------------------------- +rg (lines) 1.317 +/- 0.026 (lines: 691) +rg* 1.240 +/- 0.083 (lines: 691)* + +subtitles_ru_alternate_casei (pattern: Шерлок Холмс|Джон Уотсон|Ирен Адлер|инспектор Лестрейд|профессор Мориарти) +----------------------------------------------------------------------------------------------------------------- +rg* 3.781 +/- 0.010 (lines: 735)* + +subtitles_ru_literal (pattern: Шерлок Холмс) +-------------------------------------------- +rg* 0.264 +/- 0.016 (lines: 583)* +rg (no mmap) 0.330 +/- 0.015 (lines: 583) +rg (lines) 0.333 +/- 0.025 (lines: 583) + +subtitles_ru_literal_casei (pattern: Шерлок Холмс) +-------------------------------------------------- +rg* 1.105 +/- 0.060 (lines: 604)* +rg (lines) 1.178 +/- 0.027 (lines: 604) + +subtitles_ru_literal_word (pattern: Шерлок Холмс) +------------------------------------------------- +rg (ASCII)* 0.203 +/- 0.009 (lines: 0)* +rg 0.333 +/- 0.025 (lines: 579) + +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.545 +/- 0.065 (lines: 41) +rg (ASCII)* 3.131 +/- 0.058 (lines: 0)* + +subtitles_ru_surrounding_words (pattern: \w+\s+Холмс\s+\w+) +----------------------------------------------------------- +rg* 0.393 +/- 0.006 (lines: 278)* diff --git a/globset/Cargo.toml b/globset/Cargo.toml index ae1fe062..98df4cff 100644 --- a/globset/Cargo.toml +++ b/globset/Cargo.toml @@ -24,7 +24,7 @@ fnv = "1.0" lazy_static = "0.2" log = "0.3" memchr = "1" -regex = "0.1.77" +regex = "0.2.0" [dev-dependencies] glob = "0.2" diff --git a/globset/src/glob.rs b/globset/src/glob.rs index 279d5201..514e2ede 100644 --- a/globset/src/glob.rs +++ b/globset/src/glob.rs @@ -666,7 +666,7 @@ fn bytes_to_escaped_literal(bs: &[u8]) -> String { let mut s = String::with_capacity(bs.len()); for &b in bs { if b <= 0x7F { - s.push_str(®ex::quote(&(b as char).to_string())); + s.push_str(®ex::escape(&(b as char).to_string())); } else { s.push_str(&format!("\\x{:02x}", b)); } diff --git a/globset/src/lib.rs b/globset/src/lib.rs index 3210c58a..ae6a9e5d 100644 --- a/globset/src/lib.rs +++ b/globset/src/lib.rs @@ -202,7 +202,7 @@ fn new_regex(pat: &str) -> Result<Regex, Error> { .dot_matches_new_line(true) .size_limit(10 * (1 << 20)) .dfa_size_limit(10 * (1 << 20)) - .compile() + .build() .map_err(|err| Error::Regex(err.to_string())) } diff --git a/grep/Cargo.toml b/grep/Cargo.toml index 8f7f3aae..8ac92bf9 100644 --- a/grep/Cargo.toml +++ b/grep/Cargo.toml @@ -15,5 +15,5 @@ license = "Unlicense/MIT" [dependencies] log = "0.3" memchr = "1" -regex = "0.1.77" -regex-syntax = "0.3.9" +regex = "0.2.0" +regex-syntax = "0.4.0" diff --git a/grep/src/lib.rs b/grep/src/lib.rs index 1fd01269..3b2f0ebd 100644 --- a/grep/src/lib.rs +++ b/grep/src/lib.rs @@ -78,6 +78,6 @@ impl From<regex::Error> for Error { impl From<syntax::Error> for Error { fn from(err: syntax::Error) -> Error { - Error::Regex(regex::Error::Syntax(err)) + Error::Regex(regex::Error::Syntax(err.to_string())) } } diff --git a/grep/src/literals.rs b/grep/src/literals.rs index 3e68d24e..eebeac4c 100644 --- a/grep/src/literals.rs +++ b/grep/src/literals.rs @@ -79,12 +79,16 @@ impl LiteralSets { debug!("required literals found: {:?}", req_lits); let alts: Vec<String> = req_lits.into_iter().map(|x| bytes_to_regex(x)).collect(); - Some(RegexBuilder::new(&alts.join("|")).unicode(false)) + let mut builder = RegexBuilder::new(&alts.join("|")); + builder.unicode(false); + Some(builder) } else if lit.is_empty() { None } else { debug!("required literal found: {:?}", show(lit)); - Some(RegexBuilder::new(&bytes_to_regex(&lit)).unicode(false)) + let mut builder = RegexBuilder::new(&bytes_to_regex(&lit)); + builder.unicode(false); + Some(builder) } } } diff --git a/grep/src/search.rs b/grep/src/search.rs index cf1a4c3f..498df0c1 100644 --- a/grep/src/search.rs +++ b/ |