William F. Dowling wrote:
> mysqlpp::Query query = con.query();
> query << "call get_some_data(" << mysqlpp::quote
> << ck << ")";
> mysqlpp::Result res = query.store();
You do realize that a store() query puts the entire result set in
memory? If the result set is large, your speed hit could be due to
virtual memory thrashing. If so, switch to a use() query. Read the
user manual for details.
> if (res) {
> mysqlpp::Row row = res.at(0); // count returns one row
> *result = row.at(0).get_string();
See the reference manual as of the 2.3.2 release for why get_string() is
inefficient. Something more like this should do better:
if (res) {
mysqlpp::Row row = res.at(0);
result->assign(row.raw_data(0), row.raw_size(0));
This makes a straight copy from the mysqlpp::Row innards into the
std::string, no temporaries.