Skip to content

Adding package http makes dart run really slow #55289

Closed
@knopp

Description

@knopp

I'm not sure if this is the right project to report this.

Dart SDK version: 3.4.0-265.0.dev (dev) (Sat Mar 23 01:03:42 2024 -0700) on "macos_arm64"

Steps to reproduce

% dart create -t cli test_1
% cd test_1
% time dart run

outputs

Resolving dependencies in /Users/Matej/Projects/dart/test_1...
Downloading packages...
Got dependencies in /Users/Matej/Projects/dart/test_1.
Building package executable...
Built test_1:test_1.
Positional arguments: []
dart run  0.54s user 0.09s system 137% cpu 0.454 total

add package http

dart pub add http
time dart run

outputs

Resolving dependencies in /Users/Matej/Projects/dart/test_1...
Downloading packages...
Got dependencies in /Users/Matej/Projects/dart/test_1.
Building package executable...
Built test_1:test_1.
Positional arguments: []
dart run  0.64s user 0.11s system 4% cpu 15.846 total

Not sure why this takes 15 seconds. It seems that the main thread is waiting for something

  * frame #0: 0x0000000183e60524 libsystem_kernel.dylib`__psynch_mutexwait + 8
    frame #1: 0x0000000183e9b168 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 84
    frame #2: 0x0000000183e98af8 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 248
    frame #3: 0x0000000183e9e688 libsystem_pthread.dylib`_pthread_cond_wait + 1368
    frame #4: 0x00000001044e2610 dart`___lldb_unnamed_symbol4504 + 152
    frame #5: 0x000000010440d324 dart`___lldb_unnamed_symbol1429 + 160
    frame #6: 0x000000010440d954 dart`___lldb_unnamed_symbol1433 + 40
    frame #7: 0x000000010440faa0 dart`___lldb_unnamed_symbol1475 + 1248
    frame #8: 0x000000010440ec84 dart`___lldb_unnamed_symbol1470 + 16
    frame #9: 0x0000000183b1d0e0 dyld`start + 2360

The dart build shipped with Flutter has stripped symbols so it doesn't help much. I'll try running this with custom engine build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions