mirror of https://github.com/astral-sh/ruff
[ty] Use jemalloc on linux (#21975)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d08e414179
commit
5372bb3440
|
|
@ -4390,6 +4390,7 @@ dependencies = [
|
|||
"ruff_python_trivia",
|
||||
"salsa",
|
||||
"tempfile",
|
||||
"tikv-jemallocator",
|
||||
"toml",
|
||||
"tracing",
|
||||
"tracing-flame",
|
||||
|
|
|
|||
|
|
@ -51,5 +51,11 @@ regex = { workspace = true }
|
|||
tempfile = { workspace = true }
|
||||
toml = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
[target.'cfg(all(not(target_os = "macos"), not(target_os = "windows"), not(target_os = "openbsd"), not(target_os = "aix"), not(target_os = "android"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64", target_arch = "riscv64")))'.dependencies]
|
||||
tikv-jemallocator = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -2,6 +2,22 @@ use colored::Colorize;
|
|||
use std::io;
|
||||
use ty::{ExitStatus, run};
|
||||
|
||||
#[cfg(all(
|
||||
not(target_os = "macos"),
|
||||
not(target_os = "windows"),
|
||||
not(target_os = "openbsd"),
|
||||
not(target_os = "aix"),
|
||||
not(target_os = "android"),
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
|
||||
pub fn main() -> ExitStatus {
|
||||
run().unwrap_or_else(|error| {
|
||||
use io::Write;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ def main() -> None:
|
|||
|
||||
parser.add_argument(
|
||||
"--ty-path",
|
||||
action="append",
|
||||
type=Path,
|
||||
help="Path to the ty binary to benchmark.",
|
||||
)
|
||||
|
|
@ -108,7 +109,11 @@ def main() -> None:
|
|||
for tool_name in args.tool or TOOL_CHOICES:
|
||||
match tool_name:
|
||||
case "ty":
|
||||
suites.append(Ty(path=args.ty_path))
|
||||
if args.ty_path:
|
||||
for path in args.ty_path:
|
||||
suites.append(Ty(path=path))
|
||||
else:
|
||||
suites.append(Ty())
|
||||
case "pyrefly":
|
||||
suites.append(Pyrefly())
|
||||
case "pyright":
|
||||
|
|
|
|||
Loading…
Reference in New Issue