Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Performance

New Here ,
Dec 11, 2012 Dec 11, 2012

Hi

I read about revalidating data submitted in server side in many post.

I need to know the about perfromance statistics on validating a piece of data two times(client and server side).

regards

RKP

391
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2012 Dec 12, 2012

RKP_ wrote:

perfromance statistics on validating a piece of data two times(client and server side).

Client-side validation performance doesn't count, as far as you are concerned. The browser or some other client is in charge of that.

Server-side validation performance depends on how much validation you wish to do, and how robustly.  Perhaps the commonest form of server-side validation is the validation of form and URL variables. ColdFusion has functions like isValid, isDefined, structKeyExists, len, and so on, that enable you to perform most validation tasks.

The performance cost of calling these functions is negligible in the context of page execution times of, say, several seconds. However, if your validation code involves the creation and manipulation of a large number of objects, or connecting to another server(database, ftp, http, mail), then the performance cost could be as high as tens of seconds per page request or even minutes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2012 Dec 12, 2012
LATEST

Client side validation is done to make your app more useable.  Server side is done to make it more reliable.

Deciding whether or not to do it depends on:

1.  The liklihood of client side validation being bypassed, and

2.  The consequences of bad data being processed.

As BKBK suggested, most of the time we are talking about nanoseconds.

If you want to see for yourself, do this.

<cfset startTicks = GetTickCount()>

validation code

<cfdump var="#GetTickCount() - startTicks# msecs">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources