-
Notifications
You must be signed in to change notification settings - Fork 212
Long-term performance: AssetGraph #787
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
We do have nodes in the asset graph for all those things, but we don't actually compute modules/summaries/ddc for anything that isn't imported by a real entrypoint - or at least not if you set them as "optional" which should be done for those actions as well as the module action. |
Ya you could try creating a build.yaml which overrides the ddc_bootstrap_builder to only run on web entrypoints (that one is what actually causes things to get built). I am not actually 100% sure we expose that builder separately though from the config. |
(using generate_for) |
we could also try to make it smart about not running on entrypoints that are clearly not web - but that is tricky |
I mean I know we essentially do the same waste on Bazel to an extent, but I think (?) the difference here is the asset graph is more separated than our implementation. Anyway, haven't seen any obvious performance problems yet, though here is a build on my Macbook Pro:
I'm not 100% sure how to read this yet, but 200ms for a read doesn't seem bad considering it's only on a cold start. We should start to get more realistic numbers with stuff like the angular components gallery though. |
Yes - we haven't seen big enough issues with it yet to bother trying to optimize it. As soon as we do it should be relatively straightforward to replace the format as its broken out into separate classes that do the serialization/deserialization. Some sort of format that allows incremental updating would be ideal - we could even consider using a local database or something. Pretty much everything is on the table. |
Were there other logs between that? It should only build a new asset graph if it invalidated the previous one, which it should give you a message about. |
|
Ah looks like the logs are a bit confusing in that case because I think the log about the build actions changing happens while we are reading in the graph, and log the finished line. Probably not a huge issue but it is a bit confusing. |
|
I wonder how this has changed with optional builders. @natebosch? |
Optional builders still have nodes in the graph - they just might not be built. |
(fwiw, ddc/summaries/modules have always been optional, or at least for a long time) |
Ah my mistake, thanks. |
One particular thing we should look at is the memory usage of the AssetGraph. It looks like the VM representation can end up being way bigger than the json representation which is a hint that there is some canonicalization happening in our Json representation (we don't repeat strings) that needs to be happening for our AssetGraph. One thing that is likely happening is we're holding on to multiple copies of duplicate AssetIds (which have duplicate String references). |
Closing in favour of #3811 I'll be looking at the asset graph next: precisely to deduplicate anything that can be deduplicated and remove anything that can be removed. |
I've uploaded the
e2e_example/.../asset_graph.json
(formatted).It is about 1.5mb, for what basically is a "Hello World" with DDC. I'm not sure what a typical angular project or something a bit more substantial might look like - maybe not a huge deal?
A couple things I saw looking at the output:
.errors
. outputs, create source maps etc.Maybe we need a way of excluding tooling-only packages manually (or with heuristics)?
I might misunderstand, though.
The text was updated successfully, but these errors were encountered: