Skip to content

Commit d7eaf4a

Browse files
authored
Merge pull request #1290 from nnethercote/add-tt-muncher
Add new `tt-muncher` benchmark.
2 parents 372205d + 9045af4 commit d7eaf4a

Some content is hidden

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

41 files changed

+3983
-1
lines changed

collector/benchmarks/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ compiler in interesting ways.
9999
- **token-stream-stress**: Constructs a long token stream much like the `quote`
100100
crate does, which caused [quadratic
101101
behavior](https://github.com/rust-lang/rust/issues/65080) in the past.
102+
- **tt-muncher**: Calls a quadratic TT muncher macro (based on `quote::quote!`)
103+
with a long input, which stresses macro expansion.
102104
- **tuple-stress**: Contains a single array of 65,535 nested `(i32, (f64, f64,
103105
f64))` tuples. The data was extracted and reduced from a [program dealing
104106
with grid coordinates](https://github.com/urschrei/ostn15_phf) that was

collector/benchmarks/tt-muncher/Cargo.lock

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "tt-muncher"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
quote = { path = "./quote-1.0.17-modified" }
10+
11+
[workspace]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"touch_file": "src/main.rs",
3+
"category": "secondary"
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"git": {
3+
"sha1": "0ec6e20dc9c448d53a0c6d66a76a4cd8f2126d03"
4+
},
5+
"path_in_vcs": ""
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.31.0"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: dtolnay
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule: [cron: "40 1 * * *"]
7+
8+
env:
9+
RUSTFLAGS: '-Dwarnings'
10+
11+
jobs:
12+
test:
13+
name: Rust ${{matrix.rust}}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
rust: [stable, beta, 1.36.0]
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: dtolnay/rust-toolchain@master
22+
with:
23+
toolchain: ${{matrix.rust}}
24+
- run: cargo test
25+
26+
nightly:
27+
name: Rust nightly
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: dtolnay/rust-toolchain@nightly
32+
with:
33+
components: rust-src
34+
- run: cargo test
35+
- run: cargo update -Z minimal-versions
36+
- run: cargo build
37+
38+
msrv:
39+
name: Rust 1.31.0
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: dtolnay/[email protected]
44+
- run: cargo check
45+
46+
clippy:
47+
name: Clippy
48+
runs-on: ubuntu-latest
49+
if: github.event_name != 'pull_request'
50+
steps:
51+
- uses: actions/checkout@v2
52+
- uses: dtolnay/rust-toolchain@clippy
53+
- run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
54+
55+
outdated:
56+
name: Outdated
57+
runs-on: ubuntu-latest
58+
if: github.event_name != 'pull_request'
59+
steps:
60+
- uses: actions/checkout@v2
61+
- uses: dtolnay/install@cargo-outdated
62+
- run: cargo outdated --exit-code 1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
2+
#
3+
# When uploading crates to the registry Cargo will automatically
4+
# "normalize" Cargo.toml files for maximal compatibility
5+
# with all versions of Cargo and also rewrite `path` dependencies
6+
# to registry (e.g., crates.io) dependencies.
7+
#
8+
# If you are reading this file be aware that the original Cargo.toml
9+
# will likely look very different (and much more reasonable).
10+
# See Cargo.toml.orig for the original contents.
11+
12+
[package]
13+
edition = "2018"
14+
rust-version = "1.31"
15+
name = "quote"
16+
version = "1.0.17"
17+
authors = ["David Tolnay <[email protected]>"]
18+
autobenches = false
19+
description = "Quasi-quoting macro quote!(...)"
20+
documentation = "https://docs.rs/quote/"
21+
readme = "README.md"
22+
keywords = ["syn"]
23+
categories = ["development-tools::procedural-macro-helpers"]
24+
license = "MIT OR Apache-2.0"
25+
repository = "https://github.com/dtolnay/quote"
26+
27+
[package.metadata.docs.rs]
28+
targets = ["x86_64-unknown-linux-gnu"]
29+
30+
[dependencies.proc-macro2]
31+
version = "1.0.36"
32+
default-features = false
33+
34+
# This is not needed for the `tt-muncher` benchmark.
35+
#[dev-dependencies.rustversion]
36+
#version = "1.0"
37+
38+
# This is not needed for the `tt-muncher` benchmark.
39+
#[dev-dependencies.trybuild]
40+
#version = "1.0.52"
41+
#features = ["diff"]
42+
43+
[features]
44+
default = ["proc-macro"]
45+
proc-macro = ["proc-macro2/proc-macro"]

collector/benchmarks/tt-muncher/quote-1.0.17-modified/Cargo.toml.orig

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)