Hi, We were looking at the ways we can optimize our application. Our app does a simple sqlite3_exec and sends the callback as below. The data is just a map<string, vector<string> >
int sqlite3TableCallback(void* data, int ncols, char** values, char** headers) { map<string, vector<string> >& table = *(( map<string, vector<string> >*) data); for (int i = 0; i < ncols; i++) { if(values[i]) table.Data[headers[i]].push_back(string(values[i])); else table.Data[headers[i]].push_back(string()); } return 0; } Here, we wanted to optimize the string construction of string in table.Data[headers[i]]. We were happy to notice that the headers were pointing to the same address, hence we are planning to enhance the callback data so that it can track map<char*, string>, and then in the table.Data[headers[i]] we can pass reference to the string preventing its construction and destruction. Agreed, there will be another look-up in the map, for char* to string. Well, the bottom line, is it safe to assume that char** headers will be pointing to the same address through out the query (i.e. each time callback is called for a matching row). Regards, Prakash Bande Altair Engg. Inc. Troy MI Ph: 248-614-2400 ext 489 Cell: 248-404-0292 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users