Back to ty 1.0

Editor benchmark edits

Each edit changes a definition used in another file. The benchmark opens the files listed below, waits for initial diagnostics, then applies the same change for each language server. The chart shows the mean time to update diagnostics for the open files over ten runs after two warmups.

Project and editOther open files
FastAPIfastapi/utils.pyChange the return type of generate_unique_id from str to int.fastapi/routing.py
pandaspandas/_typing.pyRemove AxisInt from the Axis union, leaving the three string literals.pandas/core/frame.py
PyTorchtorch/nn/__init__.pyRemove the Parameter re-export from torch.nn.torch/distributed/pipelining/_backward.py
Home Assistanthomeassistant/core.pyChange CALLBACK_TYPE from a callback that takes no arguments to one that takes a str.homeassistant/helpers/event.py
Blacksrc/black/nodes.pyAdd int to the LN union of Leaf and Node.src/black/linegen.py
discord.pydiscord/abc.pyChange the type of id from int to str.discord/channel.py
isortisort/settings.pyChange the file_path parameter of is_skipped from Path to str.isort/files.py
Jinjasrc/jinja2/nodes.pyChange iter_child_nodes to yield str instead of Node.src/jinja2/compiler.pysrc/jinja2/idtracking.pysrc/jinja2/visitor.py
Prefectsrc/prefect/server/models/events.pyChange the return type of deployment_status_event from Event to int.src/prefect/server/models/deployments.py
HTTPXhttpx/_urls.pyChange the return type of raw_path from bytes to str.httpx/_client.py
NumPynumpy/_core/multiarray.pyiChange the return type of normalize_axis_index from int to str.numpy/_core/numeric.py
SQLAlchemylib/sqlalchemy/util/_collections.pyChange the return type of to_list from List[Any] to int.lib/sqlalchemy/orm/mapper.py
Richrich/color.pyChange the return type of get_ansi_codes from Tuple[str, ...] to int.rich/style.py
Djangodjango/utils/encoding.pyAdd an int return annotation to force_str.django/contrib/auth/hashers.py
SymPysympy/core/sorting.pyAdd an int return annotation to ordered.sympy/core/basic.py
OpenAI SDKsrc/openai/_compat.pyChange the return type of get_model_fields from dict[str, FieldInfo] to int.src/openai/_models.py
pytestsrc/_pytest/pathlib.pyChange the return type of absolutepath from Path to int.src/_pytest/config/__init__.py

The benchmark results include the timings for each project. The raw data records the exact replacements in each benchmark’s params.project_setup.