Changes between Version 67 and Version 68 of DeveloperGuidelines/Optimisation


Ignore:
Timestamp:
03/29/11 22:19:42 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Optimisation

    v67 v68  
    275275Ah - so you think that your onvalidation function will be called only once after the user has submitted the form, and so it doesn't harm that it takes 50ms compared with 600ms for the rest of the request? Maybe you're wrong: in an XML import of 100.000 records that same onvalidation routine would be called 100.000 times in a single request, which would give 1 hour 23 minutes for your onvalidation function alone, compared to 600ms for the rest of the request!
    276276
     277Also be careful in representation functions, especially when used in validators (IS_ONE_OF!). If the table contains thousands of records, then the representation will be called many many times to build a single form field (autocompletes can help!).
     278
    277279Hence:
    278280Always think in scales of a few thousand records, especially for sequentially called routines like representation of field values, onvalidation and onaccept functions. Do you really need to do all this once per record, or could it be done just once in the request?