dart-lang / dart-lang/webdev

Improve the performance of populating the Dart frames

Open
#993 21 comments 0 reactions 0 assignees View on GitHub
package:dwds symbols
Dominant language
Dart
Stars
224
Forks
94
Avg merge
7h 14m
Merged PRs (30d)
2

Description

This is a meta issue to track improving the performance of populating the Dart frames. This happens when the JS VM pauses, and is likely the main place we're spending time on when the user is stepping through code (see also https://github.com/dart-lang/webdev/issues/975). Some general thoughts:

### measurement

We should add logging to be better aware of the number of calls we are making to the chrome backend - to see if there are places where we can reduce the number of calls, increase the parallelism, or avoid some calls.

Somewhat related to https://github.com/dart-lang/webdev/issues/977.

### Optimize calls to chrome

Currently when building the dart frames, we make many async calls per frame and per variable, blocking on each call to complete. We do all the work in series. We should explore instead parallelizing the work - gathering data for all n frames in parallel, and sending the data back to the IDE when complete.

If it's possible to avoid some calls altogether, we should do that.

### compiler metadata

As part of the IPL work, the compiler will start generating more metadata that package:dwds can use. We should make use of that when available to eliminate some calls to the backend.

### package:sse

We should investigate if and how much slower SSE is than websockets. Does it create a connection per request? Does this have a high cost?

In addition, package:sse may serialize each call, and not issue a subsequent call before the first call completes. This is to ensure results are not received out of order. If true, we may want to relax this - if we have 100 calls to a backend, we want to do that in parallel as much as possible, rather than one at a time.

cc @grouma @annagrin

Contributor guide

Open the contributing guide

Research direction

Start with the measurement section and profile Dart-frame population to identify the number and sequencing of calls to the Chrome backend. Then evaluate the proposed parallelism, compiler metadata, and package:sse areas; done requires a scoped, measured performance improvement rather than resolving this broad tracking issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
performance, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.