Skip to main content
Participant
December 12, 2012
Question

Performance

  • December 12, 2012
  • 2 replies
  • 423 views

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

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 12, 2012

    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">

    BKBK
    Community Expert
    Community Expert
    December 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.