-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Potential analyzer regression in 3.7 / Flutter 3.29 release #60335
Comments
With performance issues (Flutter 3.29.1, Dart 3.7.0)
Initial Analysis Driver Timings
Action in IDEMultiple cycles of the following steps (in Android Studio):
Some formatting operations are almost instantaneous (i.e. line break removed), but most of them just never happen... Please, note that this is just an example of the slowness that is happening; most of the Dart tool chain seems to be very slow (like code highlighting, auto completion, auto import, etc..) Analysis Driver Timings
Reportdart_analyzer_diagnostics_report.json Without perf issue (Flutter 3.27.2, Dart 3.6.1)
Initial Analysis Driver Timings
Action in IDEMultiple cycles of the following steps (in Android Studio):
Auto formatting almost instantaneous Analysis Driver Timings
Reportdart_analyzer_diagnostics_report.json PS: With Flutter 3.29.1 and Dart 3.7.0, I occasionally encounter situations where the Dart Analyzer Diagnostics won't open, while syntax highlighting and formatting in the IDE become completely unresponsive. Hope this additional information might be helpful. |
cc @jensjoha |
Hello @mraleph, I wanted to check if my previous report was helpful. Please let me know if there's anything else I can do to assist! |
Hope this helps. I ran into the same issue and fixed it by removing the
As far as I remember, these experimental flags were introduced shortly before
|
@sgrekhov: did you have any plugins specified in your removed analysis options? |
No. Experimental flags only. |
@VivienStreit we (or more specifically @jensjoha) might have identified one possible source of the regression in 3.7, @pq has made a patch to try undo the offending change. If I produce a custom 3.7 SDK build for you would you be willing to test it out to see if it solves the problem for you? If yes - please let me know what platform to build SDK for. |
Here are the instructions to test: Mac OS X (Apple Silicon)
The Dart SDK is unsigned so you might hit some hiccups with Mac OS X security policies. You should be able to work around that by adding your IDE to Windows (X64)Note Instructions below use PowerShell commands.
Linux (X64)
|
I am interested. Mac OS Apple Sillicon and Windows 11 Machine too. |
@petrnymsa see instructions in this comment: #60335 (comment) I have now produced both versions of the SDK |
I just tried the updated SDK on Windows. I believe I have a good project for testing development tools (23,000+ files, thousands of which have intentional compile-time errors). I didn't follow the instructions above, but simply downloaded the SDK and replaced my own. There was an analyzer server crash on https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmenting_members_A04_t05_lib.dart. Yes, this is an experimental feature, but the analyzer server shouldn't crash anyway. Failure report issue-1.md. |
@scheglov For the crash report. |
Thanks, @sgrekhov! This is really interesting. FYI + @stereotype441, @johnniwinther for context around possible augmentation library performance issues |
I have tested the dart-sdk with the fix today (Mac OS Silicon, with Android Studio) in a project with over 1K files and it has worked as expected, syntax highlighting, formatting, auto completion, auto imports all very good. I will continue testing with other projects. |
Fantastic. That's encouraging. Thanks for the feedback @luis901101! |
@luis901101 just to double check - you get a better experience (e.g. faster completion, etc) than you were getting with Flutter 3.29 / Dart 3.7? |
Affirmative. |
@luis901101 Thanks! That's very reassuring. Please keep us posted if you observe any issues. |
I hope others also to test the sdk fix and share their experiences... in my case it has been really weird because Android Studio had the issue but VSCode not (or at least not so hard as Android Studio)... but I have read that other users had issues with VSCode... nevertheless today after downloading the sdk Android Studio has been working great. |
Is it possible to test this SDK on linux? |
@nietsmmar I have built an SDK version for Linux X64 and updated instructions above. (They are basically the same as for Mac OS X - just a different SDK download link). |
@mraleph I just tested it the last hour and it is definitely a lot faster again! :) |
@mraleph if the testing goes well, how long do you think it will be until we finally get an updated Dart/Flutter release with this change? So far (knock on wood), it looks like it's definitely working. Thanks in advance. |
@diegotori right now it is targeting the next stable release. Given the severity we might consider CP into the current stable - I will inquire about the current schedule to see if that is feasible. |
@mraleph to be brutally honest, this definitely warrants a CP, mainly because it's affecting my day-to-day usage of Dart/Flutter and Android Studio. It takes forever for changes to propagate due to this issue. That and I don't think myself and the rest of my team can wait until I/O for that change to make it to stable. Bottom line, since this is a Tier 1 issue affecting every developer, this definitely requires a new |
@diegotori I got a confirmation that CP window for current stable is still open, so it should be possible. @pq could you prepare a CP for this? We probably need to let it cook a bit more (e.g. it should go through all rolls at the very least) - but after that happens we should be able to CP into the current stable. |
We have an issue suggesting that that fix might have caused other problems: #60463. We'll look to see whether we can mitigate the crashes without regressing the performance. Edit: fixed the link to the issue |
Speaking of our own productivity, the occasional crash would be preferred to the current sluggishness :) |
@mraleph any updates, since it feels like progress has stalled somewhat on the fix. Thanks in advance. |
@bwilkerson : did this get resolved? |
We decided that the performance problem would impact users more than the crashes, so we will be shipping the fix for the performance problem even though we have not yet resolved the problem with crashes. I am working toward fixing the crashes, but it won't be a small enough change to CP, even if I can get the work done soon (which is an unknown). |
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/421341 |
Just a tip for vscode user: in order to test this dart-sdk, please update new sdk in settings.json and restart vscode
|
After testing I've noticed it's gotten much faster compared to before but what I'm getting now is the occasional Android Studio just freezing (on MacOS) and not being able to do anything until I force close it |
@jwren For visibility. As far as I'm aware, none of the changes we made to improve performance could cause Android Studio to freeze because they're all running in a separate process. I suspect that what you're seeing is a different problem. |
We have reports about potential regression in Flutter 3.29 / Dart 3.7 release which causes long analysis times.
If you are experiencing those please follow the instructions provided here to collect some information and post it here.
It would be especially helpful if you also collect a similar report using the previous version of Flutter / Dart which did not exhibit performance issues.
The text was updated successfully, but these errors were encountered: