Skip to content

Using regular expression with trailing \n to find text is very slow in CRLF files #42142

Closed

Description

@EFanZh
  • VSCode Version: Version: 1.19.2
  • OS Version: Windows 7 64-bit

I don’t think #41503 has been properly fixed, so I open a new issue for it.

On Windows platform, search text using a regular expression with trailing \n (such as .\n) is very slow when there is a lot of matching texts.

Originally, searching for \n is also very slow, but it seems to be fixed by 73d60bd, but other search terms with trailing \n is still very slow.

Activity

  1. added
    search
    on Jan 25, 2018
  2. added
    editor-find
    and removed
    search
    on Jan 25, 2018
  3. added
    windows
    on Jan 26, 2018
  4. alexdima commented on Feb 1, 2018

    @alexdima
    Member

    EFanZh (@EFanZh) Thanks for insisting. I can reproduce, but only when the file uses CRLF \r\n as an EOL terminator (not when the file uses LF \n).

    This is the slow method -- https://github.com/Microsoft/vscode/blob/53d1ca5868c5a9d745eb46e4b19ebacc400e1569/src/vs/editor/common/model/textModelSearch.ts#L165

  5. added
    freeze-slow-crash-leak
    on Feb 1, 2018
  6. changed the title [-]Using regular expression with trailing \n to find text is very slow on Windows[/-] [+]Using regular expression with trailing \n to find text is very slow in CRLF files[/+] on Feb 1, 2018
  7. added
    bug
    and removed
    windows
    on Feb 1, 2018
  8. alexdima commented on May 4, 2018

    @alexdima
    Member

    To reproduce:

    • create a file with CRLF line endings
    • have >10k lines
    • search for .\n in regex mode
  9. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-findfreeze-slow-crash-leakverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions