Skip to content

Add diesel to the rustc perf test suite #807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions collector/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ These are real programs that are important in some way, and worth tracking.
These are real programs that are known to stress the compiler in interesting
ways.

- **diesel**: A type save SQL query builder. Utilizes the type system to
Copy link

@SunnyWar SunnyWar Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should say, "A type safe SQL query builder."

ensure a lot of invariants. Stresses anything related to resolving
trait bounds, by having a lot of trait impls for a large number of different
types.
- **encoding**: Character encoding support. Contains some large tables.
- **html5ever**: An HTML parser. Stresses macro parsing code significantly.
- **inflate**: An old implementation of the DEFLATE algorithm. Stresses the
Expand Down
29 changes: 29 additions & 0 deletions collector/benchmarks/diesel/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.rs]
indent_style = space
indent_size = 4

[*.toml]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2
15 changes: 15 additions & 0 deletions collector/benchmarks/diesel/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The database to use when testing against Postgres.
PG_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/diesel_test
# The database to use when running the Postgres examples during testing.
PG_EXAMPLE_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/diesel_example

# The database to use when testing against MySQL.
MYSQL_DATABASE_URL=mysql://[email protected]:3306/diesel_test
# The database to use when running the MySQL examples during testing.
MYSQL_EXAMPLE_DATABASE_URL=mysql://[email protected]:3306/diesel_example
# A database different from the others above used for certain unit tests.
# TODO: this is magical, explain what it's there for.
MYSQL_UNIT_TEST_DATABASE_URL=mysql://[email protected]:3306/diesel_unit_test

# The database to use when testing against SQLite.
SQLITE_DATABASE_URL=/tmp/diesel_test.sqlite
1 change: 1 addition & 0 deletions collector/benchmarks/diesel/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [sgrif, weiznich]
51 changes: 51 additions & 0 deletions collector/benchmarks/diesel/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!--
If you want to report a bug, we added some points below you can fill out. If you want to request a feature, feel free to remove all the irrelevant text. In addition to this [issue tracker](https://github.com/diesel-rs/diesel/issues), you can also talk to Diesel maintainers and users on [Gitter](https://gitter.im/diesel-rs/diesel).
-->

## Setup

### Versions

- **Rust:**
- **Diesel:**
- **Database:**
- **Operating System**

### Feature Flags

- **diesel:**

## Problem Description


### What are you trying to accomplish?


### What is the expected output?


### What is the actual output?


### Are you seeing any additional errors?


### Steps to reproduce

<!--
Please include as much of your codebase as needed to reproduce the error. If the relevant files are large, please consider linking to a public repository or a [Gist](https://gist.github.com/).

Please post as much of your database schema as necessary. If you are using `infer_schema!`, you can use `diesel print-schema` and post the relevant parts from that.
-->

## Checklist

- [ ] I have already looked over the [issue tracker](https://github.com/diesel-rs/diesel/issues) for similar issues.
- [ ] This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case)

<!--
Thank you for your submission! You're helping make Diesel more robust 🎉

We'll try to respond as quickly as possible.
-->
16 changes: 16 additions & 0 deletions collector/benchmarks/diesel/.github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
schedule:
- cron: '0 0 */7 * *'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
53 changes: 53 additions & 0 deletions collector/benchmarks/diesel/.github/workflows/benches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
pull_request:
types:
- labeled

name: Benchmarks

jobs:
benchmarks:
if: github.event.label.name == 'run-benchmarks'
runs-on: ubuntu-latest
strategy:
matrix:
backend: ["postgres", "sqlite", "mysql"]
steps:
- name: Checkout sources
if: steps.bench.outputs.triggered == 'true'
uses: actions/checkout@v2

- name: Install postgres (Linux)
if: matrix.backend == 'postgres'
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev postgresql
echo "host all all 127.0.0.1/32 md5" > sudo tee -a /etc/postgresql/10/main/pg_hba.conf
sudo service postgresql restart && sleep 3
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo service postgresql restart && sleep 3
echo '::set-env name=PG_DATABASE_URL::postgres://postgres:postgres@localhost/'

- name: Install sqlite (Linux)
if: matrix.backend == 'sqlite'
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
echo '::set-env name=SQLITE_DATABASE_URL::/tmp/test.db'


- name: Install mysql (Linux)
if: matrix.backend == 'mysql'
run: |
sudo apt-get update
sudo apt-get -y install mysql-server libmysqlclient-dev
sudo /etc/init.d/mysql start
mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot -proot
echo '::set-env name=MYSQL_DATABASE_URL::mysql://root:root@localhost/diesel_test'

- name: Run benches
uses: jasonwilliams/criterion-compare-action@move_to_actions
with:
cwd: "diesel_bench"
token: ${{ secrets.GITHUB_TOKEN }}

Loading