I'm currently writing a client-side javascript app which performs image manipulation. Some of the operations it performs currently are quite slow to run in the browser (taking in order of 2-3 seconds)
One solution I'm looking to implement is to have the client receive result information via a websocket from a server (websocket rather than AJAX because it needs to display realtime information etc.) and have the server do the heavy lifting of the image manipulation
Node.js is an obvious candidate being also written in Javascript - however my first thought is that there will be no performance advantage (my client side is running in Chrome/V8 and Node.js is also V8) - am I correct in thinking this? Or does the UI of Chrome necessitate performance losses on the client that won't be felt on the server side? (e.g. does Chrome do more UI work in the background to keep everything responsive that a node.js server wouldn't spend its time doing?)
Will node.js have any performance advantage at all, or am I better off looking into C or Java web socket servers to do the work?
The client is probably the better place to do image manipulation if you are doing it in javascript. The nice thing about the client is that you've got the processor (mostly) to yourself...if you have 20 people doing image manipulation at once, they will be doing it on 20 machines.
There are obviously some places where it makes more sense to do image manipulation on the server, and in those cases it may well be smart to consider using things other than javascript. V8 on the server isn't going to run much faster than on the client, and node isn't really made for cpu intensive tasks.
There are probably some interesting cases where you'll want to do interactive stuff on the client, and then do the final stuff on the server, and in that case there is a big advantage to node, since you can use the same code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With