-
Notifications
You must be signed in to change notification settings - Fork 163
Add target column, defaulting to x86_64-unknown-linux-gnu
#2059
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
Conversation
Kobzol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I would rename it to CompileTarget, as compiler target is not a terminology that I know from anywhere and it could be a bit misleading.
I thought that using a String is fine for this, but now that I'm thinking about it, using an enum would have a non-trivial advantage in that it would be more efficient, especially memory wise. The Index and the queries go through tens of thousands of commits, and the webserver machine is not very beefy, so I would like to ask you to turn the target into an enum, which should take way less memory (and also be faster).
It will also make it easier to generate CLI help for selecting targets, as we will have a known set of targets.
Thanks! With respect to the |
|
I meant to handle it in the same way as we do for the other enums, e.g. (btw I left you some messages on Zulip regarding the naming :) ) |
compiler_target column, defaulting to x86_64-unknown-linux-gnutarget column, defaulting to x86_64-unknown-linux-gnu
Kobzol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, left a few nits.
It would be nice to also modify the postgres-to-sqlite.rs and sqlite-to-postgres.rs binaries in the database crate. It's not super important though, I can do it later if needed.
…e sql conversion scripts
Kobzol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Have you tried to gather benchmarks locally and visualize them in the local website? Just to check that this works. I will also try it locally later.
I ran the migration locally on a SQLite database I downloaded using the |
|
Just a note that might be useful going forward: when performing DB changes, it's also useful to test it on Postgres, because the two DB implementations are completely separate. I use the following version: '3'
services:
postgres:
image: 'postgres:15.3'
ports:
- '5432:5432'
environment:
POSTGRES_PASSWORD: 'postgres'
POSTGRES_USER: 'postgres'
POSTGRES_DB: 'perf'and then specify the connection string using the $ cargo run --bin collector bench_local `rustup +nightly which rustc` --include helloworld --db postgresql://postgres:[email protected]:5432/perfI tested this on Postgres and it looks fine. |
| @@ -0,0 +1,16 @@ | |||
| /// Target representing an Rust target tripple, for a full list of targets and | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Target representing an Rust target tripple, for a full list of targets and | |
| /// Target representing an Rust target triple, for a full list of targets and |
database/src/lib.rs
Outdated
| profile: Profile, | ||
| scenario: Scenario, | ||
| backend: CodegenBackend, | ||
| metric: Metric, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also keep the target before metric here, to keep metric at the end?
database/src/lib.rs
Outdated
| .map | ||
| .keys() | ||
| .map(|(_, _, _, _, metric)| metric) | ||
| .map(|(_, _, _, _, metric, _)| metric) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .map(|(_, _, _, _, metric, _)| metric) | |
| .map(|(_, _, _, _, _, metric)| metric) |
Otherwise it would actually select the target.
database/src/pool/postgres.rs
Outdated
| Profile::from_str(row.get::<_, String>(2).as_str()).unwrap(), | ||
| row.get::<_, String>(3).as_str().parse().unwrap(), | ||
| CodegenBackend::from_str(row.get::<_, String>(4).as_str()).unwrap(), | ||
| Target::from_str(row.get::<_, String>(6).as_str()).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Target::from_str(row.get::<_, String>(6).as_str()).unwrap(), | |
| Target::from_str(row.get::<_, String>(5).as_str()).unwrap(), |
And the line below need to use (6).
Kobzol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I think that this is ready now, but I will hold off merging until Monday, just to avoid deploying on a Friday evening =D
|
Actually, CI is not green yet. |
The error; |
|
Ah, yes, here, you deleted an old migration. |
Kobzol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! :)
The PR adds a
compiler_targetcolumn to thepstat_seriestable. As well as passing through thecompiler_target; currently it isCompilerTarget::default()which is set tox86_64-unknown-linux-gnu.