Repository navigation
Enable hot restart on profile mode #37987
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)customer: dream (g3)team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamwould require significant investmentA PR would not be accepted without a plan for ongoing supportA PR would not be accepted without a plan for ongoing support
Description
Currently, performance debugging in profile mode is really time consuming because every small change requires a cold restart, which could take several minutes.
While hot reload is impossible in AOT profile build, hot restart should be possible according to @cbracken .
Let's enable it in flutter tools to significantly speedup our customers' performance debugging process.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)customer: dream (g3)team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamwould require significant investmentA PR would not be accepted without a plan for ongoing supportA PR would not be accepted without a plan for ongoing support
Activity
liyuqian commentedon Aug 9, 2019
@jonahwilliams : how difficult do you think this is?
jonahwilliams commentedon Aug 9, 2019
I think this would be at least several weeks of work, if only due to current structural issues with the resident runners. But there are a lot of unknowns too which could sink the whole thing.
jonahwilliams commentedon Aug 9, 2019
So I would classify as "needs investigation"
jonahwilliams commentedon Aug 10, 2019
Another caveat: We can only build the AOT artifacts in the runner using the "regular" workflow, I'm not sure if we know how to in google3. + @chingjun
chingjun commentedon Aug 10, 2019
"Regular" as in "not google3"? google3 doesn't support incremental builds for hot restart so we might need to fallback to the "regular" workflow anyway
I'm also concerned about whether incremental builds are possible in AOT mode with tree-shaking or obfuscation enabled, and how much faster that is than a full rebuild.
jonahwilliams commentedon Aug 10, 2019
I don't think they could be incremental. Any speed gain would need to come from skipping the platform build steps, such as APK/IPA packaging
liyuqian commentedon Aug 12, 2019
I see that this is challenging and needs investigation. Thank you for looking into this! I'll keep this issue open as a wish item of performance debugging?
fredlee12345678 commentedon Jul 16, 2020
@jonahwilliams do you plan to this issue? this is very useful feature for us, thanks
jonahwilliams commentedon Jul 16, 2020
We have no plans to work on this in the immediate future
2 remaining items
tjx666 commentedon Mar 10, 2021
I think it's very meaningful. I want to profile a add-to-app in profile mode, but the code sync to mobile is old which need hot restart like in debug mode.
fzyzcjy commentedon Apr 5, 2021
Hi, any updates? As we know, the startup time is important to user experience. Therefore, I want to know why my app needs several seconds to start - which parts need how much time, such that I can try to optimize the startup time.
In order to profile the app and see detailed stack, I need to open the DevTools (you know, that web page). However, it takes seconds to initialize and open devtools. Unfortunately, when devtools is finally opened, the app startup has almost finished! So I cannot profile anything for the startup procedure... :(
fzyzcjy commentedon Jul 14, 2021
3 months have passed... any updates?
feinstein commentedon Apr 20, 2022
Instead of having restart in profile mode, could we have the profile run wait for DevTools to be running to continue the app's execution?
Maybe the Flutter tool could have a flag to generate the websocket URL during the build and pass this url to the app and DevTools, so DevTools would know beforehand what URL to listen.
My problem is that I have a bit of jank in my app's startup, and just in some edge cases, but it's is extremely difficult to profile it, since DevTools would only start after the app is already running.
abdalmonem commentedon Jan 9, 2023
without hot restart profiling is too hard and time consumer , we keep waiting for this feature since 2019 ant till now there is no updates about :(
bkonyi commentedon Jun 30, 2025
Profile mode is meant to build an application that mimics release mode performance as closely as possible while allowing for performance profiling. This means that profile mode applications are built using ahead of time compilation (AOT), which does not support hot reload. Adding hot reload support would be a major change to the Dart AOT runtime and would introduce overhead into a profile mode application that wouldn't be present in a release application, defeating the purpose of profile mode.
feinstein commentedon Jul 1, 2025
@bkonyi I think you misread the post, we are not asking for hot reload, we are asking for hot restart.
The post even mentions what you said, that hot reload is not possible, but hot restart should be possible.
bkonyi commentedon Jul 2, 2025
You're totally right, I completely misread this. Thanks for letting me know!
That being said, this likely won't be picked up any time soon.