[ty] Use jemalloc on linux (#21975)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Micha Reiser 2025-12-15 16:04:34 +01:00 committed by GitHub
parent d08e414179
commit 5372bb3440
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 1 deletions

1
Cargo.lock generated
View File

@ -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",

View File

@ -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

View File

@ -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;

View File

@ -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":