Skip to content

Commit ff4e6fb

Browse files
authored
Merge pull request #1445 from rust-lang/ripgrep-tiny
Add `ripgrep-13.0.0-tiny` benchmark
2 parents d41f1bf + 922e06d commit ff4e6fb

File tree

100 files changed

+28479
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+28479
-0
lines changed

collector/benchmarks/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ compiler in interesting ways.
104104
actix-web and other libraries with similarly nested type combinators.
105105
- **regression-31157**: A small program that caused a [large performance
106106
regression](https://github.com/rust-lang/rust/issues/31157) from the past.
107+
- **ripgrep-13.0.0-tiny**: A line-oriented search tool, optimized with flags that should reduce
108+
binary size.
107109
- **token-stream-stress**: A proc-macro crate. Constructs a long token stream
108110
much like the `quote` crate does, which caused [quadratic
109111
behavior](https://github.com/rust-lang/rust/issues/65080) in the past.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# On Windows MSVC, statically link the C runtime so that the resulting EXE does
2+
# not depend on the vcruntime DLL.
3+
#
4+
# See: https://github.com/BurntSushi/ripgrep/pull/1613
5+
[target.x86_64-pc-windows-msvc]
6+
rustflags = ["-C", "target-feature=+crt-static"]
7+
[target.i686-pc-windows-msvc]
8+
rustflags = ["-C", "target-feature=+crt-static"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"git": {
3+
"sha1": "af6b6c543b224d348a8876f0c06245d9ea7929c5"
4+
}
5+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: Bug report
3+
about: An issue with ripgrep or any of its crates (ignore, globset, etc.)
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
10+
#### What version of ripgrep are you using?
11+
12+
Replace this text with the output of `rg --version`.
13+
14+
#### How did you install ripgrep?
15+
16+
If you installed ripgrep with snap and are getting strange file permission or
17+
file not found errors, then please do not file a bug. Instead, use one of the
18+
Github binary releases.
19+
20+
#### What operating system are you using ripgrep on?
21+
22+
Replace this text with your operating system and version.
23+
24+
#### Describe your bug.
25+
26+
Give a high level description of the bug.
27+
28+
#### What are the steps to reproduce the behavior?
29+
30+
If possible, please include both your search patterns and the corpus on which
31+
you are searching. Unless the bug is very obvious, then it is unlikely that it
32+
will be fixed if the ripgrep maintainers cannot reproduce it.
33+
34+
If the corpus is too big and you cannot decrease its size, file the bug anyway
35+
and the ripgrep maintainers will help figure out next steps.
36+
37+
#### What is the actual behavior?
38+
39+
Show the command you ran and the actual output. Include the `--debug` flag in
40+
your invocation of ripgrep.
41+
42+
If the output is large, put it in a gist: https://gist.github.com/
43+
44+
If the output is small, put it in code fences:
45+
46+
```
47+
your
48+
output
49+
goes
50+
here
51+
```
52+
53+
#### What is the expected behavior?
54+
55+
What do you think ripgrep should have done?
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Ask a question
4+
about: |
5+
You've come to seek help or want to discuss something related to ripgrep.
6+
url: https://github.com/BurntSushi/ripgrep/discussions/new
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for ripgrep
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
10+
#### Describe your feature request
11+
12+
Please describe the behavior you want and the motivation. Please also provide
13+
examples of how ripgrep would be used if your feature request were added.
14+
15+
If you're not sure what to write here, then try imagining what the ideal
16+
documentation of your new feature would look like in ripgrep's man page. Then
17+
try to write it.
18+
19+
If you're requesting the addition or change of default file types, please open
20+
a PR. We can discuss it there if necessary.
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: '00 01 * * *'
9+
jobs:
10+
test:
11+
name: test
12+
env:
13+
# For some builds, we use cross to test on 32-bit and big-endian
14+
# systems.
15+
CARGO: cargo
16+
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
17+
TARGET_FLAGS:
18+
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
19+
TARGET_DIR: ./target
20+
# Emit backtraces on panics.
21+
RUST_BACKTRACE: 1
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
build:
26+
# We test ripgrep on a pinned version of Rust, along with the moving
27+
# targets of 'stable' and 'beta' for good measure.
28+
- pinned
29+
- stable
30+
- beta
31+
# Our release builds are generated by a nightly compiler to take
32+
# advantage of the latest optimizations/compile time improvements. So
33+
# we test all of them here. (We don't do mips releases, but test on
34+
# mips for big-endian coverage.)
35+
- nightly
36+
- nightly-musl
37+
- nightly-32
38+
- nightly-mips
39+
- nightly-arm
40+
- macos
41+
- win-msvc
42+
- win-gnu
43+
include:
44+
- build: pinned
45+
os: ubuntu-18.04
46+
rust: 1.52.1
47+
- build: stable
48+
os: ubuntu-18.04
49+
rust: stable
50+
- build: beta
51+
os: ubuntu-18.04
52+
rust: beta
53+
- build: nightly
54+
os: ubuntu-18.04
55+
rust: nightly
56+
- build: nightly-musl
57+
os: ubuntu-18.04
58+
rust: nightly
59+
target: x86_64-unknown-linux-musl
60+
- build: nightly-32
61+
os: ubuntu-18.04
62+
rust: nightly
63+
target: i686-unknown-linux-gnu
64+
- build: nightly-mips
65+
os: ubuntu-18.04
66+
rust: nightly
67+
target: mips64-unknown-linux-gnuabi64
68+
- build: nightly-arm
69+
os: ubuntu-18.04
70+
rust: nightly
71+
# For stripping release binaries:
72+
# docker run --rm -v $PWD/target:/target:Z \
73+
# rustembedded/cross:arm-unknown-linux-gnueabihf \
74+
# arm-linux-gnueabihf-strip \
75+
# /target/arm-unknown-linux-gnueabihf/debug/rg
76+
target: arm-unknown-linux-gnueabihf
77+
- build: macos
78+
os: macos-latest
79+
rust: nightly
80+
- build: win-msvc
81+
os: windows-2019
82+
rust: nightly
83+
- build: win-gnu
84+
os: windows-2019
85+
rust: nightly-x86_64-gnu
86+
steps:
87+
- name: Checkout repository
88+
uses: actions/checkout@v2
89+
90+
- name: Install packages (Ubuntu)
91+
if: matrix.os == 'ubuntu-18.04'
92+
run: |
93+
ci/ubuntu-install-packages
94+
95+
- name: Install packages (macOS)
96+
if: matrix.os == 'macos-latest'
97+
run: |
98+
ci/macos-install-packages
99+
100+
- name: Install Rust
101+
uses: actions-rs/toolchain@v1
102+
with:
103+
toolchain: ${{ matrix.rust }}
104+
profile: minimal
105+
override: true
106+
107+
- name: Use Cross
108+
if: matrix.target != ''
109+
run: |
110+
cargo install cross
111+
echo "CARGO=cross" >> $GITHUB_ENV
112+
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
113+
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
114+
115+
- name: Show command used for Cargo
116+
run: |
117+
echo "cargo command is: ${{ env.CARGO }}"
118+
echo "target flag is: ${{ env.TARGET_FLAGS }}"
119+
120+
- name: Build ripgrep and all crates
121+
run: ${{ env.CARGO }} build --verbose --workspace ${{ env.TARGET_FLAGS }}
122+
123+
- name: Build ripgrep with PCRE2
124+
run: ${{ env.CARGO }} build --verbose --workspace --features pcre2 ${{ env.TARGET_FLAGS }}
125+
126+
# This is useful for debugging problems when the expected build artifacts
127+
# (like shell completions and man pages) aren't generated.
128+
- name: Show build.rs stderr
129+
shell: bash
130+
run: |
131+
set +x
132+
stderr="$(find "${{ env.TARGET_DIR }}/debug" -name stderr -print0 | xargs -0 ls -t | head -n1)"
133+
if [ -s "$stderr" ]; then
134+
echo "===== $stderr ===== "
135+
cat "$stderr"
136+
echo "====="
137+
fi
138+
set -x
139+
140+
- name: Run tests with PCRE2 (sans cross)
141+
if: matrix.target == ''
142+
run: ${{ env.CARGO }} test --verbose --workspace --features pcre2 ${{ env.TARGET_FLAGS }}
143+
144+
- name: Run tests without PCRE2 (with cross)
145+
# These tests should actually work, but they almost double the runtime.
146+
# Every integration test spins up qemu to run 'rg', and when PCRE2 is
147+
# enabled, every integration test is run twice: one with the default
148+
# regex engine and once with PCRE2.
149+
if: matrix.target != ''
150+
run: ${{ env.CARGO }} test --verbose --workspace ${{ env.TARGET_FLAGS }}
151+
152+
- name: Test for existence of build artifacts (Windows)
153+
if: matrix.os == 'windows-2019'
154+
shell: bash
155+
run: |
156+
outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
157+
ls "$outdir/_rg.ps1" && file "$outdir/_rg.ps1"
158+
159+
- name: Test for existence of build artifacts (Unix)
160+
if: matrix.os != 'windows-2019'
161+
shell: bash
162+
run: |
163+
outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
164+
# TODO: Check for the man page generation here. For whatever reason,
165+
# it seems to be intermittently failing in CI. No idea why.
166+
# for f in rg.bash rg.fish rg.1; do
167+
for f in rg.bash rg.fish; do
168+
# We could use file -E here, but it isn't supported on macOS.
169+
ls "$outdir/$f" && file "$outdir/$f"
170+
done
171+
172+
- name: Test zsh shell completions (Unix, sans cross)
173+
# We could test this when using Cross, but we'd have to execute the
174+
# 'rg' binary (done in test-complete) with qemu, which is a pain and
175+
# doesn't really gain us much. If shell completion works in one place,
176+
# it probably works everywhere.
177+
if: matrix.target == '' && matrix.os != 'windows-2019'
178+
shell: bash
179+
run: ci/test-complete
180+
181+
rustfmt:
182+
name: rustfmt
183+
runs-on: ubuntu-18.04
184+
steps:
185+
- name: Checkout repository
186+
uses: actions/checkout@v2
187+
- name: Install Rust
188+
uses: actions-rs/toolchain@v1
189+
with:
190+
toolchain: stable
191+
override: true
192+
profile: minimal
193+
components: rustfmt
194+
- name: Check formatting
195+
run: |
196+
cargo fmt --all -- --check
197+
198+
docs:
199+
name: Docs
200+
runs-on: ubuntu-20.04
201+
steps:
202+
- name: Checkout repository
203+
uses: actions/checkout@v2
204+
- name: Install Rust
205+
uses: actions-rs/toolchain@v1
206+
with:
207+
toolchain: stable
208+
profile: minimal
209+
override: true
210+
- name: Check documentation
211+
env:
212+
RUSTDOCFLAGS: -D warnings
213+
run: cargo doc --no-deps --document-private-items --workspace

0 commit comments

Comments
 (0)