Skip to content

normalizeSlashes should probably no-op on *nix #44174

Description

@amcasey

As David Michon (@dmichon-msft) pointed out, Linux file names can contain backslashes, so indiscriminately converting them into forward slashes is probably a bad idea. Redefining normalizeSlashes as the identity function on non-Windows platforms would also be a perf win, since it's very hot code. The biggest concern is that someone might be depending on this (e.g. I think you can use backslashes in paths in tsconfig.json).

Activity

  1. dmichon-msft commented on May 19, 2021

    @dmichon-msft
    Contributor

    It would probably be best practice to warn or even error if any paths provided in config files or source code contain back slashes, with a note that they will have different behavior depending on OS.

  2. MartinJohns commented on May 19, 2021

    @MartinJohns
    Contributor

    David Michon (@dmichon-msft) Related to that statement: #44053

  3. jakebailey commented on Mar 9, 2023

    @jakebailey
    Member

    I tried this out in #53173 and I didn't see much of a difference; perhaps we've optimized it enough that this turns out to not be a problem anymore. But, I might be lacking a test case where this is really bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Domain: PerformanceReports of unusually slow behaviorNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions