Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

Client-side JavaScript vs. Server-side Java - Performance

I would like to add up the values in rows coming back from a database in a result set so that I get subtotals and totals in a JSP using Javascript.  Say there were 200 hundred rows with 3 columns needing subtotals and totals, would performance be faster on the client using Javascirpt or would it be faster and more efficient to sum up the values on the server, like Websphere for instance?
0
jwright9
Asked:
jwright9
  • 2
  • 2
2 Solutions
 
-null-Commented:
Hi,

Server side rendering of the data will always be faster.  Firstly, the server will more than surely be superior in power, and the engine used on the server will have a far faster throughput than javascript.

Secondly, if you were to use client side scripting to render the data, you are reliant on a number of things, namely that the pc the browser is on is fast enough to render the data without it taking too long, and that the client's browser actually has javascript enabled!  This is especially important if you want to take accessibility into account, as the browser being used might not be sophisticated enough to render javascript.

hth

-null-
0
 
Ray PaseurCommented:
Clients can turn off Javascript.  Also, if you want to do Javascript calculations, you must first send the data to the browser.  Depending on the amount of data you must send, this can be a bit time-consuming.  I would go the server route, too.

Best, ~Ray
0
 
jwright9Author Commented:
Thanks to both of you experts!  I will take your counsel.  I have always heard since the beginning of the Web era, do it on the server!
0
 
jwright9Author Commented:
Very good help!  I'm glad there are folks like you on EE!
0
 
Ray PaseurCommented:
Thanks for the points and for your kind words! ~Ray
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now