How to Optimize Clarion Code for Better Performance

Hi Priyal

as others have suggested, more information would be helpful.

obviously things like database query efficiency is largely outside the realm of Clarion, but could make an enormous difference. Having said that, you need to be sure any filter is being executed on the backend and all the data is not being passed over the network to your program to be filtered locally. Others will know a lot more about that than me, but you can do various traces and check what query is being passed to the backend database - and of course different backends will have different tools for query optimisation. Perhaps adding (or using) an index will make a large difference so that only a small subset of the complete dataset needs to be accessed.

on the Clarion side, there are lots of small things you can do to increase efficiency. These can add up and make a large difference. For example, I often see code that has unnecesssary clip() statements in, or that passes string data by value rather than by reference. All things that slow down code.

however the first thing you need to establish is where the bottleneck is. There is no point spending a large amount of time optimising code that is rarely used or only constitutes a tiny part of the elapsed time. Others have pointed out that Capesoft have a profiler which may be useful.

hth and cheers

Geoff R