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",
|
"ruff_python_trivia",
|
||||||
"salsa",
|
"salsa",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
|
"tikv-jemallocator",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-flame",
|
"tracing-flame",
|
||||||
|
|
|
||||||
|
|
@ -51,5 +51,11 @@ regex = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
toml = { 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]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,22 @@ use colored::Colorize;
|
||||||
use std::io;
|
use std::io;
|
||||||
use ty::{ExitStatus, run};
|
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 {
|
pub fn main() -> ExitStatus {
|
||||||
run().unwrap_or_else(|error| {
|
run().unwrap_or_else(|error| {
|
||||||
use io::Write;
|
use io::Write;
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ def main() -> None:
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ty-path",
|
"--ty-path",
|
||||||
|
action="append",
|
||||||
type=Path,
|
type=Path,
|
||||||
help="Path to the ty binary to benchmark.",
|
help="Path to the ty binary to benchmark.",
|
||||||
)
|
)
|
||||||
|
|
@ -108,7 +109,11 @@ def main() -> None:
|
||||||
for tool_name in args.tool or TOOL_CHOICES:
|
for tool_name in args.tool or TOOL_CHOICES:
|
||||||
match tool_name:
|
match tool_name:
|
||||||
case "ty":
|
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":
|
case "pyrefly":
|
||||||
suites.append(Pyrefly())
|
suites.append(Pyrefly())
|
||||||
case "pyright":
|
case "pyright":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue