Skip to content

Analyzer response to LSP requests extremely slow w/ high latency reported #56307

Open
@josephemorgan

Description

@josephemorgan

I'm intermittently having extremely slow dart analyzer performance with VS code around 10-15 times an hour.

A typical instance starts with me typing to fix an error or triggering autocomplete. When I do so, I get Loading... in the autocomplete pop-up, sometimes the VS Code status bar shows "Analyzing" with a spinner. While the analyzer is loading, error indicators in the editor window don't update (they'll report errors at locations that don't have errors) and autocomplete won't show anything. Sometimes, but not always, my editor will freeze completely until the analyzer unfreezes. The hangs usually last anywhere from 30 seconds to 3 minutes.

I suspect the issue might have something to do with how large the project is, or maybe there's something strange about our project configuration.

The analysis server diagnostics typically looks like this after freezing:
image

I understand that "latency" means the server is busy and can't start handling a request, is there any way to determine what it's busy doing?

Please let me know what other information I can provide or what debugging steps I can take.

Dart Info:


If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

#### General info

- Dart 3.4.4 (stable) (Wed Jun 12 15:54:31 2024 +0000) on "windows_x64"
- on windows / "Windows 10 Enterprise" 10.0 (Build 22631)
- locale is en-US

#### Project info

- sdk constraint: '>=3.3.4 <4.0.0'
- dependencies: accordion, app_links, auto_size_text, badges, barcode_widget, cached_network_image, camera, carousel_slider, chewie, collection, community_charts_flutter, confetti, configurable_expansion_tile_null_safety, connectivity_plus, data_table_2, datetime_picker_formfield_new, device_info_plus, easy_debounce, email_validator, exif, file_picker, firebase_core, firebase_core_platform_interface, firebase_messaging, flutter, flutter_barcode_scanner, flutter_cache_manager, flutter_date_pickers, flutter_expandable_table, flutter_file_dialog, flutter_keyboard_visibility, flutter_local_notifications, flutter_quill, flutter_slidable, flutter_speed_dial, flutter_spinkit, flutter_svg, flutter_typeahead, flutter_uploader, flutter_video_info, geocoding, geolocator, google_maps_flutter, googleapis, hive, horizontal_data_table, http, image, image_gallery_saver, image_network, image_picker, infinite_scroll_pagination, intl, jiffy, keyboard_actions, latlong2, liquid_pull_to_refresh, logger, material_design_icons_flutter, material_symbols_icons, mime, modal_progress_hud_nsn, multi_dropdown, neat_periodic_task, open_filex, package_info_plus, path, path_drawing, path_provider, pdf, percent_indicator, permission_handler, phone_form_field, photo_view, pointer_interceptor, printing, provider, screenshot, scroll_to_index, scrollable_positioned_list, share_plus, shared_preferences, sliding_up_panel, super_tooltip, table_calendar, timeago, toggle_switch, transparent_image, tuple, universal_html, universal_io, url_launcher, uuid, vector_math, version, video_player, video_thumbnail, visibility_detector, wakelock_plus
- dev_dependencies: flutter_launcher_icons, flutter_lints, flutter_test, integration_test, pubspec_dependency_sorter
- elided dependencies: 1

#### Process info

|  Memory | CPU | Elapsed time | Command line |
| ------: | --: | -----------: | ------------ |
|   12 MB |  -- |              | dart.exe     |
| 2828 MB |  -- |              | dart.exe     |
|   34 MB |  -- |              | dart.exe     |
|   15 MB |  -- |              | dart.exe     |
|   68 MB |  -- |              | dart.exe     |
|  167 MB |  -- |              | dart.exe     |
|   95 MB |  -- |              | dart.exe     |

Flutter Doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.3, on Microsoft Windows [Version 10.0.22631.3880], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.7.7)
[√] Android Studio (version 2024.1)
[√] VS Code (version unknown)
    X Unable to determine VS Code version.
[√] VS Code, 64-bit edition (version 1.91.1)
[√] VS Code (version 1.92.0-insider)
[√] Connected device (4 available)
[√] Network resources

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-performanceIssue relates to performance or code size

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions