SpeedMode Explained

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Optimizing Performance >

SpeedMode Explained

The SpeedMode property in TApolloTable is a little known secret that lets Apollo work in raw API mode.

Setting SpeedMode to True disconnects Apollo from the VCL. This allows Apollo to bypass the updating of TDataSet’s numerous internal buffers, which are required by data aware controls. In SpeedMode, Apollo communicates direcly with the underlying Apollo API allowing for the fastest possible performance.

In normal mode (i.e. SpeedMode=False), a call to Apollo’s Replace method for example must in turn call TDataSet class' SetFieldData procedure and various other FieldDef-related routines which adds overhead. In SpeedMode, the Replace method is mapped directly to the sx_Replace function with minimal other activity.

The caveat is that all UI controls, namely data-aware controls, do not get updated with the underlying data as it is being traversed or updated. Essentially SpeedMode disconnects the data-aware controls from being updated by Apollo. This is not to be confused with the DisableControls and EnableControls methods, which still require all internal TDataSet buffers to be updated. If you use DisableControls and EnableControls only, Apollo still updates the various VCL UI and data buffers behind the scenes.

So, if you're looking for a way to boost performance on data access involving traversing or updating large data sets, try using SpeedMode.

See Also

XBase and Delphi C++ Builder Behaviour