-
Notifications
You must be signed in to change notification settings - Fork 1.7k
change to analyzer snapshots bumps dart binary size #50487
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
Comments
@jensjoha Could you try compiling analyzer as an AOT binary and see how big that is and how well it performs against the JIT version? |
You mean the analyzer snapshot, not the |
/cc @mit-mit |
FWIW, on Windows, with an empty project, |
I've tried it on several projects, and, as expected with this change, it reduces total time by about 400-600ms, due to reduced startup time. |
Just my 2 cents, but I'd be happy to pay the cost of 25MB on the SDK download to not pay that startup cost every time the analyzer starts. |
I'm honestly not sure what is being tracked in that benchmark. The title made me assume the |
Just on my machine, it's the analyzer snapshot file that increases in file size from |
There seems to be some misconception here. Whenever you load the analyzer (say open an IDE), before the VM started basically without any code compiled and would spend time doing that, making optimizations once the it had that information etc. Now it's ~just there from the start. |
Let me try to take everything in order:
The dart binary doesn't change. The file
I adressed this already but will do it again for completion. The golem benchmarks also says this: "analysis-server-cold-analysis: -21.7 % RunTimeRaw" and "analysis-server-warm-analysis: -24.1 % RunTimeRaw". The numbers will naturally vary depending on what's analyzed, but when I try on "pkg/compiler/lib" before and after with the cache already filled (via
I don't think an AOT snapshot can function the way the app-jit one does as there is some weird replacement thing happening when it's started from pkg/dartdev (e.g.
Yes, you are right.
Super. It's not just on my machine :D
I agree. Though to be fair it's ~25MB of storage. The sdk download is zipped and the difference is going to be less. Trying to just zip the new snapshot the output is 20MB, zipping the old snapshot the output is 11MB, so the change in download size is likely more like 9MB. |
@jensjoha thanks for clarifying and for the additional benchmarks! I really only filed this because the golem benchmark showed the jump which seemed to warrant the discussion. A 5% bump to total SDK size seems totally fine to me. 🤷 |
Could you file a bug to track this. I think we should figure a way to go this route also it would align with what we are running on Golem - all those benchmarks are AOT compiled.
So it is not that much different from JIT snapshot. (24Mb exe means around 20Mb of AOT snapshot). |
It's smaller than the trained jit snapshot :) |
|
The mentioned SDK size increase SGTM |
I'm satisfied; thanks for everyone's patience and responses! |
@jensjoha landed a change to how analyzer snapshots are trained.
This resulted in a sizeable bump to the size of the
dart
binary. This benchmark shows a bump from ~24MB to ~51MB. Is it acceptable and worth it? I have no idea who can/should answer this...@jensjoha, the change "makes it faster when first loaded". Given the case of a user that bumps their Dart SDK from 2.18 to 2.19, or a similar bump which maybe happens 2-4x a year, is the performance literally only improved on the first time one of these snapshots is invoked? Is the performance improvement seen only 2-4 runs a year?
I would think that better training would mean that performance is improved on every run...
CC @bwilkerson @athomas @mraleph @sortie
The text was updated successfully, but these errors were encountered: