-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Add separate CI job for memory usage stats #19134
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -324,8 +324,8 @@ impl SalsaMemoryDump { | |
| struct DisplayShort<'a>(&'a SalsaMemoryDump); | ||
|
|
||
| fn round_memory(total: usize) -> usize { | ||
| // Round the number to the nearest power of 1.1. This gives us a | ||
| // 5% threshold before the memory usage number is considered to have | ||
| // Round the number to the nearest power of 1.05. This gives us a | ||
| // 2.5% threshold before the memory usage number is considered to have | ||
| // changed. | ||
| // | ||
| // TODO: Small changes in memory usage may cause the number to be rounded | ||
|
|
@@ -334,7 +334,7 @@ impl SalsaMemoryDump { | |
| // over time that are unrelated to the current change. Ideally we could compare | ||
| // the exact numbers across runs and compute the difference, but we don't have | ||
| // the infrastructure for that currently. | ||
| const BASE: f64 = 1.1; | ||
| const BASE: f64 = 1.05; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I lowered the threshold because single-threaded runs should be completely deterministic, and the jump between buckets is currently quite high for large numbers. |
||
| BASE.powf(bytes_to_mb(total).log(BASE).round()) as usize | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| flake8 | ||
| sphinx | ||
| prefect | ||
| trio | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somewhat arbitrarily chosen, open to suggestions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sympy might be a good addition here, I think -- we have very high memory usage on it already |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| echo "Enabling mypy primer specific configuration overloads (see .github/mypy-primer-ty.toml)" | ||
| mkdir -p ~/.config/ty | ||
| cp .github/mypy-primer-ty.toml ~/.config/ty/ty.toml | ||
|
|
||
| PRIMER_SELECTOR="$(paste -s -d'|' $PRIMER_SELECTOR)" | ||
|
|
||
| echo "new commit" | ||
| git rev-list --format=%s --max-count=1 "$GITHUB_SHA" | ||
|
|
||
| MERGE_BASE="$(git merge-base "$GITHUB_SHA" "origin/$GITHUB_BASE_REF")" | ||
| git checkout -b base_commit "$MERGE_BASE" | ||
| echo "base commit" | ||
| git rev-list --format=%s --max-count=1 base_commit | ||
|
|
||
| cd .. | ||
|
|
||
| echo "Project selector: $PRIMER_SELECTOR" | ||
| # Allow the exit code to be 0 or 1, only fail for actual mypy_primer crashes/bugs | ||
| uvx \ | ||
| --from="git+https://github.com/hauntsaninja/mypy_primer@e5f55447969d33ae3c7ccdb183e2a37101867270" \ | ||
| mypy_primer \ | ||
| --repo ruff \ | ||
| --type-checker ty \ | ||
| --old base_commit \ | ||
| --new "$GITHUB_SHA" \ | ||
| --project-selector "/($PRIMER_SELECTOR)\$" \ | ||
| --output concise \ | ||
| --debug > $DIFF_FILE || [ $? -eq 1 ] | ||
|
|
||
| # Output diff with ANSI color codes | ||
| cat $DIFF_FILE | ||
|
|
||
| # Remove ANSI color codes before uploading | ||
| sed -ie 's/\x1b\[[0-9;]*m//g' $DIFF_FILE |
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.
I, at first, didn't understand what features is needed to replace this environment variable usage but I think I understand now. What we need is a
--quietor similar flag. Would you mind opening an issue in the ty repository for adding a flag to suppress diagnostic printing (and mention Ruff's--quietand--silentflags)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.
Created astral-sh/ty#772