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
Tool to determine line of code impact on generated JS size #9876
Comments
I used Source Maps for some rough estimates, but at present, they are not all that reliable for this purpose. To give an accurate picture, we would want to attribute each byte of JS with some source code. In general this is not possible, but even where it is, Source Maps are not the right tool since they map executable statements for single-stepping in the debugger. Only ~10% of the JS is referenced in Source Maps, but that is fine if that covers the start of each single-step reachable statement. We could try to abuse Source Maps by adding mappings between 'non-executable' fragments of JS and Dart to get a better picture of "Where's the beef?". I don't know if doing this will make the Source Maps less suitable for debugging. I'm not sure what to do about the little changes that have global impacts: Does the customer want this of plain code or minified code? (I think in most cases they would be proportional) |
Thanks Stephen. The customer is looking for insight into where the generated JS code is coming from. Adding a single line of Dart might pull in many, many lines of JS, so they are curious how to track it down. |
Added this to the Later milestone. |
Added TriageForM5 label. |
Removed TriageForM5 label. |
This comment was originally written by @sethladd This would be pretty useful for our app, which is clocking in at 4.2MB of JavaScript, which takes 20 seconds to load/parse the script on mobile. It would be awesome to figure out how we got to 4.2MB of JS. Our app is definitely not 4.2MB of dart source code :) |
This comment was originally written by @sethladd How about this initial idea: Print out how much noSuchMethod is costing you, and where you use it. If those are the biggest culprits (is this still the case?) then perhaps helping the developer find where and how often they are used is a good first step. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
A customer has asked for a way to determine the impact a line of Dart code has on generated JS file size. Their goal is to produce small and fast JS, and understanding cause and effect is important to them.
I think we started to use Source Maps when looking at dart:html output size, yes?
The text was updated successfully, but these errors were encountered: