dart-lang / dart-lang/webdev

Use shorter library IDs and names

Open
#1,425 0 comments 0 reactions 0 assignees View on GitHub
DevToolsIPL P3 triaged
Dominant language
Dart
Stars
224
Forks
94
Avg merge
7h 14m
Merged PRs (30d)
2

Description

Currently `LibraryRef`s returned from `getIsolate` contain the library url three times - as Id, name, and uri. Isolate object contains a list of libraries that reaches a 1.7Mb for the ACX demo gallery.

Shortening the Id and the name might make the isolate smaller, take less memory in dwds and DevTools internal state, and even reduce the DevTools IPL. Might want to investigate and copy what VM does.

Example:
```
"libraries": [
{
"type": "@Library",
"id": "dart:_runtime",
"name": "dart:_runtime",
"uri": "dart:_runtime"
},
...
{
"type": "@Library",
"id": "package:collection/src/combined_wrappers/combined_iterator.dart",
"name": "package:collection/src/combined_wrappers/combined_iterator.dart",
"uri": "package:collection/src/combined_wrappers/combined_iterator.dart"
},
]
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing getIsolate and the LibraryRef construction that produces each library's id, name, and uri. Compare the representation with the VM, then measure the isolate size and internal-state impact; done means shorter ids and names reduce duplication while preserving the library uri and expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
performance, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.