Skip to content

analyzer takes a long time to process deletion of empty file on linux #55560

Open
@Hixie

Description

@Hixie

STEPS TO REPRODUCE

  1. Run flutter analyze --watch in a big package, e.g. the flutter framework (https://github.com/flutter/flutter/tree/master/packages/flutter)
  2. From a separate terminal, create an empty file in that package, e.g. touch foo.dart
  3. Delete that file, e.g. rm foo.dart

EXPECTED RESULTS

Step 1 should take a while. Steps 2 and 3 should each trigger a very fast reanalysis.

ACTUAL RESULTS

Step 1 takes a while. Step 2 triggers a fast analysis. Step 3 triggers a multi-second analysis.

CONTEXT

This impacts users of IDEs that create temporary files with .dart extensions. For example, Emacs creates advisory lock files with names like .#animated_size_test.dart when a file is edited and not saved. (Actually in the case of Emacs it's not even a file, it's a symlink to a non-existent file, but the effect on the analyzer is the same.) When a file is saved, reanalysis takes multiple seconds every time even though nothing has changed, because the editor deletes this temporary file with a .dart extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-stabilityarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions