CPU is Bottle necking, Looking to Upgrade

My Ionic v3 project is getting rather large, and updating is taking forever (over 15sec after every save). Taking a look at Task Manager, it looks like nodejs is bottle necking my CPU during compile. With that being said, I think I need to upgrade my CPU.

Currently I’m using a i5-4690K with 4 Cores, 4 Threads @ 3.5GHz
I’m thinking about upgrading to a i9-7890XE with 18 Cores, 36 Threads @ 2.60 GHz

Before I make this investment I wanted to ask if you think it will help with the compiling time (updating after every save)? Am I overlooking something?

Do you have an ssd already? Generally when you save all that’s happening is transpiling from typescript into javascript which shouldn’t be super cpu intensive. However, a lot of file read/write is going on. Note that Node (like regular JS) is single threaded, so it’s probably only using one thread. What could be happening though is that your read/write is so slow that all the read writes stack up in the queue and since they can’t be completed soon enough Node ramps up to 100. It also means that unless the ionic’s build process is using clustering in node extra cores will not help you in any way (I don’t know if they are but…probably not).

Another thing to consider if it’s relevant to you is that per Ionic’s last blog post the next version will use the Angular CLI. The angular CLI allows hot module replacement so that when you save only the module you are currently working on is transpiled. If you have a good modular codebase this could be a huge time saver.


I’m currently using this SDD: http://ssd.userbenchmark.com/Crucial-MX300-525GB/Rating/3643

Based on the site, it is above average.

Interesting. Well, I’d think it wouldn’t be that bad, but if you have a huge codebase and are using a huge number of libraries that are all transpiling…it might just be the reality. However, more cores but lower clock speed almost certainly won’t help you. You could dig in to see if anything Ionic uses is clustered, I just don’t think so. I think there’s a way to see per-core or per-thread usage too…can’t remember though, you could take a glance at that if so.

I’d bet the Angular CLI would help you greatly. Sass isn’t re-transpiled every time since it’s local to each component, you can use hmr to only transpile the current module, etc.

Unfortunately I don’t know what else to tell you :confused:

1 Like