Need hardware to make a single javascript web browser process run faster

Matthew_184

Commendable
Nov 20, 2016
2
0
1,510
Which hardware component(s) in a computer will make a single javascript process (single tab) in a web browser (Chrome for example) run faster? I've written a script which runs in a single web browser process to handle a huge amount of data (I'm doing some scientific research), but it takes forever for it to run. I realize javascript is not the best language to use for this type of thing, but I've spent a couple months writing the script, so I'd prefer to just buy a powerful computer to make it work. I want to know what pieces of hardware I should be shopping for that are the pieces that have the most impact on running a single tab's process in a web browser for javascript code.

Thanks!
 

kanewolf

Titan
Moderator
Have you investigated a javascript compiler -- https://developers.google.com/closure/compiler/ ?

Your storage system could be the limiting factor. It is the slowest part of a computer (assuming your data is local to the computer). If not, then the network is the slowest part. CPU clock speed, CPU cache and RAM are usually the next contributing factors. What hardware are you running on now?

You may have written the script inefficiently. Have you run a javascript profiler -- https://developers.google.com/web/tools/chrome-devtools/rendering-tools/ ? A profiler will identify where in the code time is being used and how many times a line of code is being executed. For example if you are doing I/O a byte at a time rather than a 1K byte your code will be much less efficient.

Sometimes a hardware upgrade is the right answer, sometimes fixing inefficient code is the only answer.
 

Matthew_184

Commendable
Nov 20, 2016
2
0
1,510
Thanks for the good info. Here are some follow-ups...





 

kanewolf

Titan
Moderator
You need the profiler data to move forward. If you have a LOT of data, then RAM may be limiting. You could be "swapping" at the O/S level. What percentage of your runtime is data loading? Have you monitored CPU usage? Is one core always maxed out?
 

TRENDING THREADS