5MB is large for a single bundle, I'd say if you are using lazy loaded modules 2MB for a single module is large.
Front-end performance varies in importance based on your context. In e-commerce performance is tied to conversion so it's very important. If you're a government contractor building CRUD apps, it's not as important.
I'm far from that, but "5MB is very large" to me is ludicrous. Press "play" on a Netflix movie and you're over that benchmark straight away.
I grew up in the era of sub-56k modems.
Just searching Google for "56k modems" returns 5.1 MB of data with an ad-blocker on.
Let's be realistic.
Open the profiler and see how long it takes for your computer to parse and execute those 5 megs of JS. especially if its not crafted in the right way for V8 or whatever to ignore the contents.
Also all the garbage your code might run on first run to get started. "Garbage" here being used as neutrally as possible (I like Python and it has a similar "pay init costs up the wazoo for anything" feelings)
I'm well aware of profiling as I am lead on this project.
No issues.
Great, now that that's sorted out: let's download a few MB of JSON, then parse that into Javascript data structure (more memory spikes), copy and slightly modify that about three times in different places, then use it to create a few representations of a "component" one of which will be a set of actual entries in the DOM. And we'll keep most of that around after we're done.
A reasonable rule of thumb is that on a low-end Android phone 100KB of JS takes about 1 second to download and parse. A 5MB bundle would take 50s or so to run. You probably don’t notice this if you’re only testing on fast PCs/macs, or modern iOS devices.
I deal with very large-scale Angular systems that handle this sort of stuff day in, day out ... can you give me an example of a 5 MB Angular payload that takes 50 seconds to execute?
Clearly this is on the developer.
https://developers.google.com/web/fundamentals/performance/o...
I'm two decades into this. As the lead on my current project, on both sides (Angular and C#), I know all about this.
We have performance benchmarks and to this point, we've had no issues.
What do you consider "unusually large in size?".
I am lead on a "large" Angular code-base, which compiles to less than 5 MB in production mode using lazy-loaded modules.
5 MB is often smaller than a picture of a cat people post online, and can be cached.
I think front-end developers often overthink "performance" and "bandwidth". Sure, it's great to keep things as small and concise as possible, but at the end of the day it gets a lot more nuanced.
I'm much more concerned about the C# code and the SQL than I am about anything Angular is doing in JS land.