• Welcome, Guest. Please login.
 
September 17, 2019, 10:52:38 am

News:

Welcome to the SQLitening support forums!


slF vs. slFN

Started by Bern Ertl, April 09, 2015, 10:56:05 am

Previous topic - Next topic

Bern Ertl

I have a section of code that is reading data from a remote db and populating a grid control.  The performance is not where I want it to be currently, so I'm tweaking things trying to optimize it.

This section of code is "generic" in that it can be called from different points with different criteria on what fields (db columns) need to be read/loaded.  I'm using a bit array to designate which fields/columns should be included.  The code builds the SELECT statement based upon which bits/columns are true/selected.

As such, the field position for a given column may change depending upon the selection criteria.  I was using slFN with column names to keep the code simple and clear.

But when I added a bunch of code to index the positions of each selected column and then use slF instead of slFN, I saw a roughly 30% speed increase over my modest test data.

This is just an FYI.  I knew that slFN added some extra processing to find the column position, but I didn't expect it to be that significant.

cj

I have never needed slFn or used it since I normally place all data into arrays.

For any lurkers the column names are easily obtained in element 0 of slSelAry or using slGetcolumnName(column.)

30%, thanks for the info, Bern!





Bern Ertl