Timings: Angular Cli

Update 22 July 2016 – Version 1.0.0-beta.10

I have been using beta’s and pre-beta’s of a number of client and server side technologies over the past couple of years. I have been enjoying all of them with the exception of one thing, time to get up and running with the client side frameworks.

Rather then me telling you of my experiences and the struggles of working with pre-release software, I’ll take you through the entire process of going from zero to a base project on Angular 2 using the new(ish) Angular CLI, which can be found over on github

I already had node installed so not exactly zero, close enough though
image

First off we need to get the CLI
image
Note: at the time of running this test the version of the Angular CLI was 1.0.0-beta.8

Install time: 5 minutes – not too bad, but not great. At least I don’t have to do this more than once.
Install time: 3 minutes; this is much more acceptable

Next up is the creation of the base solution that I can then start working with
image

Generation time: 4.5 minutes – for me this is far, far too long. I need to be up and running much quicker than this. So why so long?
Generation time: 5.5 minutes – a whole minute longer!

I revisited this a few times, allowing the cache to “warm up”, unfortunately no change. Creating a new project was always in the 4.5 – 5 minute range. I have to guess that the CLI is not currently utilising any caching; if it were I would expect to have seen all additional runs of ng new to be faster than that initial run. It’s still in beta so that’s ok for now.

So why did it take so long to create the new project? Lets take a look at the folder the new project was created in to try and figure this out.
image

Just in case you can’t read that. Running ng new creates a starter project with a little under 43 thousand files, just to be clear, that’s 43,000 files put on disk, totalling a whopping 168 MB (214 on disk) – wow.
The starter project now contains 41.5 thousand files, which isn’t much better that it was previously, only now it is a total of 194MB (239 on disk) – wow, wow, WOW! What is going on?

Is it just me or does this seem just a little crazy? Do we seriously need all of those files? From my point of view, and a very simplistic answer, is “No, of course we don’t.”

Couple of things to point out here:

  1. The Angular CLI is still in beta, so I am hoping that the overall performance of creating a new project will improve as the project matures and gets closer to RTM. For me project creation has got to be down to a couple of minutes max!
  2. Is the use of NPM all that it’s cracked up to be?
    I use node from time to time and am finding the module system to be getting out of hand. Installing one module results in dozens, if not hundreds, of other modules being dragged in. Some of these modules are single functions that don’t do anything more than to allow developers to be really lazy. Just take a look the the left-pad mess
    The number of files on disk to generate a very simple Angular 2 app is ridiculous. 43 thousand files for what is not much more than “Hello, world” is nonsense. An alternative needs to be found to this. I build lots of projects, real, prototypes, tutorial, etc. and having each one of those take so long to build and use up that much disk space is criminal. Bytes matter people and we need to look back to those dark ages when we had to justify every single byte we sent over the wire. If you are a developer that is building node modules please think carefully about adding dependencies on other modules that themselves have dozens of dependencies. Honestly, sometimes it is better for the community as a whole if you just implement your own left-pad.

In my next post I’ll take a look at the time it takes to go from zero to getting a base project for Aurelia.

That’s about it for now. Thanks for reading and see you next time.

Leave a comment