mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:23 +00:00
[ty] Add separate CI job for memory usage stats (#19134)
## Summary As discussed in https://github.com/astral-sh/ruff/pull/19059.
This commit is contained in:
parent
56258bb3b7
commit
cd848986d7
6 changed files with 118 additions and 44 deletions
|
@ -296,6 +296,11 @@ impl MainLoop {
|
|||
tracing::warn!("No python files found under the given path(s)");
|
||||
}
|
||||
|
||||
// TODO: We should have an official flag to silence workspace diagnostics.
|
||||
if std::env::var("TY_MEMORY_REPORT").as_deref() == Ok("mypy_primer") {
|
||||
return Ok(ExitStatus::Success);
|
||||
}
|
||||
|
||||
let mut stdout = stdout().lock();
|
||||
|
||||
if result.is_empty() {
|
||||
|
|
|
@ -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;
|
||||
BASE.powf(bytes_to_mb(total).log(BASE).round()) as usize
|
||||
}
|
||||
|
||||
|
|
4
crates/ty_python_semantic/resources/primer/memory.txt
Normal file
4
crates/ty_python_semantic/resources/primer/memory.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
flake8
|
||||
sphinx
|
||||
prefect
|
||||
trio
|
Loading…
Add table
Add a link
Reference in a new issue