Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unusual throttling behavior in DDS #47042

Closed
elliette opened this issue Aug 30, 2021 · 4 comments
Closed

Unusual throttling behavior in DDS #47042

elliette opened this issue Aug 30, 2021 · 4 comments
Assignees
Labels
area-observatory pkg-dds For issues related to the Dart Development Service

Comments

@elliette
Copy link
Contributor

There is odd throttling behavior on some of the requests sent from DevTools when running DWDS with spawnDds set to true.

I’m measuring the time for each of the stream requests here to complete.

With spawnDds set to true, the first few requests complete relatively quickly (100 ms), and the others are significantly slower (300 ms).

STREAM Debug: 132 ms
STREAM Extension: 134 ms
STREAM GC: 317 ms
STREAM Isolate: 317 ms
STREAM Logging: 317 ms
STREAM Stderr: 317 ms
STREAM Stdout: 318 ms
STREAM Timeline: 318 ms
STREAM VM: 318 ms
STREAM Service: 318 ms

With spawnDds set to false, all of the requests take around 200 ms.

STREAM Debug: 167 ms
STREAM Extension: 167 ms
STREAM GC: 199 ms
STREAM Isolate: 200 ms
STREAM Logging: 201 ms
STREAM Stderr: 201 ms
STREAM Stdout: 202 ms
STREAM Timeline: 202 ms
STREAM VM: 203 ms
STREAM Service: 206 ms
@annagrin
Copy link
Contributor

/cc @bkonyi

BTW the first few shorter streamListen calls are short because they are cached by DDS.

@bkonyi
Copy link
Contributor

bkonyi commented Aug 31, 2021

@elliette can you try adding a 1s delay between the stream listen requests and see if those times go down? There's some synchronization logic around the stream management which might be slowing things down.

@elliette
Copy link
Contributor Author

Hi! Sure, here are the times with and without a 1 second delay between them. It does look like the times go down.

Without a delay:

--- STREAM Debug: 129 ms
--- STREAM Extension: 131 ms
--- STREAM GC: 319 ms
--- STREAM Isolate: 325 ms
--- STREAM Logging: 326 ms
--- STREAM Stderr: 326 ms
--- STREAM Stdout: 326 ms
--- STREAM Timeline: 326 ms
--- STREAM VM: 327 ms
--- STREAM Service: 327 ms
STREAMS TOTAL: 327 ms

With a 1 second delay:

--- STREAM Debug: 101 ms
--- STREAM Extension: 103 ms
--- STREAM GC: 96 ms
--- STREAM Isolate: 104 ms
--- STREAM Logging: 99 ms
--- STREAM Stderr: 95 ms
--- STREAM Stdout: 111 ms
--- STREAM Timeline: 159 ms
--- STREAM VM: 168 ms
--- STREAM Service: 104 ms
STREAMS TOTAL: 11151 ms

@bkonyi
Copy link
Contributor

bkonyi commented Aug 31, 2021

Yeah, that makes sense then. We're seeing some lock contention here. I can probably make this synchronization a bit smarter so we only ever lock around streamListen when there's an outstanding streamCancel, since streamCancel can put us in a bad state if it runs while we're in the middle of processing a streamListen on the same stream.

@bkonyi bkonyi self-assigned this Aug 31, 2021
@bkonyi bkonyi added the pkg-dds For issues related to the Dart Development Service label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-observatory pkg-dds For issues related to the Dart Development Service
Projects
None yet
Development

No branches or pull requests

4 participants